Skip to content
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

Crash during BCode generation due to @static value access #9288

Closed
sir-wabbit opened this issue Jul 5, 2020 · 0 comments · Fixed by #11258
Closed

Crash during BCode generation due to @static value access #9288

sir-wabbit opened this issue Jul 5, 2020 · 0 comments · Fixed by #11258

Comments

@sir-wabbit
Copy link

Minimized code

// AE-de752a30942c1949a413940222cd9e573e5aa6a4
class Foo {
    import annotation.static
    class Bar
    object Bar {
        @static val x = 2
    }
    import Bar._
    x
}

Output (click arrow to expand)

-- [E129] Potential Issue Warning: test.scala:8:4 ------------------------------
8 |    x
  |    ^
  |A pure expression does nothing in statement position; you may be omitting necessary parentheses

longer explanation available when compiling with `-explain`
Error while emitting test.scala
exception occurred while compiling test.scala
java.lang.AssertionError: assertion failed: asTerm called on not-a-Term val <none> while compiling test.scala
Exception in thread "main" java.lang.AssertionError: assertion failed: asTerm called on not-a-Term val <none>
	at dotty.DottyPredef$.assertFail(DottyPredef.scala:17)
	at dotty.tools.dotc.core.Symbols$Symbol.asTerm(Symbols.scala:535)
	at dotty.tools.dotc.transform.ExplicitOuter$.dotty$tools$dotc$transform$ExplicitOuter$$$outerParamAccessor(ExplicitOuter.scala:222)
	at dotty.tools.dotc.transform.ExplicitOuter$OuterOps$.loop$1(ExplicitOuter.scala:405)
	at dotty.tools.dotc.transform.ExplicitOuter$OuterOps$.path$extension(ExplicitOuter.scala:413)
	at dotty.tools.dotc.ast.tpd$.followOuterLinks(tpd.scala:419)
	at dotty.tools.dotc.ast.tpd$.ref(tpd.scala:409)
	at dotty.tools.dotc.ast.tpd$.desugarIdentPrefix(tpd.scala:1272)
	at dotty.tools.dotc.ast.tpd$.desugarIdent(tpd.scala:1264)
	at dotty.tools.backend.jvm.DottyBackendInterface.cachedDesugarIdent(DottyBackendInterface.scala:44)
	at dotty.tools.backend.jvm.DottyBackendInterface$DesugaredSelect$.unapply(DottyBackendInterface.scala:69)
	at dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genLoad(BCodeBodyBuilder.scala:369)
	at dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genStat(BCodeBodyBuilder.scala:93)
	at dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genBlock$$anonfun$1(BCodeBodyBuilder.scala:921)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at scala.collection.immutable.List.foreach(List.scala:333)
	at dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genBlock(BCodeBodyBuilder.scala:921)
	at dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genLoad(BCodeBodyBuilder.scala:420)
	at dotty.tools.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.emitNormalMethodBody$1(BCodeSkelBuilder.scala:584)
	at dotty.tools.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.genDefDef(BCodeSkelBuilder.scala:619)
	at dotty.tools.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.gen(BCodeSkelBuilder.scala:498)
	at dotty.tools.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.gen$$anonfun$1(BCodeSkelBuilder.scala:504)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants