Skip to content

Commit fb889a2

Browse files
committed
Move quoted.Matcher to scala.internal
1 parent ea3ecf6 commit fb889a2

File tree

7 files changed

+13
-16
lines changed

7 files changed

+13
-16
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,12 @@ class Definitions {
723723
lazy val InternalQuoted_patternHoleR: TermRef = InternalQuotedModule.requiredMethodRef("patternHole")
724724
def InternalQuoted_patternHole(implicit ctx: Context): Symbol = InternalQuoted_patternHoleR.symbol
725725

726+
lazy val InternalQuotedMatcherModuleRef: TermRef = ctx.requiredModuleRef("scala.internal.quoted.Matcher")
727+
def InternalQuotedMatcherModule(implicit ctx: Context): Symbol = InternalQuotedMatcherModuleRef.symbol
728+
729+
lazy val InternalQuotedMatcher_unapplyR: TermRef = InternalQuotedMatcherModule.requiredMethodRef(nme.unapply)
730+
def InternalQuotedMatcher_unapply(implicit ctx: Context) = InternalQuotedMatcher_unapplyR.symbol
731+
726732
lazy val QuotedExprsModule: TermSymbol = ctx.requiredModule("scala.quoted.Exprs")
727733
def QuotedExprsClass(implicit ctx: Context): ClassSymbol = QuotedExprsModule.asClass
728734

@@ -745,12 +751,6 @@ class Definitions {
745751
lazy val TastyReflectionModule: TermSymbol = ctx.requiredModule("scala.tasty.Reflection")
746752
lazy val TastyReflection_macroContext: TermSymbol = TastyReflectionModule.requiredMethod("macroContext")
747753

748-
lazy val QuotedMatcherModuleRef: TermRef = ctx.requiredModuleRef("scala.runtime.quoted.Matcher")
749-
def QuotedMatcherModule(implicit ctx: Context): Symbol = QuotedMatcherModuleRef.symbol
750-
751-
lazy val QuotedMatcher_unapplyR: TermRef = QuotedMatcherModule.requiredMethodRef(nme.unapply)
752-
def QuotedMatcher_unapply(implicit ctx: Context) = QuotedMatcher_unapplyR.symbol
753-
754754
lazy val EqlType: TypeRef = ctx.requiredClassRef("scala.Eql")
755755
def EqlClass(implicit ctx: Context): ClassSymbol = EqlType.symbol.asClass
756756
def EqlModule(implicit ctx: Context): Symbol = EqlClass.companionModule

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1944,7 +1944,7 @@ class Typer extends Namer
19441944
val patType = defn.tupleType(splices.tpes.map(_.widen))
19451945
val splicePat = typed(untpd.Tuple(splices.map(untpd.TypedSplice(_))).withSpan(quoted.span), patType)
19461946
UnApply(
1947-
fun = ref(defn.QuotedMatcher_unapplyR).appliedToType(patType),
1947+
fun = ref(defn.InternalQuotedMatcher_unapplyR).appliedToType(patType),
19481948
implicits =
19491949
ref(defn.InternalQuoted_exprQuoteR).appliedToType(shape.tpe).appliedTo(shape) ::
19501950
implicitArgTree(defn.TastyReflectionType, tree.span) :: Nil,

library/src-bootstrapped/scala/runtime/quoted/Matcher.scala renamed to library/src-bootstrapped/scala/internal/quoted/Matcher.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package scala.runtime.quoted
1+
package scala.internal.quoted
22

33
import scala.annotation.internal.sharable
44

library/src-non-bootstrapped/scala/runtime/quoted/Matcher.scala renamed to library/src-non-bootstrapped/scala/internal/quoted/Matcher.scala

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

3-
import scala.quoted._
4-
import scala.tasty._
3+
import scala.quoted.Expr
4+
import scala.tasty.Reflection
55

66
object Matcher {
77

tests/run-with-compiler/quote-matcher-runtime/quoted_1.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ object Macros {
1010
private def impl[A, B](a: Expr[A], b: Expr[B])(implicit reflect: Reflection): Expr[Unit] = {
1111
import reflect._
1212

13-
val res = scala.runtime.quoted.Matcher.unapply[Tuple](a)(b, reflect).map { tup =>
13+
val res = scala.internal.quoted.Matcher.unapply[Tuple](a)(b, reflect).map { tup =>
1414
tup.toArray.toList.map {
1515
case r: Expr[_] =>
1616
s"Expr(${r.unseal.showCode})"

tests/run-with-compiler/quote-matcher-runtime/quoted_2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
import Macros._
33

4-
import scala.runtime.quoted.Matcher._
4+
import scala.internal.quoted.Matcher._
55

66
import scala.internal.Quoted.patternHole
77

tests/run-with-compiler/quote-matcher-symantics-1/quoted_1.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ import scala.quoted.matching._
44

55
import scala.tasty.Reflection
66

7-
import scala.runtime.quoted.Matcher._
8-
9-
import scala.internal.Quoted.patternHole
107

118
object Macros {
129

0 commit comments

Comments
 (0)