Skip to content

Commit 0e50d0c

Browse files
committed
experiment: do not bring forward symbols defined in transform and backend phases
1 parent ad09ab8 commit 0e50d0c

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

Diff for: compiler/src/dotty/tools/dotc/core/Denotations.scala

+1
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,7 @@ object Denotations {
755755
}
756756
if (!symbol.exists) return updateValidity()
757757
if (!coveredInterval.containsPhaseId(ctx.phaseId)) return NoDenotation
758+
if (coveredInterval.firstPhaseId >= Phases.firstTransformPhase.id) return NoDenotation
758759
// Moved to a companion class, likely at a later phase (in MoveStatics)
759760
this match {
760761
case symd: SymDenotation if movedToCompanionClass(symd) => return NoDenotation

Diff for: tests/pos-macros/i21844/Macro.scala

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import scala.quoted.*
2+
3+
object Macro:
4+
inline def foo = ${ fooImpl }
5+
def fooImpl(using Quotes): Expr[Int] =
6+
'{ 123 }

Diff for: tests/pos-macros/i21844/SubClass.scala

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class SubClass extends SuperClass
2+
object SubClass:
3+
val foo: Int = Macro.foo

Diff for: tests/pos-macros/i21844/SuperClassWithLazyVal.scala

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class SuperClass:
2+
lazy val xyz: Int = 123

0 commit comments

Comments
 (0)