Skip to content

Commit 788c6f4

Browse files
authored
Merge branch 'main' into fix/repl-multiline-colon
2 parents 32e2120 + 25401d0 commit 788c6f4

File tree

132 files changed

+2346
-1269
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+2346
-1269
lines changed

.github/workflows/ci.yaml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ jobs:
125125
uses: actions/checkout@v5
126126

127127
- name: Test
128-
run: sbt ";scala3-bootstrapped/compile; scala3-presentation-compiler/test; scala3-language-server/test"
128+
run: sbt ";scala3-bootstrapped/compile"
129129
shell: cmd
130130

131131
- name: build binary
@@ -219,14 +219,15 @@ jobs:
219219
- name: Check compiler version
220220
shell: bash
221221
run : |
222-
version=$(./project/scripts/sbt "print scala3-compiler-bootstrapped/version" | tail -n1)
222+
version=$(./project/scripts/sbt "print scala3-compiler-bootstrapped-new/version" | tail -n1)
223223
echo "This build version: ${version}"
224224
if [ "${version}" != "${{ env.RELEASE_TAG }}" ]; then
225225
echo "Compiler version for this build '${version}', does not match tag: ${{ env.RELEASE_TAG }}"
226226
exit 1
227227
fi
228228
229229
- name: Prepare the SDKs
230+
if: false # TODO: Requires changes to dist targets, to be done before stable release
230231
shell: bash
231232
run : |
232233
prepareSDK() {
@@ -253,11 +254,13 @@ jobs:
253254
prepareSDK "-x86_64-pc-win32" "dist-win-x86_64" "./dist/win-x86_64/"
254255
255256
- name: Download MSI package
257+
if: false # TODO: Requires changes to dist targets, to be done before stable release
256258
uses: actions/download-artifact@v6
257259
with:
258260
name: scala.msi
259261
path: .
260262
- name: Prepare MSI package
263+
if: false # TODO: Requires changes to dist targets, to be done before stable release
261264
shell: bash
262265
run: |
263266
msiInstaller="scala3-${{ env.RELEASE_TAG }}.msi"
@@ -285,13 +288,14 @@ jobs:
285288
--latest=${{ !contains(env.RELEASE_TAG, '-RC') }} \
286289
--prerelease=${{ contains(env.RELEASE_TAG, '-RC') }} \
287290
--verify-tag ${{ env.RELEASE_TAG }} \
288-
scala3-${{ env.RELEASE_TAG }}*.zip \
289-
scala3-${{ env.RELEASE_TAG }}*.tar.gz \
290-
scala3-${{ env.RELEASE_TAG }}*.sha256 \
291-
scala3-${{ env.RELEASE_TAG }}.msi
291+
# TODO: dist packaging for 3.8.0 stable release
292+
# scala3-${{ env.RELEASE_TAG }}*.zip \
293+
# scala3-${{ env.RELEASE_TAG }}*.tar.gz \
294+
# scala3-${{ env.RELEASE_TAG }}*.sha256 \
295+
# scala3-${{ env.RELEASE_TAG }}.msi
292296
293297
- name: Publish Release
294-
run: ./project/scripts/sbtPublish ";project scala3-bootstrapped ;publishSigned ;sonaUpload"
298+
run: ./project/scripts/sbtPublish ";project scala3-bootstrapped-new ;publishSigned ;sonaUpload"
295299

296300
build-msi-package:
297301
uses: ./.github/workflows/build-msi.yml

.github/workflows/lts-backport.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
with:
1717
fetch-depth: 0
1818
- uses: coursier/cache-action@v7
19-
- uses: VirtusLab/scala-cli-setup@v1.9.1
19+
- uses: VirtusLab/scala-cli-setup@v1.10.0
2020
- run: scala-cli ./project/scripts/addToBackportingProject.scala -- ${{ github.sha }}
2121
env:
2222
GRAPHQL_API_TOKEN: ${{ secrets.GRAPHQL_API_TOKEN }}

.github/workflows/releases.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232

3333
publish-winget:
3434
uses: ./.github/workflows/publish-winget.yml
35+
if: false # TODO: Requires setting up initial WinGet package
3536
with:
3637
version: ${{ inputs.version }}
3738
secrets:

.github/workflows/stdlib.yaml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,40 @@ jobs:
316316
- name: Compile `scaladoc`
317317
run: ./project/scripts/sbt scaladoc-new/compile
318318

319+
presentation-compiler:
320+
runs-on: ubuntu-latest
321+
steps:
322+
- name: Git Checkout
323+
uses: actions/checkout@v5
324+
325+
- name: Set up JDK 17
326+
uses: actions/setup-java@v5
327+
with:
328+
distribution: 'temurin'
329+
java-version: 17
330+
cache: 'sbt'
331+
- uses: sbt/setup-sbt@v1
332+
333+
- name: Compile `scala3-presentation-compiler`
334+
run: ./project/scripts/sbt scala3-presentation-compiler/compile
335+
336+
language-server:
337+
runs-on: ubuntu-latest
338+
steps:
339+
- name: Git Checkout
340+
uses: actions/checkout@v5
341+
342+
- name: Set up JDK 17
343+
uses: actions/setup-java@v5
344+
with:
345+
distribution: 'temurin'
346+
java-version: 17
347+
cache: 'sbt'
348+
- uses: sbt/setup-sbt@v1
349+
350+
- name: Compile `scala3-language-server`
351+
run: ./project/scripts/sbt scala3-language-server/compile
352+
319353
#################################################################################################
320354
########################################### MiMa JOBS ###########################################
321355
#################################################################################################
@@ -583,6 +617,40 @@ jobs:
583617
- name: Test REPL
584618
run: ./project/scripts/sbt scala3-repl/test
585619

620+
test-presentation-compiler:
621+
runs-on: ubuntu-latest
622+
needs: [presentation-compiler]
623+
steps:
624+
- name: Git Checkout
625+
uses: actions/checkout@v5
626+
627+
- name: Set up JDK 17
628+
uses: actions/setup-java@v5
629+
with:
630+
distribution: 'temurin'
631+
java-version: 17
632+
cache: 'sbt'
633+
- uses: sbt/setup-sbt@v1
634+
- name: Test Presentation Compiler
635+
run: ./project/scripts/sbt scala3-presentation-compiler/test
636+
637+
test-language-server:
638+
runs-on: ubuntu-latest
639+
needs: [language-server]
640+
steps:
641+
- name: Git Checkout
642+
uses: actions/checkout@v5
643+
644+
- name: Set up JDK 17
645+
uses: actions/setup-java@v5
646+
with:
647+
distribution: 'temurin'
648+
java-version: 17
649+
cache: 'sbt'
650+
- uses: sbt/setup-sbt@v1
651+
- name: Test Language Server
652+
run: ./project/scripts/sbt scala3-language-server/test
653+
586654
scripted-tests:
587655
runs-on: ubuntu-latest
588656
needs: [scala3-compiler-bootstrapped, tasty-core-bootstrapped, scala3-staging, scala3-tasty-inspector, scala-library-sjs, scaladoc]

community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class CommunityBuildTestB:
4242
@Test def discipline = projects.discipline.run()
4343
@Test def disciplineMunit = projects.disciplineMunit.run()
4444
@Test def disciplineSpecs2 = projects.disciplineSpecs2.run()
45-
@Test def fs2 = projects.fs2.run()
45+
//@Test def fs2 = projects.fs2.run()
4646
@Test def monocle = projects.monocle.run()
4747
@Test def munit = projects.munit.run()
4848
@Test def munitCatsEffect = projects.munitCatsEffect.run()

compiler/src/dotty/tools/backend/sjs/JSDefinitions.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ final class JSDefinitions()(using Context) {
6969
@threadUnsafe lazy val PseudoUnion_fromTypeConstructorR = PseudoUnionModule.requiredMethodRef("fromTypeConstructor")
7070
def PseudoUnion_fromTypeConstructor(using Context) = PseudoUnion_fromTypeConstructorR.symbol
7171

72-
@threadUnsafe lazy val UnionOpsModuleRef = requiredModuleRef("scala.scalajs.js.internal.UnitOps")
73-
7472
@threadUnsafe lazy val JSArrayType: TypeRef = requiredClassRef("scala.scalajs.js.Array")
7573
def JSArrayClass(using Context) = JSArrayType.symbol.asClass
7674
@threadUnsafe lazy val JSDynamicType: TypeRef = requiredClassRef("scala.scalajs.js.Dynamic")

compiler/src/dotty/tools/dotc/ast/tpd.scala

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,15 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
480480
else if tp.symbol.hasAnnotation(defn.ScalaStaticAnnot) then
481481
Ident(tp)
482482
else
483+
// Throw an error here if we detect a skolem to improve the error message in tests/neg/i8623.scala
484+
def checkNoSkolemInPrefix(pre: Type): Unit = pre.dealias match
485+
case pre: SkolemType =>
486+
throw TypeError(em"cannot construct a tree referring to $tp because of skolem prefix $pre")
487+
case pre: TermRef => checkNoSkolemInPrefix(pre.prefix)
488+
case _ =>
489+
483490
val pre = tp.prefix
491+
checkNoSkolemInPrefix(tp)
484492
if pre.isSingleton then followOuterLinks(singleton(pre.dealias, needLoad)).select(tp)
485493
else
486494
val res = Select(TypeTree(pre), tp)
@@ -517,9 +525,10 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
517525
def singleton(tp: Type, needLoad: Boolean = true)(using Context): Tree = tp.dealias match {
518526
case tp: TermRef => ref(tp, needLoad)
519527
case tp: ThisType => This(tp.cls)
520-
case tp: SkolemType => singleton(tp.narrow(), needLoad)
521528
case SuperType(qual, _) => singleton(qual, needLoad)
522529
case ConstantType(value) => Literal(value)
530+
case tp: SkolemType =>
531+
throw TypeError(em"cannot construct a tree referring to skolem $tp")
523532
}
524533

525534
/** A tree representing a `newXYZArray` operation of the right

compiler/src/dotty/tools/dotc/cc/Capability.scala

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,10 +375,14 @@ object Capabilities:
375375
case tp: SetCapability => tp.captureSetOfInfo.isReadOnly
376376
case _ => this ne stripReadOnly
377377

378-
/** The restriction of this capability or NoSymbol if there is none */
379-
final def restriction(using Context): Symbol = this match
378+
/** The classifier, either given in an explicit `.only` or assumed for a
379+
* FreshCap. AnyRef for unclassified FreshCaps. Otherwise NoSymbol if no
380+
* classifier is given.
381+
*/
382+
final def classifier(using Context): Symbol = this match
380383
case Restricted(_, cls) => cls
381-
case Maybe(ref1) => ref1.restriction
384+
case Maybe(ref1) => ref1.classifier
385+
case self: FreshCap => self.hiddenSet.classifier
382386
case _ => NoSymbol
383387

384388
/** Is this a reach reference of the form `x*` or a readOnly or maybe variant
@@ -609,7 +613,7 @@ object Capabilities:
609613
case Reach(_) =>
610614
captureSetOfInfo.transClassifiers
611615
case self: CoreCapability =>
612-
if self.derivesFromCapability then toClassifiers(self.classifier)
616+
if self.derivesFromCapability then toClassifiers(self.inheritedClassifier)
613617
else captureSetOfInfo.transClassifiers
614618
if myClassifiers != UnknownClassifier then
615619
classifiersValid == currentId

compiler/src/dotty/tools/dotc/cc/CaptureOps.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ extension (tp: Type)
488488
case _ =>
489489
tp
490490

491-
def classifier(using Context): ClassSymbol =
491+
def inheritedClassifier(using Context): ClassSymbol =
492492
tp.classSymbols.map(_.classifier).foldLeft(defn.AnyClass)(leastClassifier)
493493

494494
extension (tp: MethodType)

compiler/src/dotty/tools/dotc/cc/CapturingType.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ object CapturingType:
4040
apply(parent1, refs ++ refs1, boxed)
4141
case _ =>
4242
if parent.derivesFromMutable then refs.associateWithMutable()
43-
refs.adoptClassifier(parent.classifier)
43+
refs.adoptClassifier(parent.inheritedClassifier)
4444
AnnotatedType(parent, CaptureAnnotation(refs, boxed)(defn.RetainsAnnot))
4545

4646
/** An extractor for CapturingTypes. Capturing types are recognized if

0 commit comments

Comments
 (0)