From 479469c8c059b2d42d6b56a8cef844ecaf6f3cde Mon Sep 17 00:00:00 2001 From: noti0na1 Date: Wed, 8 Jan 2025 15:52:51 +0100 Subject: [PATCH 1/3] copyright 2025 note that I added "dba Akka" to NOTICE.md but I don't believe it's necessary to pollute the version history adding that to the top of every source file, too. in legal contexts, "Lightbend, Inc." is still the company's legal name [Cherry-picked 34e5d5675d14199f1b288430c47c9972b2ffcf24] --- compiler/test-resources/repl/init-script-flag | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 compiler/test-resources/repl/init-script-flag 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! From 65a421e38363dd727cc44baf15b8a746ab96fddb Mon Sep 17 00:00:00 2001 From: Tomasz Godzik Date: Fri, 14 Mar 2025 10:25:57 +0100 Subject: [PATCH 2/3] bugfix: Fix issues after merging --- compiler/src/dotty/tools/dotc/CompilationUnit.scala | 4 ++-- compiler/src/dotty/tools/dotc/core/Phases.scala | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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 = _ From 3d18e3a6c9d45cc7018e63e6d4f88b7318ff0b8c Mon Sep 17 00:00:00 2001 From: Tomasz Godzik Date: Fri, 14 Mar 2025 11:01:31 +0100 Subject: [PATCH 3/3] bugfix: Remove test for a fix that couldn't be ported --- tests/neg/i22320.check | 12 ------------ tests/neg/i22320.scala | 19 ------------------- 2 files changed, 31 deletions(-) delete mode 100644 tests/neg/i22320.check delete mode 100644 tests/neg/i22320.scala 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