Skip to content

Implement Reflection API directly #9818

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,613 changes: 2,610 additions & 3 deletions compiler/src/dotty/tools/dotc/quoted/QuoteContextImpl.scala

Large diffs are not rendered by default.

2,115 changes: 0 additions & 2,115 deletions compiler/src/dotty/tools/dotc/quoted/reflect/ReflectionCompilerInterface.scala

This file was deleted.

1 change: 1 addition & 0 deletions compiler/src/dotty/tools/dotc/transform/TailRec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ class TailRec extends MiniPhase {
def tailArgOrPureExpr(stat: Tree): Boolean = stat match {
case stat: ValDef if stat.name.is(TailTempName) || !stat.symbol.is(Mutable) => tailArgOrPureExpr(stat.rhs)
case Assign(lhs: Ident, rhs) if lhs.symbol.name.is(TailLocalName) => tailArgOrPureExpr(rhs)
case Assign(lhs: Ident, rhs: Ident) if lhs.symbol == rhs.symbol => true
case stat: Ident if stat.symbol.name.is(TailLocalName) => true
case _ => tpd.isPureExpr(stat)
}
Expand Down
6 changes: 2 additions & 4 deletions library/src-bootstrapped/scala/quoted/Liftable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,8 @@ object Liftable {
/** Default liftable for Class[T] */
given ClassLiftable[T] as Liftable[Class[T]] = new Liftable[Class[T]] {
def toExpr(x: Class[T]) = {
val qctx1 = scala.internal.tasty.CompilerInterface.quoteContextWithCompilerInterface(qctx)
import qctx1.tasty._
val tpe = qctx1.tasty.Type_ofErasedClass(x)
Ref(defn.Predef_classOf).appliedToType(tpe).seal.asInstanceOf[Expr[Class[T]]]
import qctx.tasty._
Ref(defn.Predef_classOf).appliedToType(Type.typeConstructorOf(x)).seal.asInstanceOf[Expr[Class[T]]]
}
}

Expand Down
Loading