Skip to content

Commit 86fab8d

Browse files
committed
Properly declare StringContext macros for Scala 3
1 parent 894f507 commit 86fab8d

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

compiler/src/dotty/tools/dotc/typer/Namer.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,10 +435,8 @@ class Namer { typer: Typer =>
435435
* package members are not entered twice in the same run.
436436
*/
437437
def enterSymbol(sym: Symbol)(using Context): Symbol = {
438-
// We do not enter Scala 2 macros defined in Scala 3.
439-
// Except if they are defined in StringContext to allow the compilation of the stdlib
440-
// dotty.communitybuild.CommunityBuildTest.stdLib213
441-
if (sym.exists && (!sym.isScala2MacroInScala3 || sym.owner == defn.StringContextClass)) {
438+
// We do not enter Scala 2 macros defined in Scala 3 as they have an equivalent Scala 3 inline method.
439+
if (sym.exists && !sym.isScala2MacroInScala3) {
442440
typr.println(s"entered: $sym in ${ctx.owner}")
443441
ctx.enter(sym)
444442
}

0 commit comments

Comments
 (0)