diff --git a/compiler/src/dotty/tools/dotc/CompilationUnit.scala b/compiler/src/dotty/tools/dotc/CompilationUnit.scala index 078aa6c27635..b796b6c3cb5b 100644 --- a/compiler/src/dotty/tools/dotc/CompilationUnit.scala +++ b/compiler/src/dotty/tools/dotc/CompilationUnit.scala @@ -131,12 +131,12 @@ object CompilationUnit { unit1 } - /** Create a compilation unit corresponding to an in-memory String. + /** Create a compilation unit corresponding to an in-memory String. * Used for `compiletime.testing.typeChecks`. */ def apply(name: String, source: String)(using Context): CompilationUnit = { val src = SourceFile.virtual(name = name, content = source, maybeIncomplete = false) - new CompilationUnit(src, null) + new CompilationUnit(src) } /** Create a compilation unit corresponding to `source`. diff --git a/compiler/src/dotty/tools/dotc/core/Phases.scala b/compiler/src/dotty/tools/dotc/core/Phases.scala index 2f4bdc9f3d01..8d690a28a403 100644 --- a/compiler/src/dotty/tools/dotc/core/Phases.scala +++ b/compiler/src/dotty/tools/dotc/core/Phases.scala @@ -210,7 +210,7 @@ object Phases { private var myPostTyperPhase: Phase = _ private var mySbtExtractDependenciesPhase: Phase = _ private var myPicklerPhase: Phase = _ - private var mySetRootTreePhase: Phase = uninitialized + private var mySetRootTreePhase: Phase = _ private var myInliningPhase: Phase = _ private var myStagingPhase: Phase = _ private var mySplicingPhase: Phase = _ diff --git a/compiler/test-resources/repl/init-script-flag b/compiler/test-resources/repl/init-script-flag new file mode 100644 index 000000000000..373f21e15e93 --- /dev/null +++ b/compiler/test-resources/repl/init-script-flag @@ -0,0 +1,5 @@ +scala>:reset --repl-init-script:'println("Hello from init script!")' +Resetting REPL state with the following settings: + --repl-init-script:println("Hello from init script!") + +Hello from init script! diff --git a/tests/neg/i22320.check b/tests/neg/i22320.check deleted file mode 100644 index 3bada9a0b73c..000000000000 --- a/tests/neg/i22320.check +++ /dev/null @@ -1,12 +0,0 @@ --- [E008] Not Found Error: tests/neg/i22320.scala:19:19 ---------------------------------------------------------------- -19 | val z = system.z // error - | ^^^^^^^^ - | value z is not a member of a.System. - | An extension method was tried, but could not be fully constructed: - | - | a.z(system) - | - | failed with: - | - | Found: (system : a.System) - | Required: a.SimulatedSystem diff --git a/tests/neg/i22320.scala b/tests/neg/i22320.scala deleted file mode 100644 index 4a9eccf08474..000000000000 --- a/tests/neg/i22320.scala +++ /dev/null @@ -1,19 +0,0 @@ -package a: - opaque type System = Any - opaque type SimulatedSystem <: System = System - - extension (system: System) - def x: BigInt = ??? - def y: BigInt = ??? - end extension - - extension (system: SimulatedSystem) - def z: BigInt = ??? - end extension - -package b: - import a.* - def issue(system: System) = - val x = system.x - val y = system.y - val z = system.z // error \ No newline at end of file