Closed
Description
Minimized code
object a:
type Foo[T]
given as Foo[Unit] = ???
val b = a
def Test = summon[b.Foo[Unit]]
Output
-- Error: /Users/kmetiuk/Projects/scala3/playground/ambiguous/Test.scala:7:30 --
7 |def Test = summon[b.Foo[Unit]]
| ^
|ambiguous implicit arguments: both method given_Foo_Unit in object a and method given_Foo_Unit in object a match type b.Foo[Unit] of parameter x of method summon in object DottyPredef
1 error found
Expectation
Should compile. The following examples all compile successfully:
object a:
type Foo[T]
given as Foo[Unit] = ???
def Test = summon[a.Foo[Unit]]
object a:
type Foo
given as Foo = ???
val b = a
def Test = summon[b.Foo]