Skip to content

Commit 2fb99fd

Browse files
Point the compiler to compiletime.ops package
Package object of the same name was removed, everything inside is now a toplevel definition.
1 parent 7ce2a1d commit 2fb99fd

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,11 @@ class Definitions {
240240
@tu lazy val CompiletimeTesting_ErrorKind: Symbol = requiredModule("scala.compiletime.testing.ErrorKind")
241241
@tu lazy val CompiletimeTesting_ErrorKind_Parser: Symbol = CompiletimeTesting_ErrorKind.requiredMethod("Parser")
242242
@tu lazy val CompiletimeTesting_ErrorKind_Typer: Symbol = CompiletimeTesting_ErrorKind.requiredMethod("Typer")
243-
@tu lazy val CompiletimeOpsPackageObject: Symbol = requiredModule("scala.compiletime.ops.package")
244-
@tu lazy val CompiletimeOpsPackageObjectAny: Symbol = requiredModule("scala.compiletime.ops.package.any")
245-
@tu lazy val CompiletimeOpsPackageObjectInt: Symbol = requiredModule("scala.compiletime.ops.package.int")
246-
@tu lazy val CompiletimeOpsPackageObjectString: Symbol = requiredModule("scala.compiletime.ops.package.string")
247-
@tu lazy val CompiletimeOpsPackageObjectBoolean: Symbol = requiredModule("scala.compiletime.ops.package.boolean")
243+
@tu lazy val CompiletimeOpsPackage: Symbol = requiredPackage("scala.compiletime.ops")
244+
@tu lazy val CompiletimeOpsAny: Symbol = requiredModule("scala.compiletime.ops.any")
245+
@tu lazy val CompiletimeOpsInt: Symbol = requiredModule("scala.compiletime.ops.int")
246+
@tu lazy val CompiletimeOpsString: Symbol = requiredModule("scala.compiletime.ops.string")
247+
@tu lazy val CompiletimeOpsBoolean: Symbol = requiredModule("scala.compiletime.ops.boolean")
248248

249249
/** The `scalaShadowing` package is used to safely modify classes and
250250
* objects in scala so that they can be used from dotty. They will
@@ -1098,10 +1098,10 @@ class Definitions {
10981098
compiletimePackageOpTypes.contains(sym.name)
10991099
&& (
11001100
sym.owner == CompiletimePackageObject.moduleClass && sym.name == tpnme.S
1101-
|| sym.owner == CompiletimeOpsPackageObjectAny.moduleClass && compiletimePackageAnyTypes.contains(sym.name)
1102-
|| sym.owner == CompiletimeOpsPackageObjectInt.moduleClass && compiletimePackageIntTypes.contains(sym.name)
1103-
|| sym.owner == CompiletimeOpsPackageObjectBoolean.moduleClass && compiletimePackageBooleanTypes.contains(sym.name)
1104-
|| sym.owner == CompiletimeOpsPackageObjectString.moduleClass && compiletimePackageStringTypes.contains(sym.name)
1101+
|| sym.effectiveOwner == CompiletimeOpsAny.moduleClass && compiletimePackageAnyTypes.contains(sym.name)
1102+
|| sym.effectiveOwner == CompiletimeOpsInt.moduleClass && compiletimePackageIntTypes.contains(sym.name)
1103+
|| sym.effectiveOwner == CompiletimeOpsBoolean.moduleClass && compiletimePackageBooleanTypes.contains(sym.name)
1104+
|| sym.effectiveOwner == CompiletimeOpsString.moduleClass && compiletimePackageStringTypes.contains(sym.name)
11051105
)
11061106

11071107
// ----- Scala-2 library patches --------------------------------------

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3985,11 +3985,11 @@ object Types {
39853985
if (owner == defn.CompiletimePackageObject.moduleClass) name match {
39863986
case tpnme.S if nArgs == 1 => constantFold1(natValue, _ + 1)
39873987
case _ => None
3988-
} else if (owner == defn.CompiletimeOpsPackageObjectAny.moduleClass) name match {
3988+
} else if (owner == defn.CompiletimeOpsAny.moduleClass) name match {
39893989
case tpnme.Equals if nArgs == 2 => constantFold2(constValue, _ == _)
39903990
case tpnme.NotEquals if nArgs == 2 => constantFold2(constValue, _ != _)
39913991
case _ => None
3992-
} else if (owner == defn.CompiletimeOpsPackageObjectInt.moduleClass) name match {
3992+
} else if (owner == defn.CompiletimeOpsInt.moduleClass) name match {
39933993
case tpnme.Abs if nArgs == 1 => constantFold1(intValue, _.abs)
39943994
case tpnme.Negate if nArgs == 1 => constantFold1(intValue, x => -x)
39953995
case tpnme.ToString if nArgs == 1 => constantFold1(intValue, _.toString)
@@ -4017,10 +4017,10 @@ object Types {
40174017
case tpnme.Min if nArgs == 2 => constantFold2(intValue, _ min _)
40184018
case tpnme.Max if nArgs == 2 => constantFold2(intValue, _ max _)
40194019
case _ => None
4020-
} else if (owner == defn.CompiletimeOpsPackageObjectString.moduleClass) name match {
4020+
} else if (owner == defn.CompiletimeOpsString.moduleClass) name match {
40214021
case tpnme.Plus if nArgs == 2 => constantFold2(stringValue, _ + _)
40224022
case _ => None
4023-
} else if (owner == defn.CompiletimeOpsPackageObjectBoolean.moduleClass) name match {
4023+
} else if (owner == defn.CompiletimeOpsBoolean.moduleClass) name match {
40244024
case tpnme.Not if nArgs == 1 => constantFold1(boolValue, x => !x)
40254025
case tpnme.And if nArgs == 2 => constantFold2(boolValue, _ && _)
40264026
case tpnme.Or if nArgs == 2 => constantFold2(boolValue, _ || _)

0 commit comments

Comments
 (0)