Skip to content

Commit 82767d1

Browse files
authored
Merge pull request #2800 from dotty-staging/fix-predef-deprecated-cycle
Fix #2633: Cyclic reference when compiling Predef and deprecated
2 parents 0109fef + 04f5584 commit 82767d1

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ class Definitions {
829829
}
830830

831831
val predefClassNames: Set[Name] =
832-
Set("Predef$", "DeprecatedPredef", "LowPriorityImplicits").map(_.toTypeName)
832+
Set("Predef$", "DeprecatedPredef", "LowPriorityImplicits").map(_.toTypeName.unmangleClassName)
833833

834834
/** Is `cls` the predef module class, or a class inherited by Predef? */
835835
def isPredefClass(cls: Symbol) =

compiler/test/dotty/tools/dotc/CompilationTests.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,16 @@ class CompilationTests extends ParallelTesting {
7272
),
7373
scala2Mode
7474
) +
75+
// FIXME: This fails with .times(2), see #2799
76+
compileList(
77+
"testPredefDeprecatedNonCyclic",
78+
List(
79+
"../scala2-library/src/library/scala/io/Position.scala",
80+
"../scala2-library/src/library/scala/Predef.scala",
81+
"../scala2-library/src/library/scala/deprecated.scala"
82+
),
83+
scala2Mode
84+
) +
7585
compileFilesInDir("../tests/new", defaultOptions) +
7686
compileFilesInDir("../tests/pos-scala2", scala2Mode) +
7787
compileFilesInDir("../tests/pos", defaultOptions) +

0 commit comments

Comments
 (0)