{"action":"created","issue":{"url":"https://api.github.com/repos/slick/slick/issues/1270","labels_url":"https://api.github.com/repos/slick/slick/issues/1270/labels{/name}","comments_url":"https://api.github.com/repos/slick/slick/issues/1270/comments","events_url":"https://api.github.com/repos/slick/slick/issues/1270/events","html_url":"https://github.com/slick/slick/issues/1270","id":104523715,"number":1270,"title":"slick 3.0. mapping custom fields from case class","user":{"login":"initmax","id":1445844,"avatar_url":"https://avatars.githubusercontent.com/u/1445844?v=3","gravatar_id":"","url":"https://api.github.com/users/initmax","html_url":"https://github.com/initmax","followers_url":"https://api.github.com/users/initmax/followers","following_url":"https://api.github.com/users/initmax/following{/other_user}","gists_url":"https://api.github.com/users/initmax/gists{/gist_id}","starred_url":"https://api.github.com/users/initmax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/initmax/subscriptions","organizations_url":"https://api.github.com/users/initmax/orgs","repos_url":"https://api.github.com/users/initmax/repos","events_url":"https://api.github.com/users/initmax/events{/privacy}","received_events_url":"https://api.github.com/users/initmax/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-02T16:37:44Z","updated_at":"2015-09-22T12:28:33Z","closed_at":"2015-09-22T12:28:32Z","body":"case class:\r\n\r\n`     case class H(\r\n    id: Option[Long] = None,\r\n    idUser: Option[Long] = None,\r\n    title: Option[String] = None,\r\n    ...) `\r\n\r\nslick table: \r\n\r\n    `class TH(tag: Tag) extends Table[H](tag, \"H\") {\r\n    \r\n      def id = column[Long](\"ID\", O.PrimaryKey, O.AutoInc)\r\n    \r\n      def idUser = column[Long](\"ID_USER\")\r\n    \r\n      foreignKey(\"USER_FK\", idUser, TableQuery[TUser])(_.id, onUpdate = ForeignKeyAction.Restrict, onDelete = ForeignKeyAction.Cascade)\r\n    \r\n      def * = (id, idUser) <>( {\r\n        case (id: Option[Long], idUser: Option[Long]) => H(id, idUser)\r\n      }, { th: TH => Some((th.id, th.idUser)) })\r\n    }`\r\n\r\n Got compilation error.\r\n\r\n```\r\n Error:Play 2 Compiler:    def * = (id, idUser) <>( {\r\n    Error:Play 2 Compiler:                             ^\r\n    Error:Play 2 Compiler: \r\n       }, { hq: TH => Some((hq.id, hq.idUser)) })\r\n                               ^\r\n    No matching Shape found.\r\n    Error:Play 2 Compiler:  Slick does not know how to map the given types.\r\n    Error:Play 2 Compiler: \r\n     Possible causes: T in Table[T] does not match your * projection. Or you use an unsupported type in a Query (e.g. scala List).\r\n       Required level: slick.lifted.FlatShapeLevel\r\n          Source type: (slick.lifted.Rep[Long], slick.lifted.Rep[Long])\r\n    Error:Play 2 Compiler: \r\n        Unpacked type: (slick.lifted.Rep[Long], slick.lifted.Rep[Long])\r\n          Packed type: Any\r\n       def * = (id, idUser) <>( {\r\n    Error:Play 2 Compiler:                         ^\r\n    Error:Play 2 Compiler: \r\n     (compile:compileIncremental) Compilation failed\r\n     Total time: 9 s, completed Sep 3, 2015 11:58:13 AM\r\n    \r\n    Error:(88, -1) Play 2 Compiler: \r\n     missing parameter type for expanded function\r\n     The argument types of an anonymous function must be fully known. (SLS 8.5)\r\n     Expected type was: ? => ?\r\n```\r\nCould you please clarify how can I map properties in the correct way ?"},"comment":{"url":"https://api.github.com/repos/slick/slick/issues/comments/142273086","html_url":"https://github.com/slick/slick/issues/1270#issuecomment-142273086","issue_url":"https://api.github.com/repos/slick/slick/issues/1270","id":142273086,"user":{"login":"szeiger","id":54262,"avatar_url":"https://avatars.githubusercontent.com/u/54262?v=3","gravatar_id":"","url":"https://api.github.com/users/szeiger","html_url":"https://github.com/szeiger","followers_url":"https://api.github.com/users/szeiger/followers","following_url":"https://api.github.com/users/szeiger/following{/other_user}","gists_url":"https://api.github.com/users/szeiger/gists{/gist_id}","starred_url":"https://api.github.com/users/szeiger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szeiger/subscriptions","organizations_url":"https://api.github.com/users/szeiger/orgs","repos_url":"https://api.github.com/users/szeiger/repos","events_url":"https://api.github.com/users/szeiger/events{/privacy}","received_events_url":"https://api.github.com/users/szeiger/received_events","type":"User","site_admin":false},"created_at":"2015-09-22T12:28:32Z","updated_at":"2015-09-22T12:28:32Z","body":"`The argument types of an anonymous function must be fully known` is key here. You need type annotations for those PartialFunctions."}}