Skip to content

Commit 66a5306

Browse files
committed
Merge branch 'main' into export-diagnostics
2 parents 5186b62 + fd95c55 commit 66a5306

File tree

749 files changed

+41633
-5966
lines changed

Some content is hidden

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

749 files changed

+41633
-5966
lines changed

.github/ISSUE_TEMPLATE/feature.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
name: "\U0001F389 Suggest a feature"
3-
about: Please create a feature request here https://github.com/lampepfl/dotty-feature-requests
3+
about: Please create a feature request here https://github.com/lampepfl/dotty/discussions/new?category=feature-requests
44
title: ''
55
labels: ''
66
assignees: ''
77

88
---
99

10-
Please create a feature request here: [lampepfl/dotty-feature-requests](https://github.com/lampepfl/dotty-feature-requests).
10+
Please create a feature request in the [Dotty Discussions](https://github.com/lampepfl/dotty/discussions/new?category=feature-requests).

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ jobs:
134134

135135
- name: Cmd Tests
136136
run: |
137-
./project/scripts/sbt ";dist/pack; scala3-bootstrapped/compile; scala3-bootstrapped/test ;sbt-test/scripted scala2-compat/* ;stdlib-bootstrapped/test:run ;stdlib-bootstrapped-tasty-tests/test; scala3-compiler-bootstrapped/scala3CompilerCoursierTest:test"
137+
./project/scripts/sbt ";dist/pack; scala3-bootstrapped/compile; scala3-bootstrapped/test ;sbt-test/scripted scala2-compat/* ;stdlib-bootstrapped-tasty-tests/run ;stdlib-bootstrapped-tasty-tests/test; scala3-compiler-bootstrapped/scala3CompilerCoursierTest:test"
138138
./project/scripts/cmdTests
139139
./project/scripts/bootstrappedOnlyCmdTests
140140
@@ -488,7 +488,7 @@ jobs:
488488

489489
- name: Test
490490
run: |
491-
./project/scripts/sbt ";dist/pack ;scala3-bootstrapped/compile ;scala3-bootstrapped/test ;sbt-test/scripted scala2-compat/* ;stdlib-bootstrapped/test:run ;stdlib-bootstrapped-tasty-tests/test"
491+
./project/scripts/sbt ";dist/pack ;scala3-bootstrapped/compile ;scala3-bootstrapped/test ;sbt-test/scripted scala2-compat/* ;stdlib-bootstrapped-tasty-tests/run ;stdlib-bootstrapped-tasty-tests/test"
492492
./project/scripts/cmdTests
493493
./project/scripts/bootstrappedOnlyCmdTests
494494

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,7 @@ contributors.js
9595
content-contributors.css
9696
docs/_spec/_site/
9797
docs/_spec/.jekyll-metadata
98+
99+
# scaladoc related
100+
scaladoc/output/
101+

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
url = https://github.com/dotty-staging/fastparse
2222
[submodule "community-build/community-projects/stdLib213"]
2323
path = community-build/community-projects/stdLib213
24-
url = https://github.com/dotty-staging/scala
24+
url = https://github.com/dotty-staging/scala213
2525
[submodule "community-build/community-projects/sourcecode"]
2626
path = community-build/community-projects/sourcecode
2727
url = https://github.com/dotty-staging/sourcecode

MAINTENANCE.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ The issue supervisor is responsible for:
1616
- Attempting to reproduce the issue (or label “stat:cannot reproduce”)
1717
- Further minimizing the issue or asking the reporter of the issue to minimize it correctly (or label “stat:needs minimization”)
1818
- 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.
19+
- Identifying if a report is really a feature request and if so, converting it to
20+
a [feature request discussion](https://github.com/lampepfl/dotty/discussions/categories/feature-requests).
21+
- Keeping an eye on new
22+
[discussions](https://github.com/lampepfl/dotty/discussions), making sure they
23+
don't go unanswered and also correctly labeling new feature requests.
1924

2025
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.
2126

@@ -32,7 +37,6 @@ The issue supervisor schedule is maintained in the [Issue Supervisor Statistics
3237
An issue supervisor needs to have all the accesses and privileges required to get their job done. This might include:
3338

3439
- Admin rights in lampepfl/dotty repository
35-
- Admin rights in lampepfl/dotty-feature-requests repository
3640
- Permission to create new repositories in lampepfl organization (needed to fork repositories for the community build)
3741
- Access to the LAMP slack to be able to ask for help with the infrastructure, triaging and such
3842

NOTICE.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,19 @@ major authors were omitted by oversight.
8989
details.
9090

9191
* dotty.tools.dotc.coverage: Coverage instrumentation utilities have been
92-
adapted from the scoverage plugin for scala 2 [5], which is under the
92+
adapted from the scoverage plugin for scala 2 [4], which is under the
9393
Apache 2.0 license.
9494

95+
* dooty.tools.pc: Presentation compiler implementation adapted from
96+
scalameta/metals [5] mtags module, which is under the Apache 2.0 license.
97+
9598
* The Dotty codebase contains parts which are derived from
96-
the ScalaPB protobuf library [4], which is under the Apache 2.0 license.
99+
the ScalaPB protobuf library [6], which is under the Apache 2.0 license.
97100

98101

99102
[1] https://github.com/scala/scala
100103
[2] https://github.com/adriaanm/scala/tree/sbt-api-consolidate/src/compiler/scala/tools/sbt
101104
[3] https://github.com/sbt/sbt/tree/0.13/compile/interface/src/main/scala/xsbt
102-
[4] https://github.com/lampepfl/dotty/pull/5783/files
103-
[5] https://github.com/scoverage/scalac-scoverage-plugin
105+
[4] https://github.com/scoverage/scalac-scoverage-plugin
106+
[5] https://github.com/scalameta/metals
107+
[6] https://github.com/lampepfl/dotty/pull/5783/files

build.sbt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ val `scala3-bench` = Build.`scala3-bench`
1515
val `scala3-bench-bootstrapped` = Build.`scala3-bench-bootstrapped`
1616
val `scala3-bench-micro` = Build.`scala3-bench-micro`
1717
val `stdlib-bootstrapped` = Build.`stdlib-bootstrapped`
18+
val `stdlib-bootstrapped-tasty` = Build.`stdlib-bootstrapped-tasty`
1819
val `stdlib-bootstrapped-tasty-tests` = Build.`stdlib-bootstrapped-tasty-tests`
1920
val `tasty-core` = Build.`tasty-core`
2021
val `tasty-core-bootstrapped` = Build.`tasty-core-bootstrapped`
@@ -28,6 +29,8 @@ val `scala3-bench-run` = Build.`scala3-bench-run`
2829
val dist = Build.dist
2930
val `community-build` = Build.`community-build`
3031
val `sbt-community-build` = Build.`sbt-community-build`
32+
val `scala3-presentation-compiler` = Build.`scala3-presentation-compiler`
33+
val `scala3-presentation-compiler-bootstrapped` = Build.`scala3-presentation-compiler-bootstrapped`
3134

3235
val sjsSandbox = Build.sjsSandbox
3336
val sjsJUnitTests = Build.sjsJUnitTests

community-build/README.md

Lines changed: 3 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,5 @@
11
# Scala 3 Community Build
22

3-
This project contains tests to build and test a corpus of open sources Scala
4-
projects against the latest version of Scala 3.
5-
6-
## Running it locally
7-
8-
To run the community build on a local machine, first fetch all the git
9-
submodules with `git submodule update --init` and run `sbt community-build/test`
10-
from the root of the dotty repo.
11-
12-
To run a single project, you can use the usual syntax for running a single JUnit
13-
test, for example `community-build/testOnly -- *shapeless`
14-
15-
In CI the community build is split up into 3 seperate groups: A, B, and C. To
16-
run one specific build you can also use the same JUnit syntax as above targeting
17-
the individual group. For example:
18-
19-
```
20-
sbt "community-build/testOnly dotty.communitybuild.CommunityBuildTestA"
21-
```
22-
23-
## Adding your project
24-
25-
The community build is able to handle both Mill and sbt projects. To add your
26-
project to the community build you can follow these steps:
27-
28-
1. Ensure your project is compiling with Scala 3. If you need help make sure to
29-
check out the [Scala 3 Migration
30-
Guide](https://docs.scala-lang.org/scala3/guides/migration/compatibility-intro.html).
31-
You can see the submodules in
32-
[community-projects](https://github.com/lampepfl/dotty/tree/main/community-build/community-projects/)
33-
for examples of projects that compile with Scala 3.
34-
35-
2. Open a PR against this repo that:
36-
- Adds your project as a new git submodule
37-
- `git submodule add https://github.com/dotty-staging/XYZ.git community-build/community-projects/XYZ`
38-
- Add the project to [projects.scala](https://github.com/lampepfl/dotty/blob/main/community-build/src/scala/dotty/communitybuild/projects.scala)
39-
- Adds a test in [CommunityBuildTest.scala](https://github.com/lampepfl/dotty/blob/main/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala)
40-
41-
3. Once the CI is green, someone from the Dotty team will fork your repo and add
42-
it to [dotty-staging](https://github.com/dotty-staging). This enables us to
43-
make changes to your fork if necessary to keep the community build running
44-
smoothly.
45-
46-
4. Once the fork is created, please update your PR to point to this new fork
47-
instead of your repo.
48-
49-
## Updating a project
50-
51-
The projects included in the community build are all forked and located in
52-
[dotty-staging](https://github.com/dotty-staging). When something needs to be
53-
bumped the process is as follows:
54-
55-
1. Fork the dotty staging repo and sync it with the upstream project.
56-
57-
2. Once you've verified that the tests are all passing you can then either
58-
request in your PR that the dotty-staging fork be synced or in the
59-
[scala-contributors](https://discord.com/channels/632150470000902164/632628489719382036)
60-
discord channel.
61-
62-
### Some helpful tips
63-
64-
- If you're unfamiliar with Git Submodules you can find a nice guide to get
65-
familiar with them [here](https://git-scm.com/book/en/v2/Git-Tools-Submodules).
66-
- Keep in mind that many projects are interrelated. So when you bump one that
67-
change may cascade through multiple different projects causing you to have
68-
to bump multiple. Plan accordingly and at times it's best to pin it to a
69-
stable release version, especially if it's a root library that many others
70-
in the community build are relying on.
71-
72-
## Looking for the "unmanaged" Scala 3 community build?
73-
74-
You can find this [here](https://github.com/VirtusLab/community-build3).
75-
3+
For information on the community build check out the [Community Build section of
4+
the Contributing
5+
Docs](https://dotty.epfl.ch/docs/contributing/community-build.html).
Submodule specs2 updated 44 files
Submodule stdLib213 updated 653 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.8.2",
143+
"-sbt-version", "1.9.0",
144144
"-Dsbt.supershell=false",
145145
s"-Ddotty.communitybuild.dir=$communitybuildDir",
146146
s"--addPluginSbtFile=$sbtPluginFilePath"

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ class CommunityBuildTestC:
9494
@Test def shapeless = projects.shapeless.run()
9595
@Test def sourcecode = projects.sourcecode.run()
9696
@Test def specs2 = projects.specs2.run()
97+
9798
@Test def stdLib213 = projects.stdLib213.run()
9899
@Test def ujson = projects.ujson.run()
99100
@Test def upickle = projects.upickle.run()

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ class PostProcessor(val frontendAccess: PostProcessorFrontendAccess, val bTypes:
2323

2424
def postProcessAndSendToDisk(generatedDefs: GeneratedDefs): Unit = {
2525
val GeneratedDefs(classes, tasty) = generatedDefs
26+
if !ctx.settings.YoutputOnlyTasty.value then
27+
postProcessClassesAndSendToDisk(classes)
28+
postProcessTastyAndSendToDisk(tasty)
29+
}
30+
31+
private def postProcessClassesAndSendToDisk(classes: List[GeneratedClass]): Unit = {
2632
for (GeneratedClass(classNode, sourceFile, isArtifact, onFileCreated) <- classes) {
2733
val bytes =
2834
try
@@ -46,8 +52,10 @@ class PostProcessor(val frontendAccess: PostProcessorFrontendAccess, val bTypes:
4652
if clsFile != null then onFileCreated(clsFile)
4753
}
4854
}
55+
}
4956

50-
for (GeneratedTasty(classNode, binaryGen) <- tasty){
57+
private def postProcessTastyAndSendToDisk(tasty: List[GeneratedTasty]): Unit = {
58+
for (GeneratedTasty(classNode, binaryGen) <- tasty) {
5159
classfileWriter.writeTasty(classNode.name.nn, binaryGen())
5260
}
5361
}

compiler/src/dotty/tools/dotc/CompilationUnit.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import core._
55
import Contexts._
66
import SymDenotations.ClassDenotation
77
import Symbols._
8+
import Comments.Comment
89
import util.{FreshNameCreator, SourceFile, NoSource}
910
import util.Spans.Span
1011
import ast.{tpd, untpd}
@@ -69,6 +70,9 @@ class CompilationUnit protected (val source: SourceFile) {
6970
/** Can this compilation unit be suspended */
7071
def isSuspendable: Boolean = true
7172

73+
/** List of all comments present in this compilation unit */
74+
var comments: List[Comment] = Nil
75+
7276
/** Suspends the compilation unit by thowing a SuspendException
7377
* and recording the suspended compilation unit
7478
*/

compiler/src/dotty/tools/dotc/Run.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ class Run(comp: Compiler, ictx: Context) extends ImplicitRunInfo with Constraint
308308

309309
private def printTree(last: PrintedTree)(using Context): PrintedTree = {
310310
val unit = ctx.compilationUnit
311-
val fusedPhase = ctx.phase.prevMega
311+
val fusedPhase = ctx.phase.prev.megaPhase
312312
val echoHeader = f"[[syntax trees at end of $fusedPhase%25s]] // ${unit.source}"
313313
val tree = if ctx.isAfterTyper then unit.tpdTree else unit.untpdTree
314314
val treeString = fusedPhase.show(tree)

0 commit comments

Comments
 (0)