Skip to content

Problem when accessing symbol from delayed init body #5329

Closed
@scabug

Description

@scabug

The following program fails when trying to access 'x. Of course it is incorrect and should generate a NPE, but this is a proof of concept extracted from a larger project:

object Test extends App {
val a: akka.actor.ActorRef = null;
a ! 'x
}

It gives:

(run-main) java.lang.IllegalAccessError: tried to access field Test$.symbol$1 from class Test$delayedInit$body
java.lang.IllegalAccessError: tried to access field Test$.symbol$1 from class Test$delayedInit$body
at Test$delayedInit$body.(test.scala:3)
at Test$.(test.scala:1)
at Test$.(test.scala)
at Test.main(test.scala)
[...]

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions