Skip to content

Commit 87bdb76

Browse files
committed
Rename CompilerInterface to QuoteContextInternal
1 parent 7b5cdba commit 87bdb76

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ import scala.quoted._
9797
*/
9898
object Matcher {
9999

100-
abstract class QuoteMatcher[QCtx <: QuoteContext & scala.internal.quoted.CompilerInterface & Singleton](val qctx: QCtx) {
100+
abstract class QuoteMatcher[QCtx <: QuoteContext & scala.internal.quoted.QuoteContextInternal & Singleton](val qctx: QCtx) {
101101

102102
// TODO improve performance
103103

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ object QuoteContextImpl {
4545

4646
}
4747

48-
class QuoteContextImpl private (ctx: Context) extends QuoteContext, scala.internal.quoted.CompilerInterface:
48+
class QuoteContextImpl private (ctx: Context) extends QuoteContext, scala.internal.quoted.QuoteContextInternal:
4949

5050
object reflect extends scala.tasty.Reflection:
5151

@@ -2660,7 +2660,7 @@ class QuoteContextImpl private (ctx: Context) extends QuoteContext, scala.intern
26602660
ctx1
26612661

26622662
val qctx1 = dotty.tools.dotc.quoted.QuoteContextImpl()(using ctx1)
2663-
.asInstanceOf[QuoteContext & scala.internal.quoted.CompilerInterface]
2663+
.asInstanceOf[QuoteContext & scala.internal.quoted.QuoteContextInternal]
26642664

26652665
val matcher = new Matcher.QuoteMatcher[qctx1.type](qctx1) {
26662666
def patternHoleSymbol: qctx1.reflect.Symbol = dotc.core.Symbols.defn.InternalQuotedPatterns_patternHole.asInstanceOf

library/src-bootstrapped/scala/internal/quoted/Expr.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package scala.internal.quoted
22

33
import scala.quoted._
4-
import scala.internal.quoted.CompilerInterface.quoteContextWithCompilerInterface
4+
import scala.internal.quoted.QuoteContextInternal.quoteContextWithQuoteContextInternal
55

66
/** An Expr backed by a tree. Only the current compiler trees are allowed.
77
*
@@ -53,7 +53,7 @@ object Expr {
5353
*/
5454
def unapply[TypeBindings <: Tuple, Tup <: Tuple](scrutineeExpr: scala.quoted.Expr[Any])
5555
(using patternExpr: scala.quoted.Expr[Any], qctx: QuoteContext): Option[Tup] = {
56-
val qctx1 = quoteContextWithCompilerInterface(qctx)
56+
val qctx1 = quoteContextWithQuoteContextInternal(qctx)
5757
qctx1.exprMatch(scrutineeExpr, patternExpr).asInstanceOf[Option[Tup]]
5858
}
5959

library/src-bootstrapped/scala/internal/quoted/Type.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package scala.internal.quoted
22

33
import scala.quoted._
4-
import scala.internal.quoted.CompilerInterface.quoteContextWithCompilerInterface
4+
import scala.internal.quoted.QuoteContextInternal.quoteContextWithQuoteContextInternal
55

66
/** Quoted type (or kind) `T` backed by a tree */
77
final class Type[Tree](val typeTree: Tree, val scopeId: Int) extends scala.quoted.Type[Any] {
@@ -36,7 +36,7 @@ object Type {
3636
*/
3737
def unapply[TypeBindings <: Tuple, Tup <: Tuple](scrutineeType: scala.quoted.Type[_])
3838
(using patternType: scala.quoted.Type[_], qctx: QuoteContext): Option[Tup] = {
39-
val qctx1 = quoteContextWithCompilerInterface(qctx)
39+
val qctx1 = quoteContextWithQuoteContextInternal(qctx)
4040
qctx1.typeMatch(scrutineeType, patternType).asInstanceOf[Option[Tup]]
4141
}
4242

library/src/scala/internal/quoted/PickledQuote.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ trait PickledQuote:
1717
object PickledQuote:
1818

1919
def unpickleExpr[T](pickledQuote: PickledQuote): QuoteContext ?=> Expr[T] =
20-
val qctx = CompilerInterface.quoteContextWithCompilerInterface(summon[QuoteContext])
20+
val qctx = QuoteContextInternal.quoteContextWithQuoteContextInternal(summon[QuoteContext])
2121
qctx.unpickleExpr(pickledQuote).asInstanceOf[Expr[T]]
2222

2323
def unpickleType[T](pickledQuote: PickledQuote): QuoteContext ?=> Type[T] =
24-
val qctx = CompilerInterface.quoteContextWithCompilerInterface(summon[QuoteContext])
24+
val qctx = QuoteContextInternal.quoteContextWithQuoteContextInternal(summon[QuoteContext])
2525
qctx.unpickleType(pickledQuote).asInstanceOf[Type[T]]
2626

2727
/** Create an instance of PickledExpr from encoded tasty and sequence of labmdas to fill holes

library/src/scala/internal/quoted/CompilerInterface.scala renamed to library/src/scala/internal/quoted/QuoteContextInternal.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import scala.quoted.QuoteContext
44
import scala.tasty.reflect._
55
import scala.internal.quoted.PickledQuote
66

7-
/** Part of the reflection interface that needs to be implemented by the compiler */
8-
trait CompilerInterface { self: scala.quoted.QuoteContext =>
7+
/** Part of the QuoteContext interface that needs to be implemented by the compiler but is not visible to users */
8+
trait QuoteContextInternal { self: scala.quoted.QuoteContext =>
99

1010
import self.reflect._
1111

@@ -52,9 +52,9 @@ trait CompilerInterface { self: scala.quoted.QuoteContext =>
5252
}
5353

5454

55-
object CompilerInterface {
55+
object QuoteContextInternal {
5656

57-
private[scala] def quoteContextWithCompilerInterface(qctx: QuoteContext): qctx.type { val reflect: qctx.reflect.type } & CompilerInterface =
58-
qctx.asInstanceOf[qctx.type { val reflect: qctx.reflect.type } & CompilerInterface]
57+
private[scala] def quoteContextWithQuoteContextInternal(qctx: QuoteContext): qctx.type { val reflect: qctx.reflect.type } & QuoteContextInternal =
58+
qctx.asInstanceOf[qctx.type { val reflect: qctx.reflect.type } & QuoteContextInternal]
5959

6060
}

0 commit comments

Comments
 (0)