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
You'd be hard pressed to reason your way to why this doesn't compile.
objectThing {
implicitclassThingOps1(valx:String) extendsAnyVal {
deffn[A] :Ordering[A] =newOrdering[A] {
defcompare(x1: A, x2: A):Int=???
}
}
implicitclassThingOps2[A](valx:String) extendsAnyVal {
deffn:Ordering[A] =newOrdering[A] {
defcompare(x1: A, x2: A):Int=???
}
}
}
// a.scala:3: error: object creation impossible, since method compare// in trait Ordering of type (x: A, y: A)Int is not defined// def fn[A] : Ordering[A] = new Ordering[A] {// ^// a.scala:8: error: object creation impossible, since method compare// in trait Ordering of type (x: A, y: A)Int is not defined// def fn: Ordering[A] = new Ordering[A] {// ^// two errors found
Remove the "extends AnyVals" and both compile. It's specific to generics:. This compiles:
@retronym said:
This one was fixed a few days back in cb37548ef85d471951867b9f8a97cb9b9820fc66. While peforming some housework in Uncurry, I found that we weren't substituting symbols in ClassInfoType#parents. I included a test case in that commit that showed the same bug in extension methods (with partial functions).
You'd be hard pressed to reason your way to why this doesn't compile.
Remove the "extends AnyVals" and both compile. It's specific to generics:. This compiles:
As a workaround you can do something like
How this has not yet been reported I don't know.
The text was updated successfully, but these errors were encountered: