{"action":"created","issue":{"url":"https://api.github.com/repos/scala/bug/issues/11274","repository_url":"https://api.github.com/repos/scala/bug","labels_url":"https://api.github.com/repos/scala/bug/issues/11274/labels{/name}","comments_url":"https://api.github.com/repos/scala/bug/issues/11274/comments","events_url":"https://api.github.com/repos/scala/bug/issues/11274/events","html_url":"https://github.com/scala/bug/issues/11274","id":384205455,"node_id":"MDU6SXNzdWUzODQyMDU0NTU=","number":11274,"title":"Problem with implicit higher-kind-yielding typelevel computation","user":{"login":"ctongfei","id":5746409,"node_id":"MDQ6VXNlcjU3NDY0MDk=","avatar_url":"https://avatars1.githubusercontent.com/u/5746409?v=4","gravatar_id":"","url":"https://api.github.com/users/ctongfei","html_url":"https://github.com/ctongfei","followers_url":"https://api.github.com/users/ctongfei/followers","following_url":"https://api.github.com/users/ctongfei/following{/other_user}","gists_url":"https://api.github.com/users/ctongfei/gists{/gist_id}","starred_url":"https://api.github.com/users/ctongfei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctongfei/subscriptions","organizations_url":"https://api.github.com/users/ctongfei/orgs","repos_url":"https://api.github.com/users/ctongfei/repos","events_url":"https://api.github.com/users/ctongfei/events{/privacy}","received_events_url":"https://api.github.com/users/ctongfei/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-11-26T07:31:47Z","updated_at":"2018-11-26T18:12:45Z","closed_at":null,"author_association":"NONE","body":"```scala\r\nclass FloatTensor[A]\r\n\r\ntrait DType[R] {\r\n  type Tensor[_]\r\n}\r\n\r\nobject DType {\r\n  type Aux[R, T[_]] = DType[R] { type Tensor[A] = T[A] }\r\n\r\n  implicit val float: DType.Aux[Float, FloatTensor] = new DType[Float] {  // ***\r\n    type Tensor[A] = FloatTensor[A]\r\n  }\r\n}\r\n\r\nobject Bug extends App {\r\n\r\n  def f[T[_], R](implicit dType: DType.Aux[R, T]) = ???\r\n\r\n  f(dType = DType.float)   // Failure here even if the implicit val is EXPLICITLY given\r\n\r\n}\r\n```\r\n\r\nThis fails compilation by issuing the following message:\r\n```\r\nError:(27, 3) inferred kinds of the type arguments (nexus.DType.float.Tensor[A],Float) do not conform to the expected kinds of the type parameters (type T,type R).\r\nnexus.DType.float.Tensor[A]'s type parameters do not match type T's expected parameters:\r\ntype Tensor has one type parameter, but type T has one\r\n  f(dType = DType.float)\r\n```\r\n\r\nThis is clearly weird: what does it mean that \"type `Tensor` has **one** type parameter, but type `T` has **one**\" ???\r\n\r\nHowever, if the `implicit val` on the line marked with `***` is changed to **`implicit def`**, it miraculously compiles!\r\n\r\nThis is probably related to #10849 but I'm not sure -- the output message here is clearly nonsense."},"comment":{"url":"https://api.github.com/repos/scala/bug/issues/comments/441740646","html_url":"https://github.com/scala/bug/issues/11274#issuecomment-441740646","issue_url":"https://api.github.com/repos/scala/bug/issues/11274","id":441740646,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MTc0MDY0Ng==","user":{"login":"ctongfei","id":5746409,"node_id":"MDQ6VXNlcjU3NDY0MDk=","avatar_url":"https://avatars1.githubusercontent.com/u/5746409?v=4","gravatar_id":"","url":"https://api.github.com/users/ctongfei","html_url":"https://github.com/ctongfei","followers_url":"https://api.github.com/users/ctongfei/followers","following_url":"https://api.github.com/users/ctongfei/following{/other_user}","gists_url":"https://api.github.com/users/ctongfei/gists{/gist_id}","starred_url":"https://api.github.com/users/ctongfei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctongfei/subscriptions","organizations_url":"https://api.github.com/users/ctongfei/orgs","repos_url":"https://api.github.com/users/ctongfei/repos","events_url":"https://api.github.com/users/ctongfei/events{/privacy}","received_events_url":"https://api.github.com/users/ctongfei/received_events","type":"User","site_admin":false},"created_at":"2018-11-26T18:12:45Z","updated_at":"2018-11-26T18:12:45Z","author_association":"NONE","body":"OK Thanks! Then this is fixed and should be closed?"}}
{"actor":{"display_login":"ctongfei"}}