File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
compiler/src/dotty/tools/dotc/core/tasty Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -584,7 +584,15 @@ class TreeUnpickler(reader: TastyReader,
584584 if sym.isOpaqueAlias then sym.setFlag(Deferred )
585585 val isScala2MacroDefinedInScala3 = flags.is(Macro , butNot = Inline ) && flags.is(Erased )
586586 ctx.owner match {
587- case cls : ClassSymbol if ! isScala2MacroDefinedInScala3 => cls.enter(sym)
587+ case cls : ClassSymbol if ! isScala2MacroDefinedInScala3 || cls == defn.StringContextClass =>
588+ // Enter all members of classes that are not Scala 2 macros.
589+ //
590+ // For `StringContext`, enter `s`, `f` and `raw`
591+ // These definitions will be entered when defined in Scala 2. It is fine to enter them
592+ // as they are intrinsic macros and are specially handled by the compiler.
593+ // Dual macro definitions will not work on `StringContext` as we would enter the symbol twice.
594+ // But dual macros will never be needed for those definitions due to their intinsic nature.
595+ cls.enter(sym)
588596 case _ =>
589597 }
590598 registerSym(start, sym)
You can’t perform that action at this time.
0 commit comments