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
A @volatile val is accepted by the compiler, but triggers a ClassFormatError when an attempt is made to load it.
In the REPL:
Welcome to Scala version 2.7.5.final (JavaHotSpot(TM) 64-BitServerVM, Java1.6.0_14).
Type in expressions to have them evaluated.
Type:help for more information.
scala>classC { @volatile valx=10 }
defined classC
scala>newC
java.lang.ClassFormatError:Illegal field modifiers in classC:0x52
at java.lang.ClassLoader.defineClass1(NativeMethod)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.lang.ClassLoader.defineClass(ClassLoader.java:466)
at scala.tools.nsc.interpreter.AbstractFileClassLoader.findClass(AbstractFileClassLoader.scala:30)
at java.lang.ClassLoader.loadClass(ClassLoa...
The text was updated successfully, but these errors were encountered:
A @volatile val is accepted by the compiler, but triggers a ClassFormatError when an attempt is made to load it.
In the REPL:
The text was updated successfully, but these errors were encountered: