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
packageextfinalcaseclassA()
finalcaseclassB(a:A)
extension(a:A)
defx=5
extension(b:B)
defx= b.a.x
// ^^^^^// value x is not a member of ext.A.// An extension method was tried, but could not be fully constructed://// b.a
However, with explicit return types [Int], it compiles:
packageextimportext.AfinalcaseclassB(a:A)
extension(b:B)
defx:Int= b.a.x
//^^^^^^^^^^^^^^^^^//x is already defined as method x in ext.ExtensionA.scala
Expectation
Leveraging same extension signatures [on different types] should be consistently defined (is it possible or not?)
The behaviour should not depend on using/not using type inference, nor on same/separate compilation units.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Everything compiled with 3.0.0-M3:
This fails to compile:
However, with explicit return types [Int], it compiles:
Furthermore, when the very same example is split into separate compilation units, it fails with yet another error message:
ExtensionA.scala
ExtensionB.scala
Expectation
Leveraging same extension signatures [on different types] should be consistently defined (is it possible or not?)
The behaviour should not depend on using/not using type inference, nor on same/separate compilation units.
The text was updated successfully, but these errors were encountered: