Skip to content

"polymorphic expression cannot be instantiated to expected type": foo: List[Int] inferred, foo: ListInt not. #6846

@scabug

Description

@scabug
ticket/6745-3 ~/code/scala scalac210 sandbox/test.scala
sandbox/test.scala:7: error: polymorphic expression cannot be instantiated to expected type;
 found   : [M[_], A]Test.Arb[M[A]]
 required: Test.Arb[Test.ListInt]
  foo: Arb[ListInt]
  ^
one error found
ticket/6745-3 ~/code/scala scalac29 sandbox/test.scala
ticket/6745-3 ~/code/scala cat !$
cat sandbox/test.scala
object Test {
  class Arb[_]
  implicit def foo[M[_], A]: Arb[M[A]] = null
  foo: Arb[List[Int]]

  type ListInt = List[Int]
  foo: Arb[ListInt]
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions