Skip to content

IllegalAccessError when calling infix method with Symbol parameter inside App object initializer #5153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
scabug opened this issue Nov 6, 2011 · 3 comments

Comments

@scabug
Copy link

scabug commented Nov 6, 2011

>scala
Welcome to Scala version 2.9.1.final (Java HotSpot(TM) Client VM, Java 1.6.0_24).
Type in expressions to have them evaluated.
Type :help for more information.

scala> object test extends App {
     |   def withAssignment(b: Int) = new {def =:(s: Symbol) = Nil}
     |   //  'mu equals 1//uncomment to uncrash
     |   'mu =: withAssignment(1)
     | }
defined module test

scala> test
java.lang.IllegalAccessError: tried to access field test$.symbol$1 from class test$delayedInit$body
        at test$delayedInit$body.<clinit>(<console>:10)
        at test$.<init>(<console>:7)
        at test$.<clinit>(<console>)
        at .<init>(<console>:9)
        at .<clinit>(<console>)
        at .<init>(<console>:11)
        at .<clinit>(<console>)
        at $print(<console>)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.call(IMain.scala:704)
        at scala.tools.nsc.interpreter.IMain$Request$$anonfun$14.apply(IMain.scala:920)
        at scala.tools.nsc.interpreter.Line$$anonfun$1.apply$mcV$sp(Line.scala:43)
        at scala.tools.nsc.io.package$$anon$2.run(package.scala:25)
        at java.lang.Thread.run(Thread.java:662)

also fails in scala-2.10.0.r25912-b20111031024940

@scabug
Copy link
Author

scabug commented Nov 6, 2011

Imported From: https://issues.scala-lang.org/browse/SI-5153?orig=1
Reporter: @OlegYch
Affected Versions: 2.9.0-1, 2.9.1
See #5134

@scabug
Copy link
Author

scabug commented Nov 6, 2011

@OlegYch said:
also tried with Java 1.7.0_01, but got the same exception

@scabug
Copy link
Author

scabug commented May 5, 2012

@paulp said:
Duplicate of #5134.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants