Skip to content

Commit 64da056

Browse files
committed
Remove DottyPredef
1 parent 71b68b7 commit 64da056

File tree

3 files changed

+5
-21
lines changed

3 files changed

+5
-21
lines changed

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

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -507,17 +507,6 @@ class Definitions {
507507
def staticsMethodRef(name: PreName): TermRef = ScalaStaticsModule.requiredMethodRef(name)
508508
def staticsMethod(name: PreName): TermSymbol = ScalaStaticsModule.requiredMethod(name)
509509

510-
// Dotty deviation: we cannot use a @tu lazy val here because @tu lazy vals in dotty
511-
// will return "null" when called recursively, see #1856.
512-
def DottyPredefModule: Symbol = {
513-
if (myDottyPredefModule == null) {
514-
myDottyPredefModule = getModuleIfDefined("dotty.DottyPredef")
515-
assert(myDottyPredefModule != null)
516-
}
517-
myDottyPredefModule
518-
}
519-
private var myDottyPredefModule: Symbol = _
520-
521510
@tu lazy val DottyArraysModule: Symbol = requiredModule("dotty.runtime.Arrays")
522511
def newGenericArrayMethod(using Context): TermSymbol = DottyArraysModule.requiredMethod("newGenericArray")
523512
def newArrayMethod(using Context): TermSymbol = DottyArraysModule.requiredMethod("newArray")
@@ -1351,10 +1340,8 @@ class Definitions {
13511340
JavaImportFns :+
13521341
RootRef(() => ScalaPackageVal.termRef)
13531342

1354-
private val PredefImportFns: List[RootRef] = List(
1355-
RootRef(() => ScalaPredefModule.termRef, isPredef=true),
1356-
RootRef(() => DottyPredefModule.termRef)
1357-
)
1343+
private val PredefImportFns: RootRef =
1344+
RootRef(() => ScalaPredefModule.termRef, isPredef=true)
13581345

13591346
@tu private lazy val JavaRootImportFns: List[RootRef] =
13601347
if ctx.settings.YnoImports.value then Nil
@@ -1363,7 +1350,7 @@ class Definitions {
13631350
@tu private lazy val ScalaRootImportFns: List[RootRef] =
13641351
if ctx.settings.YnoImports.value then Nil
13651352
else if ctx.settings.YnoPredef.value then ScalaImportFns
1366-
else ScalaImportFns ++ PredefImportFns
1353+
else ScalaImportFns :+ PredefImportFns
13671354

13681355
@tu private lazy val JavaRootImportTypes: List[TermRef] = JavaRootImportFns.map(_.refFn())
13691356
@tu private lazy val ScalaRootImportTypes: List[TermRef] = ScalaRootImportFns.map(_.refFn())
@@ -1395,7 +1382,7 @@ class Definitions {
13951382
else ScalaUnqualifiedOwnerTypes
13961383

13971384
/** Names of the root import symbols that can be hidden by other imports */
1398-
@tu lazy val ShadowableImportNames: Set[TermName] = Set("Predef", "DottyPredef").map(_.toTermName)
1385+
@tu lazy val ShadowableImportNames: Set[TermName] = Set("Predef".toTermName)
13991386

14001387
/** Class symbols for which no class exist at runtime */
14011388
@tu lazy val NotRuntimeClasses: Set[Symbol] = Set(AnyClass, AnyValClass, NullClass, NothingClass)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ object ImportInfo {
5151
* @param symNameOpt Optionally, the name of the import symbol. None for root imports.
5252
* Defined for all explicit imports from ident or select nodes.
5353
* @param isRootImport true if this is one of the implicit imports of scala, java.lang,
54-
* scala.Predef or dotty.DottyPredef in the start context, false otherwise.
54+
* scala.Predef in the start context, false otherwise.
5555
*/
5656
class ImportInfo(symf: Context ?=> Symbol,
5757
val selectors: List[untpd.ImportSelector],

library/src/dotty/DottyPredef.scala

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)