{"action":"created","issue":{"url":"https://api.github.com/repos/outworkers/phantom/issues/751","repository_url":"https://api.github.com/repos/outworkers/phantom","labels_url":"https://api.github.com/repos/outworkers/phantom/issues/751/labels{/name}","comments_url":"https://api.github.com/repos/outworkers/phantom/issues/751/comments","events_url":"https://api.github.com/repos/outworkers/phantom/issues/751/events","html_url":"https://github.com/outworkers/phantom/issues/751","id":257459580,"number":751,"title":"Cannot find primitive implementation for class A","user":{"login":"loostro","id":1419884,"avatar_url":"https://avatars3.githubusercontent.com/u/1419884?v=4","gravatar_id":"","url":"https://api.github.com/users/loostro","html_url":"https://github.com/loostro","followers_url":"https://api.github.com/users/loostro/followers","following_url":"https://api.github.com/users/loostro/following{/other_user}","gists_url":"https://api.github.com/users/loostro/gists{/gist_id}","starred_url":"https://api.github.com/users/loostro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loostro/subscriptions","organizations_url":"https://api.github.com/users/loostro/orgs","repos_url":"https://api.github.com/users/loostro/repos","events_url":"https://api.github.com/users/loostro/events{/privacy}","received_events_url":"https://api.github.com/users/loostro/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-09-13T17:27:22Z","updated_at":"2017-09-13T17:37:07Z","closed_at":null,"author_association":"NONE","body":"As a follow up on our chat with @alexflav23, it seems I've hit a corner case where implicit `Primitive[List[A]]` is not generated even though it should given an implicit `Primitive[A]` is in scope.\r\n\r\n```\r\nimport com.outworkers.phantom.dsl._\r\nimport spray.json._\r\nimport pl.iterators.kebs.json.{KebsSpray, KebsEnumFormats}\r\n \r\ncase class CardNumber(value: String) extends AnyVal\r\ncase class CardStatus(value: String) extends AnyVal\r\ncase class CustomerId(value: UUID)   extends AnyVal\r\n \r\ncase class CustomerCard(number: CardNumber, status: CardStatus)\r\n \r\n// removed other fields from \"Customer\" for brevity\r\ncase class Customer(id: CustomerId, cards: List[CustomerCard])\r\n \r\nabstract class Customers\r\n  extends Table[Customers, Customer]\r\n  with KebsSpray.Snakified\r\n  with KebsEnumFormats {\r\n \r\n  // Kebs macros supply the implicit JsonReader[CustomerCard] and JsonWriter[CustomerCard]\r\n  // used by the toJson and parseJson methods from spray.json package\r\n  implicit val customerCardPrimitive: Primitive[CustomerCard] =\r\n    Primitive.json[CustomerCard](_.toJson.toString)(_.parseJson.convertTo[CustomerCard])\r\n \r\n  override def tableName: String = \"customers\"\r\n \r\n  object id          extends UUIDColumn() with PartitionKey\r\n  object cards       extends JsonListColumn[CustomerCard]()\r\n}\r\n```\r\n\r\nTried with versions: `2.13.5` and `2.14.4`, both produced the same results. The code above is a trimmed version. When trying to compile the actual project I am getting error:\r\n\r\n```\r\n[error] /{.. trimmed ...}/Customers.scala:28: Cannot find primitive implementation for class CustomerCard\r\n[error]   object cards       extends JsonListColumn[CustomerCard]()\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/outworkers/phantom/issues/comments/329241959","html_url":"https://github.com/outworkers/phantom/issues/751#issuecomment-329241959","issue_url":"https://api.github.com/repos/outworkers/phantom/issues/751","id":329241959,"user":{"login":"loostro","id":1419884,"avatar_url":"https://avatars3.githubusercontent.com/u/1419884?v=4","gravatar_id":"","url":"https://api.github.com/users/loostro","html_url":"https://github.com/loostro","followers_url":"https://api.github.com/users/loostro/followers","following_url":"https://api.github.com/users/loostro/following{/other_user}","gists_url":"https://api.github.com/users/loostro/gists{/gist_id}","starred_url":"https://api.github.com/users/loostro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loostro/subscriptions","organizations_url":"https://api.github.com/users/loostro/orgs","repos_url":"https://api.github.com/users/loostro/repos","events_url":"https://api.github.com/users/loostro/events{/privacy}","received_events_url":"https://api.github.com/users/loostro/received_events","type":"User","site_admin":false},"created_at":"2017-09-13T17:37:07Z","updated_at":"2017-09-13T17:37:07Z","author_association":"NONE","body":"Also tried removeing the `extends AnyVal`:\r\n\r\n```\r\ncase class CardNumber(value: String) //extends AnyVal\r\ncase class CardStatus(value: String) //extends AnyVal\r\n```\r\n\r\nAlso tried simple types:\r\n\r\n```\r\ncase class CustomerCard(number: String, status: String)\r\n```\r\n\r\nThey produced the same compilation error."}}
{"actor":{"display_login":"loostro"}}