Skip to content

Commit 01fc4a1

Browse files
Merge pull request #9818 from dotty-staging/use-direct-implementation-style-for-reflection
Implement Reflection API directly
2 parents 0a76dcf + 5cd1cce commit 01fc4a1

File tree

11 files changed

+4513
-4989
lines changed

11 files changed

+4513
-4989
lines changed

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

Lines changed: 2611 additions & 5 deletions
Large diffs are not rendered by default.

compiler/src/dotty/tools/dotc/quoted/reflect/ReflectionCompilerInterface.scala

Lines changed: 0 additions & 2115 deletions
This file was deleted.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ class TailRec extends MiniPhase {
186186
def tailArgOrPureExpr(stat: Tree): Boolean = stat match {
187187
case stat: ValDef if stat.name.is(TailTempName) || !stat.symbol.is(Mutable) => tailArgOrPureExpr(stat.rhs)
188188
case Assign(lhs: Ident, rhs) if lhs.symbol.name.is(TailLocalName) => tailArgOrPureExpr(rhs)
189+
case Assign(lhs: Ident, rhs: Ident) => lhs.symbol == rhs.symbol
189190
case stat: Ident if stat.symbol.name.is(TailLocalName) => true
190191
case _ => tpd.isPureExpr(stat)
191192
}

library/src-bootstrapped/scala/quoted/Liftable.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,8 @@ object Liftable {
5959
/** Default liftable for Class[T] */
6060
given ClassLiftable[T] as Liftable[Class[T]] = new Liftable[Class[T]] {
6161
def toExpr(x: Class[T]) = {
62-
val qctx1 = scala.internal.tasty.CompilerInterface.quoteContextWithCompilerInterface(qctx)
63-
import qctx1.tasty._
64-
val tpe = qctx1.tasty.Type_ofErasedClass(x)
65-
Ref(defn.Predef_classOf).appliedToType(tpe).seal.asInstanceOf[Expr[Class[T]]]
62+
import qctx.tasty._
63+
Ref(defn.Predef_classOf).appliedToType(Type.typeConstructorOf(x)).seal.asInstanceOf[Expr[Class[T]]]
6664
}
6765
}
6866

0 commit comments

Comments
 (0)