You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classTup():defapp(n: Int):String="a"classNT(t: Tup):deftoTup= t
objectNT:extension (x: NT)
defapp(n: Int):Boolean=truegivenConversion[NT, Tup] = _.toTup
deftest=valnt=newNT(Tup())
valx= nt.app(3)
val_:Boolean= x
Output
16|valx= nt.app(3)
|^^|Found: (nt : NT)
|Required:?{ app: ? }
|Note that implicit extension methods cannot be applied because they are ambiguous;
|both giveninstance given_Conversion_NT_Tup in objectNT and objectNT provide an extension method `app` on (nt : NT)
|| longer explanation available when compiling with`-explain`1 error found
Expectation
This should compile, and the method in object NT should be chosen. An extension method available directly should be preferable over a member reachable through implicit conversions. But right now it reports an ambiguity.
The text was updated successfully, but these errors were encountered:
Compiler version
3.4.1
Minimized example
Output
Expectation
This should compile, and the method in object
NT
should be chosen. An extension method available directly should be preferable over a member reachable through implicit conversions. But right now it reports an ambiguity.The text was updated successfully, but these errors were encountered: