Skip to content

Commit 9acec6a

Browse files
Rid of compiletime.ops package object
1 parent 8216d84 commit 9acec6a

File tree

3 files changed

+224
-225
lines changed

3 files changed

+224
-225
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
/** Note: We cannot have same named methods defined in Object and Any (and AnyVal, for that matter)
250250
* because after erasure the Any and AnyVal references get remapped to the Object methods
@@ -1088,10 +1088,10 @@ class Definitions {
10881088
compiletimePackageOpTypes.contains(sym.name)
10891089
&& (
10901090
sym.owner == CompiletimePackageObject.moduleClass && sym.name == tpnme.S
1091-
|| sym.owner == CompiletimeOpsPackageObjectAny.moduleClass && compiletimePackageAnyTypes.contains(sym.name)
1092-
|| sym.owner == CompiletimeOpsPackageObjectInt.moduleClass && compiletimePackageIntTypes.contains(sym.name)
1093-
|| sym.owner == CompiletimeOpsPackageObjectBoolean.moduleClass && compiletimePackageBooleanTypes.contains(sym.name)
1094-
|| sym.owner == CompiletimeOpsPackageObjectString.moduleClass && compiletimePackageStringTypes.contains(sym.name)
1091+
|| sym.owner == CompiletimeOpsAny.moduleClass && compiletimePackageAnyTypes.contains(sym.name)
1092+
|| sym.owner == CompiletimeOpsInt.moduleClass && compiletimePackageIntTypes.contains(sym.name)
1093+
|| sym.owner == CompiletimeOpsBoolean.moduleClass && compiletimePackageBooleanTypes.contains(sym.name)
1094+
|| sym.owner == CompiletimeOpsString.moduleClass && compiletimePackageStringTypes.contains(sym.name)
10951095
)
10961096

10971097
// ----- 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)