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
java.lang.AssertionError: assertion failed: missing parameters fortraitTrait from () extendsObject(), Trait {
finaldefmethod(x: Int):Int= $anonfun(x)
finaldefmethod(x: Object):Object=
scala.Int.box(this.method(scala.Int.unbox(x)))
} should have been caught in typer while compiling <my scala file>
expectation
I think either:
This should give a proper compiler error, forcing the user to write
valnoCrash:Trait[Int] =newTrait[Int] withdefmethod(x: Int) = x
which does compile succesfully.
This should work if the evidence is in scope, altough this would force you to use summon
The SAM functionality could be adapted to support given parameters in the trait. In this case I think it would make a lot of sense if the following example would work:
valnoCrash:Trait[Int] = (givenEvidence[Int]) => (x: Int) => x
The text was updated successfully, but these errors were encountered:
minimized code
Compilation output
expectation
I think either:
which does compile succesfully.
The text was updated successfully, but these errors were encountered: