Skip to content

Commit 280f564

Browse files
authored
Merge branch 'main' into safer-exceptions
2 parents db484bb + d49c2d9 commit 280f564

File tree

838 files changed

+34608
-10795
lines changed

Some content is hidden

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

838 files changed

+34608
-10795
lines changed

.github/workflows/ci.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,9 @@ name: Dotty
22

33
on:
44
push:
5-
branches-ignore:
6-
- 'language-reference-stable'
75
tags:
86
- '**'
97
pull_request:
10-
branches-ignore:
11-
- 'language-reference-stable'
128
schedule:
139
- cron: '0 3 * * *' # Every day at 3 AM
1410
workflow_dispatch:
@@ -256,6 +252,7 @@ jobs:
256252
github.event_name == 'pull_request'
257253
&& !contains(github.event.pull_request.body, '[skip ci]')
258254
&& !contains(github.event.pull_request.body, '[skip community_build]')
255+
&& !contains(github.event.pull_request.body, '[skip community_build_a]')
259256
)
260257
|| (
261258
github.event_name == 'workflow_dispatch'
@@ -303,6 +300,7 @@ jobs:
303300
github.event_name == 'pull_request'
304301
&& !contains(github.event.pull_request.body, '[skip ci]')
305302
&& !contains(github.event.pull_request.body, '[skip community_build]')
303+
&& !contains(github.event.pull_request.body, '[skip community_build_b]')
306304
)
307305
|| (
308306
github.event_name == 'workflow_dispatch'
@@ -350,6 +348,7 @@ jobs:
350348
github.event_name == 'pull_request'
351349
&& !contains(github.event.pull_request.body, '[skip ci]')
352350
&& !contains(github.event.pull_request.body, '[skip community_build]')
351+
&& !contains(github.event.pull_request.body, '[skip community_build_c]')
353352
)
354353
|| (
355354
github.event_name == 'workflow_dispatch'

.github/workflows/cla.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
name: Scala CLA
22
on:
33
pull_request:
4+
branches-ignore:
5+
- 'language-reference-stable'
46
push:
57
branches:
6-
- 'language-reference-backport'
8+
- 'language-reference-stable'
79
permissions:
810
contents: write
911
pull-requests: write

.github/workflows/language-reference.yaml

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: language-reference-documentation
1+
name: Language reference documentation
22

33
on:
44
push:
@@ -14,14 +14,14 @@ permissions:
1414

1515
jobs:
1616
build-and-push:
17+
name: Build reference documentation and push it
1718
permissions:
1819
contents: write # for Git to git push
19-
pull-requests: write # for peter-evans/create-pull-request to create a PR
2020
runs-on: ubuntu-latest
2121
steps:
2222
- name: Get current date
2323
id: date
24-
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
24+
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
2525

2626
- name: Git Checkout
2727
uses: actions/checkout@v3
@@ -67,26 +67,22 @@ jobs:
6767
fi
6868
cd ..
6969
70-
- name: Merge changes to main
71-
if: github.event_name == 'push'
72-
run: |
73-
cd dotty
74-
git fetch origin main:main
75-
git checkout main
76-
git config user.name gh-actions
77-
git config user.email [email protected]
78-
git merge language-reference-stable
79-
cd ..
80-
81-
- name: Create pull request with backport to main
82-
if: github.event_name == 'push'
83-
uses: peter-evans/create-pull-request@v4
70+
backport-to-main:
71+
name: Create pull request with backport to main
72+
permissions:
73+
pull-requests: write # for repo-sync/pull-request to create a PR
74+
runs-on: ubuntu-latest
75+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
76+
steps:
77+
- uses: actions/checkout@v3
78+
- uses: repo-sync/pull-request@v2
8479
with:
85-
path: dotty
86-
branch: language-reference-backport
87-
labels: area:documentation
88-
title: Backport changes from stable documentation branch
89-
body: This pull request is created automatically after push to stable documentation branch and backports the changes
90-
reviewers: pikinier20,julienrf
91-
assignees: pikinier20
80+
destination_branch: main
81+
pr_label: area:documentation
82+
pr_title: Sync with the stable documentation branch
83+
pr_body: |
84+
This pull request is syncing the main with changes from language-reference-stable.
85+
86+
It was created automatically after ${{ github.event.head_commit.id }} by @${{ github.event.head_commit.author.username }}
87+
pr_assignee: ${{ github.event.head_commit.author.username }}
9288

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ metals.sbt
3535
.idea_modules
3636
/.worksheet/
3737

38+
# scala-cli
39+
.scala-build
40+
3841
# Partest
3942
dotty.jar
4043
dotty-lib.jar

MAINTENANCE.md

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# Issue Supervisor Role
2-
This document formally defines the _Issue Supervisor_ role. This is a repository maintenance role that is assigned to core contributors on rotating basis.
2+
3+
This document formally defines the _Issue Supervisor_ role. This is a repository maintenance role that is assigned to core contributors on a rotating basis.
34

45
## Responsibilities
5-
Issue supervisor is responsible for:
6-
- Health of the CI, nightly releases and benchmark infrastructure.
6+
7+
The issue supervisor is responsible for:
8+
9+
- The health of the CI, nightly releases and benchmark infrastructure.
710
- PRs of external contributors: assigning someone to review, or handling themselves.
811
- Triaging issues (especially new):
912
- Each issue needs to be assigned an `itype` and 1 or more `area` labels.
@@ -12,42 +15,50 @@ Issue supervisor is responsible for:
1215
- Modifying issue labels to best capture information about the issues
1316
- Attempting to reproduce the issue (or label “stat:cannot reproduce”)
1417
- Further minimizing the issue or asking the reporter of the issue to minimize it correctly (or label “stat:needs minimization”)
18+
- Identifying which issues are of considerable importance and bringing them to the attention of the team during the Dotty meeting, where they can be filtered and added to the [Future Versions](https://github.com/lampepfl/dotty/milestone/46) milestone.
1519

1620
Other core teammates are responsible for providing information to the issue supervisor in a timely manner when it is requested if they have that information.
1721

1822
## Assignment
19-
Issue supervisor is appointed for 7 days and is responsible for what is specified in the “Responsibilities” section during those 7 days. Their assumption of the role starts from the Dotty Meeting on Monday and ends on the next Dotty Meeting on Monday.
23+
24+
The issue supervisor is appointed for 7 days and is responsible for what is specified in the “Responsibilities” section during those 7 days. Their assumption of the role starts from the Dotty Meeting on Monday and ends on the next Dotty Meeting on Monday.
2025

2126
During the Dotty Meeting, an issue supervisor is assigned for the current week and for the week after that.
2227

23-
Issue supervisor schedule is maintained in the [Issue Supervisor Statistics spreadsheet](https://docs.google.com/spreadsheets/d/19IAqNzHfJ9rsii3EsjIGwPz5BLTFJs_byGM3FprmX3E/edit?usp=sharing). So, someone who knows their availability several weeks ahead into the future can assign themselves to be an issue supervisor well ahead of time.
28+
The issue supervisor schedule is maintained in the [Issue Supervisor Statistics spreadsheet](https://docs.google.com/spreadsheets/d/19IAqNzHfJ9rsii3EsjIGwPz5BLTFJs_byGM3FprmX3E/edit?usp=sharing). So, someone who knows their availability several weeks ahead into the future can assign themselves to be an issue supervisor well ahead of time.
2429

2530
## Prerequisites
31+
2632
An issue supervisor needs to have all the accesses and privileges required to get their job done. This might include:
33+
2734
- Admin rights in lampepfl/dotty repository
2835
- Admin rights in lampepfl/dotty-feature-requests repository
29-
- Permissions to create new repositories in lampepfl organization (needed to fork repositories for the community build)
36+
- Permission to create new repositories in lampepfl organization (needed to fork repositories for the community build)
3037
- Access to the LAMP slack to be able to ask for help with the infrastructure, triaging and such
3138

3239
## Procedures
33-
To ensure proper health of the infrastructure, the supervisor regularly monitors its proper operation. If a malfunction is detected, the supervisor's job is to ensure that someone is working on it (or solve it on their own).
40+
41+
To ensure the proper health of the infrastructure, the supervisor regularly monitors its proper operation. If a malfunction is detected, the supervisor's job is to ensure that someone is working on it (or solve it on their own).
3442

3543
If it is unclear what area an issue belongs to, the supervisor asks for advice from other team members on Slack or GitHub. If, after asking for advice, it turns out that nobody in the team knows how to classify it, the issue must be classified with a “stat:needs triage” label.
3644

3745
If it is unclear who should review an external PR, the supervisor asks for advice from the rest of the core team. If after asking for advice, it is still unclear who should do it, the reviewer for such a PR will be decided at the next Dotty meeting.
3846

39-
In general, if anything else is unclear for proper fulfillment of responsibilities, the supervisor must proactively seek advice from other team members on Slack or other channels.
47+
In general, if anything else is unclear for the proper fulfillment of responsibilities, the supervisor must proactively seek advice from other team members on Slack or other channels.
4048

4149
## Reporting
50+
4251
At the end of their supervision period, the supervisor reports to the team during the Dotty meeting on the following points:
4352

4453
- Whether there were any incidents with the CI, nightlies and benchmarks, how they were resolved and what steps were taken to prevent them from happening in the future.
4554
- How many new external contributors’ PRs were there and what they were about (in brief).
4655
- How many new issues were opened during their supervision period? Were there any areas that got a lot of issues? How many regressions from a prior Scala 3 release were there? Which were designated for an MSc project or an Issue Spree?
4756
- If new labels were created or old ones were removed, or there is any other feedback on how to improve the issue supervision, mention that.
4857
- Unassigned PRs and issues that the team failed to classify: bring them one by one so that the team can make a decision on them.
58+
- Issues of importance – candidates for the Future Versions milestone.
59+
60+
## Maintenance List
4961

50-
# Maintenance List
5162
The following is the list of all the principal areas of the compiler and the core team members who are responsible for their maintenance:
5263

5364
- Parser: @odersky
@@ -73,5 +84,5 @@ The following is the list of all the principal areas of the compiler and the cor
7384
- Vulpix: @dwijnand, @prolativ
7485
- JVM backend: @Kordyjan, (@sjrd)
7586
- Derivation & Mirrors: @bishabosha, (@dwijnand)
76-
- Linting (especially unused warnings) / Reporting UX : VirtusLab TBD?
87+
- Linting (especially unused warnings) / Reporting UX: VirtusLab TBD?
7788
- Java-compat: @Kordyjan
Submodule specs2 updated 167 files

community-build/src/scala/dotty/communitybuild/projects.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ final case class SbtCommunityProject(
140140
case Some(ivyHome) => List(s"-Dsbt.ivy.home=$ivyHome")
141141
case _ => Nil
142142
extraSbtArgs ++ sbtProps ++ List(
143-
"-sbt-version", "1.7.1",
143+
"-sbt-version", "1.8.0",
144144
"-Dsbt.supershell=false",
145145
s"-Ddotty.communitybuild.dir=$communitybuildDir",
146146
s"--addPluginSbtFile=$sbtPluginFilePath"

compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import dotty.tools.dotc.transform.SymUtils._
2323
import dotty.tools.dotc.util.Spans._
2424
import dotty.tools.dotc.core.Contexts._
2525
import dotty.tools.dotc.core.Phases._
26+
import dotty.tools.dotc.core.Decorators.em
2627
import dotty.tools.dotc.report
2728

2829
/*
@@ -700,7 +701,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
700701
var elemKind = arr.elementType
701702
val argsSize = args.length
702703
if (argsSize > dims) {
703-
report.error(s"too many arguments for array constructor: found ${args.length} but array has only $dims dimension(s)", ctx.source.atSpan(app.span))
704+
report.error(em"too many arguments for array constructor: found ${args.length} but array has only $dims dimension(s)", ctx.source.atSpan(app.span))
704705
}
705706
if (argsSize < dims) {
706707
/* In one step:

compiler/src/dotty/tools/backend/jvm/BCodeHelpers.scala

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
7979
outputDirectory
8080
} catch {
8181
case ex: Throwable =>
82-
report.error(s"Couldn't create file for class $cName\n${ex.getMessage}", ctx.source.atSpan(csym.span))
82+
report.error(em"Couldn't create file for class $cName\n${ex.getMessage}", ctx.source.atSpan(csym.span))
8383
null
8484
}
8585
}
@@ -422,7 +422,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
422422
emitAssocs(nestedVisitor, assocs, bcodeStore)(innerClasesStore)
423423

424424
case t =>
425-
report.error(ex"Annotation argument is not a constant", t.sourcePos)
425+
report.error(em"Annotation argument is not a constant", t.sourcePos)
426426
}
427427
}
428428

@@ -871,10 +871,11 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
871871
try body
872872
catch {
873873
case ex: Throwable =>
874-
report.error(i"""|compiler bug: created invalid generic signature for $sym in ${sym.denot.owner.showFullName}
875-
|signature: $sig
876-
|if this is reproducible, please report bug at https://github.com/lampepfl/dotty/issues
877-
""".trim, sym.sourcePos)
874+
report.error(
875+
em"""|compiler bug: created invalid generic signature for $sym in ${sym.denot.owner.showFullName}
876+
|signature: $sig
877+
|if this is reproducible, please report bug at https://github.com/lampepfl/dotty/issues
878+
""", sym.sourcePos)
878879
throw ex
879880
}
880881
}

compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ trait BCodeSkelBuilder extends BCodeHelpers {
748748

749749
if (params.size > MaximumJvmParameters) {
750750
// SI-7324
751-
report.error(s"Platform restriction: a parameter list's length cannot exceed $MaximumJvmParameters.", ctx.source.atSpan(methSymbol.span))
751+
report.error(em"Platform restriction: a parameter list's length cannot exceed $MaximumJvmParameters.", ctx.source.atSpan(methSymbol.span))
752752
return
753753
}
754754

@@ -800,9 +800,10 @@ trait BCodeSkelBuilder extends BCodeHelpers {
800800
val veryFirstProgramPoint = currProgramPoint()
801801

802802
if trimmedRhs == tpd.EmptyTree then
803-
report.error("Concrete method has no definition: " + dd + (
804-
if (ctx.settings.Ydebug.value) "(found: " + methSymbol.owner.info.decls.toList.mkString(", ") + ")"
805-
else ""),
803+
report.error(
804+
em"Concrete method has no definition: $dd${
805+
if (ctx.settings.Ydebug.value) "(found: " + methSymbol.owner.info.decls.toList.mkString(", ") + ")"
806+
else ""}",
806807
ctx.source.atSpan(NoSpan)
807808
)
808809
else

compiler/src/dotty/tools/backend/jvm/CoreBTypes.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ class CoreBTypes[BTFS <: BTypesFromSymbols[_ <: DottyBackendInterface]](val bTyp
134134

135135
private lazy val jliCallSiteRef : ClassBType = classBTypeFromSymbol(requiredClass[java.lang.invoke.CallSite])
136136
private lazy val jliLambdaMetafactoryRef : ClassBType = classBTypeFromSymbol(requiredClass[java.lang.invoke.LambdaMetafactory])
137-
private lazy val jliMethodHandleRef : ClassBType = classBTypeFromSymbol(requiredClass[java.lang.invoke.MethodHandle])
138-
private lazy val jliMethodHandlesLookupRef : ClassBType = classBTypeFromSymbol(requiredClass[java.lang.invoke.MethodHandles.Lookup])
137+
private lazy val jliMethodHandleRef : ClassBType = classBTypeFromSymbol(defn.MethodHandleClass)
138+
private lazy val jliMethodHandlesLookupRef : ClassBType = classBTypeFromSymbol(defn.MethodHandlesLookupClass)
139139
private lazy val jliMethodTypeRef : ClassBType = classBTypeFromSymbol(requiredClass[java.lang.invoke.MethodType])
140140
private lazy val jliStringConcatFactoryRef : ClassBType = classBTypeFromSymbol(requiredClass("java.lang.invoke.StringConcatFactory")) // since JDK 9
141141
private lazy val srLambdaDeserialize : ClassBType = classBTypeFromSymbol(requiredClass[scala.runtime.LambdaDeserialize])

compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import Contexts._
1414
import Types._
1515
import Symbols._
1616
import Phases._
17+
import Decorators.em
1718

1819
import dotty.tools.dotc.util.ReadOnlyMap
1920
import dotty.tools.dotc.report
@@ -71,7 +72,7 @@ class DottyBackendInterface(val outputDirectory: AbstractFile, val superCallsMap
7172
def _1: Type = field.tpe match {
7273
case JavaArrayType(elem) => elem
7374
case _ =>
74-
report.error(s"JavaSeqArray with type ${field.tpe} reached backend: $field", ctx.source.atSpan(field.span))
75+
report.error(em"JavaSeqArray with type ${field.tpe} reached backend: $field", ctx.source.atSpan(field.span))
7576
UnspecifiedErrorType
7677
}
7778
def _2: List[Tree] = field.elems

compiler/src/dotty/tools/backend/jvm/GenBCode.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import dotty.tools.dotc.sbt.ExtractDependencies
2121
import Contexts._
2222
import Phases._
2323
import Symbols._
24+
import Decorators.em
2425

2526
import java.io.DataOutputStream
2627
import java.nio.channels.ClosedByInterruptException
@@ -308,7 +309,7 @@ class GenBCodePipeline(val int: DottyBackendInterface, val primitives: DottyPrim
308309
getFileForClassfile(outF, cls.name, ".class")
309310
} catch {
310311
case e: FileConflictException =>
311-
report.error(s"error writing ${cls.name}: ${e.getMessage}")
312+
report.error(em"error writing ${cls.name}: ${e.getMessage}")
312313
null
313314
}
314315
} else null
@@ -608,11 +609,11 @@ class GenBCodePipeline(val int: DottyBackendInterface, val primitives: DottyPrim
608609
val method =
609610
s"${e.getClassName.replaceAll("/", ".")}.${e.getMethodName}"
610611
val msg =
611-
s"Generated bytecode for method '$method' is too large. Size: ${e.getCodeSize} bytes. Limit is 64KB"
612+
em"Generated bytecode for method '$method' is too large. Size: ${e.getCodeSize} bytes. Limit is 64KB"
612613
report.error(msg)
613614
case e: ClassTooLargeException =>
614615
val msg =
615-
s"Class '${e.getClassName.replaceAll("/", ".")}' is too large. Constant pool size: ${e.getConstantPoolCount}. Limit is 64K entries"
616+
em"Class '${e.getClassName.replaceAll("/", ".")}' is too large. Constant pool size: ${e.getConstantPoolCount}. Limit is 64K entries"
616617
report.error(msg)
617618

618619
}

0 commit comments

Comments
 (0)