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
import annotation.static
object T {
@static val foo = 10
}
gives
/Users/luc/scala/scala/sandbox/Test.scala:6: error: object that conatin @static members should have companion class
@static val foo = 10 /* {
^
exception while transforming () extends Object() { this: T.type =>
@annotation.static() val foo: Int = 10
} of class class dotty.tools.dotc.ast.Trees$Template # 81
exception while transforming final module class T$() extends Object() { this: T.type =>
@annotation.static() val foo: Int = 10
} of class class dotty.tools.dotc.ast.Trees$TypeDef # 82
exception while transforming package <empty> {
final lazy module val T: T$ = new T$()
final module class T$() extends Object() { this: T.type =>
@annotation.static() val foo: Int = 10
}
} of class class dotty.tools.dotc.ast.Trees$PackageDef # 83
exception occurred while compiling /Users/luc/scala/scala/sandbox/Test.scala
Exception in thread "main" java.lang.ClassCastException: dotty.tools.dotc.core.Symbols$NoSymbol$ cannot be cast to dotty.tools.dotc.core.Symbols$ClassSymbol
at dotty.tools.dotc.core.Symbols$Symbol.asClass(Symbols.scala:409)
at dotty.tools.dotc.transform.CheckStatic$$anonfun$transformTemplate$1.apply(CheckStatic.scala:64)
...
The text was updated successfully, but these errors were encountered:
DarkDimius
added a commit
to dotty-staging/dotty
that referenced
this issue
Apr 18, 2016
gives
The text was updated successfully, but these errors were encountered: