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
I think in Main.scala it should be Macros.f, not TestMacro.f. With that change I could reproduce the problem. When running with -Ycheck I get
*** error while checking Main_2.scala after phase inlining ***
exception occurred while compiling Main_2.scala
java.lang.AssertionError: assertion failed: error while typing Instances.this, method sMacro is not contained in trait Instances while compiling Main_2.scala
and the checker stack looks like this:
exception while typing Instances.this of class class dotty.tools.dotc.ast.Trees$This # -1
exception while typing Instances.this.s of class class dotty.tools.dotc.ast.Trees$Select # -1
exception while typing Instances.this.s:String of class class dotty.tools.dotc.ast.Trees$Typed # -1
exception while typing Instances.this.s:String of class class dotty.tools.dotc.ast.Trees$Inlined # -1
exception while typing def sMacro: String = Instances.this.s:String of class class dotty.tools.dotc.ast.Trees$DefDef # -1
I am not sure whether this is a bug in Ref, or whether using Ref is wrong here and one should use something else. @nicolasstucki can you weigh in?
Compiler version
3.0.1
Minimized code
I'm looking for a way to call a method defined in an extended trait from a macro. My first attempt was to use Ref() e.g.
Output
Expectation
Successful compilation
This is a follow-up to #12966
The text was updated successfully, but these errors were encountered: