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
This code crashes the compiler (after complaining that Sp must be a trait):
packagespectest {
classSp[@specialized A, B](vala:A, valb:B) { }
classFsp[@specialized A, B](a: A, b: B) extendsSp(a,b) {
defab= (a,b)
}
}
Error message from r25234 is:
SpecTest.scala:3:warning: classSp must be a trait. Specialized version of classFsp will inherit generic spectest.Sp[Unit,B]
classFsp[@specialized A, B](a: A, b: B) extendsSp(a,b) {
^
error: java.lang.AssertionError: assertion failed: List(value a, value a)
at scala.reflect.internal.Symbols$Symbol.suchThat(Symbols.scala:1154)
at scala.reflect.internal.Types$class.rebind(Types.scala:2679)
at scala.reflect.internal.Types$class.singleType(Types.scala:2704)
at scala.reflect.internal.SymbolTable.singleType(SymbolTable.scala:11)
at scala.tools.nsc.typechecker.Typers$Typer.stabilizeFun(Typers.scala:592)
at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:3359)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:4107)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:4274)
at scala.tools.nsc.typechecker.Duplicators$BodyDuplicator.typed(Duplicators.scala:310)
...
The text was updated successfully, but these errors were encountered:
@retronym said:
No doubt obvious to the reporter, but for the record: You can pick different names for the constructor paramaters to work around this.
scala>classFsp[@specialized A, B](aa: A, bb: B) extendsSp(aa,bb) { deffoo= (aa, bb) }
<console>:8:warning: classSp must be a trait. Specialized version of classFsp will inherit generic Sp[Boolean,B]
classFsp[@specialized A, B](aa: A, bb: B) extendsSp(aa,bb) { deffoo= (aa, bb) }
^
This code crashes the compiler (after complaining that Sp must be a trait):
Error message from r25234 is:
The text was updated successfully, but these errors were encountered: