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
1|deftest= generateCode
| ^^^^^^^^^^^^tstrapped /Test/ testOnly 3s
|Malformed tree was found while expanding macro with-Xcheck-macros.
||The tree does not conform to the compiler's tree invariants.
||||Macrowas:
||scala.quoted.runtime.Expr.splice[scala.Unit](((contextual$1: scala.quoted.Quotes) ?=>Macro_1$package.testLocalDummyOwner(contextual$1)))
||||The macro returned:
||{
|traitE() extends java.lang.Object {
| {
|valx: scala.Int=2| ()
| }
| }
| ()
|}
||||Error:||assertion failed: bad owner; value x has owner traitE, expected was value <local E>
|owner chain = value x, traitE, method test, packageobjectTest_2$package, package<empty>, package<root>, ctxOwners=value<localE>, value<localE>, value<localE>, value<localE>, traitE, traitE, methodtest, methodtest, methodtest, methodtest, methodtest, methodtest, methodtest, methodtest, packageobjectTest_2$package, package<empty>, package<root>, package<root>, package<root>, package<root>, package<root>, package<root>, <none>, <none>, <none>, <none>, <none>|||stacktrace available when compiling with`-Ydebug`|||---------------------------------------------------------------------------------------------------------------------|Inline stack trace
|-----------------------------------------------------------|This location contains code that was inlined from Macro_1.scala:22|inline defgenerateCode:Unit=${ testLocalDummyOwner }
| ^^^^^^^^^^^^^^^^^^^^^^^^
---------------------------------------------------------------------------------------------------------------------
It will also fail with -Ycheck:all.
Without checks
Unexpected tree in genLoad: DefDef(x,List(List()),TypeTree[TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Int)],Literal(Constant(2)))/class dotty.tools.dotc.ast.Trees$DefDef at: [206..210..220]
java.lang.RuntimeException: Unexpected tree in genLoad: DefDef(x,List(List()),TypeTree[TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Int)],Literal(Constant(2)))/class dotty.tools.dotc.ast.Trees$DefDef at: [206..210..220]
at dotty.tools.backend.jvm.BCodeHelpers.abort(BCodeHelpers.scala:844)
at dotty.tools.backend.jvm.BCodeHelpers.abort$(BCodeHelpers.scala:45)
at dotty.tools.backend.jvm.CodeGen$Impl$.abort(CodeGen.scala:176)
at dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genLoadTo(BCodeBodyBuilder.scala:482)
at dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genLoad(BCodeBodyBuilder.scala:303)
at dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genStat(BCodeBodyBuilder.scala:117)
at dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genBlockTo$$anonfun$1(BCodeBodyBuilder.scala:1087)
...
Expectation
The owner of x should be the local dummy <local E>.
The text was updated successfully, but these errors were encountered:
Compiler version
If you're not sure what version you're using, run
print scalaVersion
from sbt(if you're running scalac manually, use
scalac -version
instead).Minimized code
Output
With
-Xcheck-macros
It will also fail with
-Ycheck:all
.Without checks
Expectation
The owner of
x
should be the local dummy<local E>
.The text was updated successfully, but these errors were encountered: