Skip to content

lazy initialization of given can wait forever in macro #13011

Closed
@scf37

Description

@scf37

Compiler version

3.0.0

Minimized code

checkout https://github.com/scf37/macro3
sbt compile
Compilation will hang

Output

   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x00000000fe4e9388> (a java.lang.Object)
        at java.lang.Object.wait(Object.java:502)
        at scala.runtime.LazyVals$.wait4Notification(LazyVals.scala:89)
        - locked <0x00000000fe4e9388> (a java.lang.Object)
        at MacroVis.symbolInstance(MacroVis.scala:53)
        at MacroVis.symbolInstance(MacroVis.scala:12)
        at MacroVis.<init>(MacroVis.scala:63)
        at Macro$.doImpl(Macro.scala:8)
        at Macro$.inline$doImpl(Macro.scala:6)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at dotty.tools.dotc.transform.Splicer$Interpreter.interpretedStaticMethodCall$$anonfun$2$$anonfun$1(Splicer.scala:354)
        at dotty.tools.dotc.transform.Splicer$Interpreter$$Lambda$5916/999733346.apply(Unknown Source)
        at dotty.tools.dotc.transform.Splicer$Interpreter.stopIfRuntimeException(Splicer.scala:414)

Expectation

successful compilation

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions