Skip to content

Commit b0a20fc

Browse files
Merge pull request #5398 from dotty-staging/refactor-tasty-reflect
Refcatorings in TASTy reflection interface
2 parents a9029dc + 030adb4 commit b0a20fc

File tree

89 files changed

+1983
-1982
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+1983
-1982
lines changed

compiler/src/dotty/tools/dotc/consumetasty/TastyConsumerPhase.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package dotty.tools.dotc.consumetasty
22

33
import dotty.tools.dotc.core.Contexts._
44
import dotty.tools.dotc.core.Phases.Phase
5-
import dotty.tools.dotc.tastyreflect.TastyImpl
5+
import dotty.tools.dotc.tastyreflect.ReflectionImpl
66

77
import scala.tasty.file.TastyConsumer
88

@@ -11,8 +11,8 @@ class TastyConsumerPhase(consumer: TastyConsumer) extends Phase {
1111
override def phaseName: String = "tastyConsumer"
1212

1313
override def run(implicit ctx: Context): Unit = {
14-
val tasty = new TastyImpl(ctx)
15-
consumer(tasty)(ctx.compilationUnit.tpdTree)
14+
val reflect = new ReflectionImpl(ctx)
15+
consumer(reflect)(ctx.compilationUnit.tpdTree)
1616
}
1717

1818
}

compiler/src/dotty/tools/dotc/core/Definitions.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -691,11 +691,11 @@ class Definitions {
691691
def Unpickler_liftedExpr: TermSymbol = ctx.requiredMethod("scala.runtime.quoted.Unpickler.liftedExpr")
692692
def Unpickler_unpickleType: TermSymbol = ctx.requiredMethod("scala.runtime.quoted.Unpickler.unpickleType")
693693

694-
lazy val TastyTastyType: TypeRef = ctx.requiredClassRef("scala.tasty.Tasty")
695-
def TastyTastyClass(implicit ctx: Context): ClassSymbol = TastyTastyType.symbol.asClass
694+
lazy val TastyReflectionType: TypeRef = ctx.requiredClassRef("scala.tasty.Reflection")
695+
def TastyReflectionClass(implicit ctx: Context): ClassSymbol = TastyReflectionType.symbol.asClass
696696

697-
lazy val TastyTastyModule: TermSymbol = ctx.requiredModule("scala.tasty.Tasty")
698-
lazy val TastyTasty_macroContext: TermSymbol = TastyTastyModule.requiredMethod("macroContext")
697+
lazy val TastyReflectionModule: TermSymbol = ctx.requiredModule("scala.tasty.Reflection")
698+
lazy val TastyReflection_macroContext: TermSymbol = TastyReflectionModule.requiredMethod("macroContext")
699699

700700
lazy val EqType: TypeRef = ctx.requiredClassRef("scala.Eq")
701701
def EqClass(implicit ctx: Context): ClassSymbol = EqType.symbol.asClass

compiler/src/dotty/tools/dotc/decompiler/DecompilationPrinter.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import java.io.{OutputStream, PrintStream}
66
import dotty.tools.dotc.core.Contexts._
77
import dotty.tools.dotc.core.Phases.Phase
88
import dotty.tools.dotc.core.tasty.TastyPrinter
9-
import dotty.tools.dotc.tastyreflect.TastyImpl
9+
import dotty.tools.dotc.tastyreflect.ReflectionImpl
1010
import dotty.tools.io.File
1111

1212
/** Phase that prints the trees in all loaded compilation units.
@@ -41,7 +41,7 @@ class DecompilationPrinter extends Phase {
4141
} else {
4242
val unitFile = unit.source.toString.replace("\\", "/").replace(".class", ".tasty")
4343
out.println(s"/** Decompiled from $unitFile */")
44-
out.println(new TastyImpl(ctx).showSourceCode.showTree(unit.tpdTree)(ctx))
44+
out.println(new ReflectionImpl(ctx).showSourceCode.showTree(unit.tpdTree)(ctx))
4545
}
4646
}
4747
}

compiler/src/dotty/tools/dotc/quoted/QuoteDriver.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package dotty.tools.dotc.quoted
33
import dotty.tools.dotc.ast.tpd
44
import dotty.tools.dotc.Driver
55
import dotty.tools.dotc.core.Contexts.{Context, ContextBase, FreshContext}
6-
import dotty.tools.dotc.tastyreflect.TastyImpl
6+
import dotty.tools.dotc.tastyreflect.ReflectionImpl
77
import dotty.tools.io.{AbstractFile, Directory, PlainDirectory, VirtualDirectory}
88
import dotty.tools.repl.AbstractFileClassLoader
99

@@ -47,7 +47,7 @@ class QuoteDriver extends Driver {
4747
val tree1 =
4848
if (ctx.settings.YshowRawQuoteTrees.value) tree
4949
else (new TreeCleaner).transform(tree)
50-
new TastyImpl(ctx).showSourceCode.showTree(tree1)
50+
new ReflectionImpl(ctx).showSourceCode.showTree(tree1)
5151
}
5252
withTree(expr, show, settings)
5353
}

compiler/src/dotty/tools/dotc/tastyreflect/CaseDefOpsImpl.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package dotty.tools.dotc.tastyreflect
22

33

4-
trait CaseDefOpsImpl extends scala.tasty.reflect.CaseDefOps with TastyCoreImpl with Helpers {
4+
trait CaseDefOpsImpl extends scala.tasty.reflect.CaseDefOps with CoreImpl with Helpers {
55

66
def CaseDefDeco(caseDef: CaseDef): CaseDefAPI = new CaseDefAPI {
77
def pattern(implicit ctx: Context): Pattern = caseDef.pat

compiler/src/dotty/tools/dotc/tastyreflect/ConstantOpsImpl.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package dotty.tools.dotc.tastyreflect
33
import dotty.tools.dotc.core.Constants
44

55

6-
trait ConstantOpsImpl extends scala.tasty.reflect.ConstantOps with TastyCoreImpl {
6+
trait ConstantOpsImpl extends scala.tasty.reflect.ConstantOps with CoreImpl {
77

88
def ConstantDeco(const: Constant): ConstantAPI = new ConstantAPI {
99
def value: Any = const.value

compiler/src/dotty/tools/dotc/tastyreflect/ContextOpsImpl.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package dotty.tools.dotc.tastyreflect
22

33
import dotty.tools.dotc.util.{Positions, SourcePosition}
44

5-
trait ContextOpsImpl extends scala.tasty.reflect.ContextOps with TastyCoreImpl {
5+
trait ContextOpsImpl extends scala.tasty.reflect.ContextOps with CoreImpl {
66

77
val rootContext: Context
88

compiler/src/dotty/tools/dotc/tastyreflect/TastyCoreImpl.scala renamed to compiler/src/dotty/tools/dotc/tastyreflect/CoreImpl.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import dotty.tools.dotc.ast.{tpd, untpd}
55
import dotty.tools.dotc.core.Constants
66
import dotty.tools.dotc.core.Types
77

8-
trait TastyCoreImpl extends scala.tasty.reflect.TastyCore {
8+
trait CoreImpl extends scala.tasty.reflect.Core {
99

1010
type Context = core.Contexts.Context
1111

compiler/src/dotty/tools/dotc/tastyreflect/IdOpsImpl.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package dotty.tools.dotc.tastyreflect
22

33
import dotty.tools.dotc.core.Decorators._
44

5-
trait IdOpsImpl extends scala.tasty.reflect.IdOps with TastyCoreImpl {
5+
trait IdOpsImpl extends scala.tasty.reflect.IdOps with CoreImpl {
66

77
def IdDeco(id: Id): IdAPI = new IdAPI {
88
def pos(implicit ctx: Context): Position = id.pos

compiler/src/dotty/tools/dotc/tastyreflect/ImportSelectorOpsImpl.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package dotty.tools.dotc.tastyreflect
33
import dotty.tools.dotc.ast.{Trees, untpd}
44
import dotty.tools.dotc.core.StdNames.nme
55

6-
trait ImportSelectorOpsImpl extends scala.tasty.reflect.ImportSelectorOps with TastyCoreImpl {
6+
trait ImportSelectorOpsImpl extends scala.tasty.reflect.ImportSelectorOps with CoreImpl {
77

88
object SimpleSelector extends SimpleSelectorExtractor {
99
def unapply(x: ImportSelector)(implicit ctx: Context): Option[Id] = x match {

compiler/src/dotty/tools/dotc/tastyreflect/PatternOpsImpl.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package dotty.tools.dotc.tastyreflect
33
import dotty.tools.dotc.ast.{Trees, tpd}
44
import dotty.tools.dotc.core.Decorators._
55

6-
trait PatternOpsImpl extends scala.tasty.reflect.PatternOps with TastyCoreImpl {
6+
trait PatternOpsImpl extends scala.tasty.reflect.PatternOps with CoreImpl {
77

88
// ----- Patterns -------------------------------------------------
99

compiler/src/dotty/tools/dotc/tastyreflect/PositionOpsImpl.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package dotty.tools.dotc.tastyreflect
22

3-
trait PositionOpsImpl extends scala.tasty.reflect.PositionOps with TastyCoreImpl {
3+
trait PositionOpsImpl extends scala.tasty.reflect.PositionOps with CoreImpl {
44

55
def PositionDeco(pos: Position): PositionAPI = new PositionAPI {
66
def start: Int = pos.start
Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,51 @@
11
package dotty.tools.dotc.tastyreflect
22

3-
import scala.tasty.util.{Show, ShowExtractors, ShowSourceCode}
3+
trait PrintersImpl extends scala.tasty.reflect.Printers with scala.tasty.reflect.Core { reflect: ReflectionImpl =>
44

5-
trait PrintersImpl extends scala.tasty.reflect.Printers with scala.tasty.reflect.TastyCore { tasty: TastyImpl =>
5+
def showExtractors: reflect.Printer = new reflect.ExtractorsPrinter
66

7-
def showExtractors: Show[tasty.type] = new ShowExtractors[tasty.type](this)
8-
9-
def showSourceCode: Show[tasty.type] = new ShowSourceCode[tasty.type](this)
7+
def showSourceCode: reflect.Printer = new reflect.SourceCodePrinter
108

119
/** Adds `show` as an extension method of a `Tree` */
1210
def TreeShowDeco(tree: Tree): ShowAPI = new ShowAPI {
13-
def show(implicit ctx: Context, s: Show[tasty.type]): String = s.showTree(tree)
11+
def show(implicit ctx: Context): String = showExtractors.showTree(tree)
12+
def showCode(implicit ctx: Context): String = showSourceCode.showTree(tree)
1413
}
1514

1615
/** Adds `show` as an extension method of a `TypeOrBoundsTree` */
1716
def TypeOrBoundsTreeShowDeco(tpt: TypeOrBoundsTree): ShowAPI = new ShowAPI {
18-
def show(implicit ctx: Context, s: Show[tasty.type]): String = s.showTypeOrBoundsTree(tpt)
17+
def show(implicit ctx: Context): String = showExtractors.showTypeOrBoundsTree(tpt)
18+
def showCode(implicit ctx: Context): String = showSourceCode.showTypeOrBoundsTree(tpt)
1919
}
2020

2121
/** Adds `show` as an extension method of a `TypeOrBounds` */
2222
def TypeOrBoundsShowDeco(tpe: TypeOrBounds): ShowAPI = new ShowAPI {
23-
def show(implicit ctx: Context, s: Show[tasty.type]): String = s.showTypeOrBounds(tpe)
23+
def show(implicit ctx: Context): String = showExtractors.showTypeOrBounds(tpe)
24+
def showCode(implicit ctx: Context): String = showSourceCode.showTypeOrBounds(tpe)
2425
}
2526

2627
/** Adds `show` as an extension method of a `CaseDef` */
2728
def CaseDefShowDeco(caseDef: CaseDef): ShowAPI = new ShowAPI {
28-
def show(implicit ctx: Context, s: Show[tasty.type]): String = s.showCaseDef(caseDef)
29+
def show(implicit ctx: Context): String = showExtractors.showCaseDef(caseDef)
30+
def showCode(implicit ctx: Context): String = showSourceCode.showCaseDef(caseDef)
2931
}
3032

3133
/** Adds `show` as an extension method of a `Pattern` */
3234
def PatternShowDeco(pattern: Pattern): ShowAPI = new ShowAPI {
33-
def show(implicit ctx: Context, s: Show[tasty.type]): String = s.showPattern(pattern)
35+
def show(implicit ctx: Context): String = showExtractors.showPattern(pattern)
36+
def showCode(implicit ctx: Context): String = showSourceCode.showPattern(pattern)
3437
}
3538

3639
/** Adds `show` as an extension method of a `Constant` */
3740
def ConstantShowDeco(const: Constant): ShowAPI = new ShowAPI {
38-
def show(implicit ctx: Context, s: Show[tasty.type]): String = s.showConstant(const)
41+
def show(implicit ctx: Context): String = showExtractors.showConstant(const)
42+
def showCode(implicit ctx: Context): String = showSourceCode.showConstant(const)
3943
}
4044

4145
/** Adds `show` as an extension method of a `Symbol` */
4246
def SymbolShowDeco(symbol: Symbol): ShowAPI = new ShowAPI {
43-
def show(implicit ctx: Context, s: Show[tasty.type]): String = s.showSymbol(symbol)
47+
def show(implicit ctx: Context): String = showExtractors.showSymbol(symbol)
48+
def showCode(implicit ctx: Context): String = showSourceCode.showSymbol(symbol)
4449
}
4550

4651
}

compiler/src/dotty/tools/dotc/tastyreflect/QuotedOpsImpl.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ import dotty.tools.dotc.core.quoted.PickledQuotes
55
import dotty.tools.dotc.reporting.Reporter
66
import dotty.tools.dotc.reporting.diagnostic.MessageContainer
77

8-
trait QuotedOpsImpl extends scala.tasty.reflect.QuotedOps with TastyCoreImpl {
8+
trait QuotedOpsImpl extends scala.tasty.reflect.QuotedOps with CoreImpl {
99

1010
def QuotedExprDeco[T](x: scala.quoted.Expr[T]): QuotedExprAPI = new QuotedExprAPI {
11-
def toTasty(implicit ctx: Context): Term = PickledQuotes.quotedExprToTree(x)
11+
def reflect(implicit ctx: Context): Term = PickledQuotes.quotedExprToTree(x)
1212
}
1313

1414
def QuotedTypeDeco[T](x: scala.quoted.Type[T]): QuotedTypeAPI = new QuotedTypeAPI {
15-
def toTasty(implicit ctx: Context): TypeTree = PickledQuotes.quotedTypeToTree(x)
15+
def reflect(implicit ctx: Context): TypeTree = PickledQuotes.quotedTypeToTree(x)
1616
}
1717

1818
def TermToQuoteDeco(term: Term): TermToQuotedAPI = new TermToQuotedAPI {
1919

20-
def toExpr[T: scala.quoted.Type](implicit ctx: Context): scala.quoted.Expr[T] = {
20+
def reify[T: scala.quoted.Type](implicit ctx: Context): scala.quoted.Expr[T] = {
2121
typecheck(ctx)
2222
new scala.quoted.Exprs.TastyTreeExpr(term).asInstanceOf[scala.quoted.Expr[T]]
2323
}
@@ -28,12 +28,12 @@ trait QuotedOpsImpl extends scala.tasty.reflect.QuotedOps with TastyCoreImpl {
2828
ctx0.typerState.setReporter(new Reporter {
2929
def doReport(m: MessageContainer)(implicit ctx: Context): Unit = ()
3030
})
31-
val tp = QuotedTypeDeco(implicitly[scala.quoted.Type[T]]).toTasty
31+
val tp = QuotedTypeDeco(implicitly[scala.quoted.Type[T]]).reflect
3232
ctx0.typer.typed(term, tp.tpe)
3333
if (ctx0.reporter.hasErrors) {
3434
val stack = new Exception().getStackTrace
3535
def filter(elem: StackTraceElement) =
36-
elem.getClassName.startsWith("dotty.tools.dotc.tasty.TastyImpl") ||
36+
elem.getClassName.startsWith("dotty.tools.dotc.tasty.ReflectionImpl") ||
3737
!elem.getClassName.startsWith("dotty.tools.dotc")
3838
throw new scala.tasty.TastyTypecheckError(
3939
s"""Error during tasty reflection while typing term

compiler/src/dotty/tools/dotc/tastyreflect/TastyImpl.scala renamed to compiler/src/dotty/tools/dotc/tastyreflect/ReflectionImpl.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ package dotty.tools.dotc.tastyreflect
22

33
import dotty.tools.dotc.core._
44

5-
class TastyImpl(val rootContext: Contexts.Context)
6-
extends scala.tasty.Tasty
7-
with TastyCoreImpl
5+
class ReflectionImpl(val rootContext: Contexts.Context)
6+
extends scala.tasty.Reflection
7+
with CoreImpl
88
with CaseDefOpsImpl
99
with ConstantOpsImpl
1010
with ContextOpsImpl
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package dotty.tools.dotc.tastyreflect
22

3-
trait SettingsOpsImpl extends scala.tasty.reflect.SettingsOps with TastyCoreImpl {
3+
trait SettingsOpsImpl extends scala.tasty.reflect.SettingsOps with scala.tasty.reflect.ContextOps with CoreImpl {
44

5-
def settings(implicit ctx: Context): Settings = ctx.settings
5+
def settings: Settings = rootContext.settings
66

77
def SettingsDeco(settings: Settings): SettingsAPI = new SettingsAPI {
8-
def color(implicit ctx: Context): Boolean = settings.color.value == "always"
8+
def color: Boolean = settings.color.value == "always"
99
}
1010

1111
}

compiler/src/dotty/tools/dotc/tastyreflect/SignatureOpsImpl.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package dotty.tools.dotc.tastyreflect
22

3-
trait SignatureOpsImpl extends scala.tasty.reflect.SignatureOps with TastyCoreImpl {
3+
trait SignatureOpsImpl extends scala.tasty.reflect.SignatureOps with CoreImpl {
44

55
object Signature extends SignatureExtractor {
66
def unapply(x: Signature)(implicit ctx: Context): Option[(List[String], String)] = {

compiler/src/dotty/tools/dotc/tastyreflect/StandardDefinitions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import dotty.tools.dotc.core.Symbols._
44

55

66
trait StandardDefinitions extends scala.tasty.reflect.StandardDefinitions {
7-
tasty: TastyImpl =>
7+
tasty: ReflectionImpl =>
88

99
private implicit def ctx: Context = rootContext
1010

compiler/src/dotty/tools/dotc/tastyreflect/SymbolOpsImpl.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package tastyreflect
44
import dotty.tools.dotc.core.Flags
55
import dotty.tools.dotc.core.Symbols._
66

7-
trait SymbolOpsImpl extends scala.tasty.reflect.SymbolOps with TastyCoreImpl {
7+
trait SymbolOpsImpl extends scala.tasty.reflect.SymbolOps with CoreImpl {
88

99
def SymbolDeco(symbol: Symbol): SymbolAPI = new SymbolAPI {
1010

compiler/src/dotty/tools/dotc/tastyreflect/TreeOpsImpl.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import dotty.tools.dotc.core.Decorators._
66
import dotty.tools.dotc.core._
77
import dotty.tools.dotc.tastyreflect.FromSymbol.{definitionFromSym, packageDefFromSym}
88

9-
trait TreeOpsImpl extends scala.tasty.reflect.TreeOps with TastyCoreImpl with Helpers {
9+
trait TreeOpsImpl extends scala.tasty.reflect.TreeOps with CoreImpl with Helpers {
1010

1111
def TreeDeco(tree: Tree): TreeAPI = new TreeAPI {
1212
def pos(implicit ctx: Context): Position = tree.pos

compiler/src/dotty/tools/dotc/tastyreflect/TypeOrBoundsOpsImpl.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package dotty.tools.dotc.tastyreflect
22

33
import dotty.tools.dotc.core.{Names, Types}
44

5-
trait TypeOrBoundsOpsImpl extends scala.tasty.reflect.TypeOrBoundsOps with TastyCoreImpl {
5+
trait TypeOrBoundsOpsImpl extends scala.tasty.reflect.TypeOrBoundsOps with CoreImpl {
66

77
// ===== Types ====================================================
88

compiler/src/dotty/tools/dotc/tastyreflect/TypeOrBoundsTreesOpsImpl.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import dotty.tools.dotc.core.StdNames.nme
66
import dotty.tools.dotc.core.Types
77

88

9-
trait TypeOrBoundsTreesOpsImpl extends scala.tasty.reflect.TypeOrBoundsTreeOps with TastyCoreImpl {
9+
trait TypeOrBoundsTreesOpsImpl extends scala.tasty.reflect.TypeOrBoundsTreeOps with CoreImpl {
1010

1111
// ----- TypeOrBoundsTree ------------------------------------------------
1212

compiler/src/dotty/tools/dotc/transform/Splicer.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import dotty.tools.dotc.core.Types._
1818
import dotty.tools.dotc.core.Symbols._
1919
import dotty.tools.dotc.core.{NameKinds, TypeErasure}
2020
import dotty.tools.dotc.core.Constants.Constant
21-
import dotty.tools.dotc.tastyreflect.TastyImpl
21+
import dotty.tools.dotc.tastyreflect.ReflectionImpl
2222

2323
import scala.util.control.NonFatal
2424
import dotty.tools.dotc.util.SourcePosition
@@ -107,7 +107,7 @@ object Splicer {
107107
args.toSeq
108108

109109
protected def interpretTastyContext()(implicit env: Env): Object = {
110-
new TastyImpl(ctx) {
110+
new ReflectionImpl(ctx) {
111111
override def rootPosition: SourcePosition = pos
112112
}
113113
}
@@ -307,7 +307,7 @@ object Splicer {
307307
case Literal(Constant(value)) =>
308308
interpretLiteral(value)
309309

310-
case _ if tree.symbol == defn.TastyTasty_macroContext =>
310+
case _ if tree.symbol == defn.TastyReflection_macroContext =>
311311
interpretTastyContext()
312312

313313
case Call(fn, args) =>

compiler/src/dotty/tools/dotc/transform/Staging.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ class Staging extends MacroTransformWithImplicits {
240240
case Some(l) =>
241241
l == level ||
242242
level == -1 && (
243-
sym == defn.TastyTasty_macroContext ||
243+
sym == defn.TastyReflection_macroContext ||
244244
// here we assume that Splicer.canBeSpliced was true before going to level -1,
245245
// this implies that all non-inline arguments are quoted and that the following two cases are checked
246246
// on inline parameters or type parameters.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ trait Implicits { self: Typer =>
625625
}
626626

627627
def synthesizedTastyContext(formal: Type): Tree =
628-
if (ctx.inInlineMethod || enclosingInlineds.nonEmpty) ref(defn.TastyTasty_macroContext)
628+
if (ctx.inInlineMethod || enclosingInlineds.nonEmpty) ref(defn.TastyReflection_macroContext)
629629
else EmptyTree
630630

631631
/** If `formal` is of the form Eq[T, U], where no `Eq` instance exists for
@@ -698,7 +698,7 @@ trait Implicits { self: Typer =>
698698
else
699699
trySpecialCase(defn.ClassTagClass, synthesizedClassTag,
700700
trySpecialCase(defn.QuotedTypeClass, synthesizedTypeTag,
701-
trySpecialCase(defn.TastyTastyClass, synthesizedTastyContext,
701+
trySpecialCase(defn.TastyReflectionClass, synthesizedTastyContext,
702702
trySpecialCase(defn.EqClass, synthesizedEq, failed))))
703703
}
704704
}

0 commit comments

Comments
 (0)