Skip to content

Commit 544ff54

Browse files
committed
Merge branch 'main' into report-all-warns-werror
2 parents dedd819 + 772be76 commit 544ff54

File tree

960 files changed

+48435
-5551
lines changed

Some content is hidden

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

960 files changed

+48435
-5551
lines changed

.github/workflows/ci.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ jobs:
142142
run: |
143143
./project/scripts/sbt ";sjsSandbox/run ;sjsSandbox/test ;sjsJUnitTests/test ;set sjsJUnitTests/scalaJSLinkerConfig ~= switchToESModules ;sjsJUnitTests/test ;sjsCompilerTests/test"
144144
145+
- name: Test with Scala 2 library TASTy
146+
run: ./project/scripts/sbt ";set ThisBuild/Build.useScala2LibraryTasty := true ;scala3-bootstrapped/testCompilation i5; scala3-bootstrapped/testCompilation tests/run/typelevel-peano.scala" # only test a subset of test to avoid doubling the CI execution time
147+
145148
test_windows_fast:
146149
runs-on: [self-hosted, Windows]
147150
if: "(

.github/workflows/lts-backport.yaml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
name: Add to backporting project
22

33
on:
4-
pull_request:
5-
types:
6-
- closed
4+
push:
5+
branches:
6+
- main
77

88
jobs:
99
add-to-backporting-project:
10-
if: "github.event.pull_request.merged == true
11-
&& github.event.pull_request.base.ref == 'main'
12-
&& !contains(github.event.pull_request.body, '[Next only]')"
10+
if: "!contains(github.event.push.head_commit.message, '[Next only]')"
1311
runs-on: ubuntu-latest
1412

1513
steps:
@@ -18,7 +16,7 @@ jobs:
1816
fetch-depth: 0
1917
- uses: coursier/cache-action@v6
2018
- uses: VirtusLab/scala-cli-setup@v1.0.5
21-
- run: scala-cli ./project/scripts/addToBackportingProject.scala -- ${{ github.event.pull_request.number }}
19+
- run: scala-cli ./project/scripts/addToBackportingProject.scala -- ${{ github.sha }}
2220
env:
23-
GRAPHQL_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
GRAPHQL_API_TOKEN: ${{ secrets.GRAPHQL_API_TOKEN }}
2422

Submodule munit updated 1 file

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def exec(projectDir: Path, binary: String, arguments: Seq[String], environment:
2525
import scala.jdk.CollectionConverters._
2626
val command = binary +: arguments
2727
log(command.mkString(" "))
28-
val builder = new ProcessBuilder(command: _*).directory(projectDir.toFile).inheritIO()
28+
val builder = new ProcessBuilder(command*).directory(projectDir.toFile).inheritIO()
2929
builder.environment.putAll(environment.asJava)
3030
val process = builder.start()
3131
val exitCode = process.waitFor()
@@ -362,7 +362,7 @@ object projects:
362362
project = "shapeless-3",
363363
sbtTestCommand = "testJVM; testJS",
364364
sbtDocCommand = forceDoc("typeable", "deriving"),
365-
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Ysafe-init"), // due to -Xfatal-warnings
365+
scalacOptions = "-source" :: "3.3" :: SbtCommunityProject.scalacOptions.filter(_ != "-Ysafe-init"), // due to -Xfatal-warnings
366366
)
367367

368368
lazy val xmlInterpolator = SbtCommunityProject(
@@ -404,7 +404,7 @@ object projects:
404404
project = "zio",
405405
sbtTestCommand = "testJVMDotty",
406406
sbtDocCommand = forceDoc("coreJVM"),
407-
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Xcheck-macros"),
407+
scalacOptions = "-source" :: "3.3" :: SbtCommunityProject.scalacOptions.filter(_ != "-Xcheck-macros"),
408408
dependencies =List(izumiReflect)
409409
)
410410

compiler/src/dotty/tools/MainGenericRunner.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ object MainGenericRunner {
195195

196196
case ExecuteMode.PossibleRun =>
197197
val newClasspath = (settings.classPath :+ ".").flatMap(_.split(classpathSeparator).filter(_.nonEmpty)).map(File(_).toURI.toURL)
198-
import dotty.tools.runner.RichClassLoader._
198+
import dotty.tools.runner.RichClassLoader.*
199199
val newClassLoader = ScalaClassLoader.fromURLsParallelCapable(newClasspath)
200200
val targetToRun = settings.possibleEntryPaths.to(LazyList).find { entryPath =>
201201
newClassLoader.tryToLoadClass(entryPath).orElse {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ package jvm
44

55
import scala.language.unsafeNulls
66

7-
import dotty.tools.dotc.core.Flags._
8-
import dotty.tools.dotc.core.Symbols._
7+
import dotty.tools.dotc.core.Flags.*
8+
import dotty.tools.dotc.core.Symbols.*
99
import dotty.tools.dotc.report
1010

1111
/**

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

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ import BCodeHelpers.InvokeStyle
1313

1414
import dotty.tools.dotc.ast.tpd
1515
import dotty.tools.dotc.CompilationUnit
16-
import dotty.tools.dotc.core.Constants._
16+
import dotty.tools.dotc.core.Constants.*
1717
import dotty.tools.dotc.core.Flags.{Label => LabelFlag, _}
18-
import dotty.tools.dotc.core.Types._
18+
import dotty.tools.dotc.core.Types.*
1919
import dotty.tools.dotc.core.StdNames.{nme, str}
20-
import dotty.tools.dotc.core.Symbols._
20+
import dotty.tools.dotc.core.Symbols.*
2121
import dotty.tools.dotc.transform.Erasure
22-
import dotty.tools.dotc.transform.SymUtils._
23-
import dotty.tools.dotc.util.Spans._
24-
import dotty.tools.dotc.core.Contexts._
25-
import dotty.tools.dotc.core.Phases._
22+
import dotty.tools.dotc.transform.SymUtils.*
23+
import dotty.tools.dotc.util.Spans.*
24+
import dotty.tools.dotc.core.Contexts.*
25+
import dotty.tools.dotc.core.Phases.*
2626
import dotty.tools.dotc.core.Decorators.em
2727
import dotty.tools.dotc.report
2828

@@ -33,13 +33,13 @@ import dotty.tools.dotc.report
3333
*
3434
*/
3535
trait BCodeBodyBuilder extends BCodeSkelBuilder {
36-
// import global._
37-
// import definitions._
38-
import tpd._
36+
// import global.*
37+
// import definitions.*
38+
import tpd.*
3939
import int.{_, given}
4040
import DottyBackendInterface.symExtensions
41-
import bTypes._
42-
import coreBTypes._
41+
import bTypes.*
42+
import coreBTypes.*
4343

4444
protected val primitives: DottyPrimitives
4545

@@ -126,7 +126,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
126126
assert(resKind.isNumericType || (resKind == BOOL),
127127
s"$resKind is not a numeric or boolean type [operation: ${fun.symbol}]")
128128

129-
import ScalaPrimitivesOps._
129+
import ScalaPrimitivesOps.*
130130

131131
args match {
132132
// unary operation
@@ -179,7 +179,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
179179
def genArrayOp(tree: Tree, code: Int, expectedType: BType): BType = tree match{
180180

181181
case Apply(DesugaredSelect(arrayObj, _), args) =>
182-
import ScalaPrimitivesOps._
182+
import ScalaPrimitivesOps.*
183183
val k = tpeTK(arrayObj)
184184
genLoad(arrayObj, k)
185185
val elementType = typeOfArrayOp.getOrElse[bTypes.BType](code, abort(s"Unknown operation on arrays: $tree code: $code"))
@@ -262,7 +262,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
262262

263263
val code = primitives.getPrimitive(tree, receiver.tpe)
264264

265-
import ScalaPrimitivesOps._
265+
import ScalaPrimitivesOps.*
266266

267267
if (isArithmeticOp(code)) genArithmeticOp(tree, code)
268268
else if (code == CONCAT) genStringConcat(tree)
@@ -1267,7 +1267,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
12671267

12681268
/* Generate coercion denoted by "code" */
12691269
def genCoercion(code: Int): Unit = {
1270-
import ScalaPrimitivesOps._
1270+
import ScalaPrimitivesOps.*
12711271
(code: @switch) match {
12721272
case B2B | S2S | C2C | I2I | L2L | F2F | D2D => ()
12731273
case _ =>
@@ -1443,7 +1443,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
14431443
val mdescr = bmType.descriptor
14441444

14451445
val isInterface = isEmittedInterface(receiverClass)
1446-
import InvokeStyle._
1446+
import InvokeStyle.*
14471447
if (style == Super) {
14481448
if (isInterface && !method.is(JavaDefined)) {
14491449
val args = new Array[BType](bmType.argumentTypes.length + 1)
@@ -1497,7 +1497,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
14971497
} else if (tk.isRef) { // REFERENCE(_) | ARRAY(_)
14981498
bc.emitIF_ACMP(op, success)
14991499
} else {
1500-
import Primitives._
1500+
import Primitives.*
15011501
def useCmpG = if (negated) op == GT || op == GE else op == LT || op == LE
15021502
(tk: @unchecked) match {
15031503
case LONG => emit(asm.Opcodes.LCMP)
@@ -1512,7 +1512,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
15121512

15131513
/* Emits code to compare (and consume) stack-top and zero using the 'op' operator */
15141514
private def genCZJUMP(success: asm.Label, failure: asm.Label, op: TestOp, tk: BType, targetIfNoJump: asm.Label, negated: Boolean = false): Unit = {
1515-
import Primitives._
1515+
import Primitives.*
15161516
if (targetIfNoJump == success) genCZJUMP(failure, success, op.negate(), tk, targetIfNoJump, negated = !negated)
15171517
else {
15181518
if (tk.isIntSizedType) { // BOOL, BYTE, CHAR, SHORT, or INT

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

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,25 @@ import scala.tools.asm
99
import scala.tools.asm.AnnotationVisitor
1010
import scala.tools.asm.ClassWriter
1111
import scala.collection.mutable
12+
import scala.compiletime.uninitialized
1213

1314
import dotty.tools.dotc.CompilationUnit
1415
import dotty.tools.dotc.ast.tpd
1516
import dotty.tools.dotc.ast.Trees
16-
import dotty.tools.dotc.core.Annotations._
17-
import dotty.tools.dotc.core.Constants._
18-
import dotty.tools.dotc.core.Contexts._
19-
import dotty.tools.dotc.core.Phases._
20-
import dotty.tools.dotc.core.Decorators._
21-
import dotty.tools.dotc.core.Flags._
17+
import dotty.tools.dotc.core.Annotations.*
18+
import dotty.tools.dotc.core.Constants.*
19+
import dotty.tools.dotc.core.Contexts.*
20+
import dotty.tools.dotc.core.Phases.*
21+
import dotty.tools.dotc.core.Decorators.*
22+
import dotty.tools.dotc.core.Flags.*
2223
import dotty.tools.dotc.core.Names.Name
2324
import dotty.tools.dotc.core.NameKinds.ExpandedName
2425
import dotty.tools.dotc.core.Signature
25-
import dotty.tools.dotc.core.StdNames._
26+
import dotty.tools.dotc.core.StdNames.*
2627
import dotty.tools.dotc.core.NameKinds
27-
import dotty.tools.dotc.core.Symbols._
28+
import dotty.tools.dotc.core.Symbols.*
2829
import dotty.tools.dotc.core.Types
29-
import dotty.tools.dotc.core.Types._
30+
import dotty.tools.dotc.core.Types.*
3031
import dotty.tools.dotc.core.TypeErasure
3132
import dotty.tools.dotc.transform.GenericSignatures
3233
import dotty.tools.dotc.transform.ElimErasedValueType
@@ -44,12 +45,12 @@ import dotty.tools.backend.jvm.DottyBackendInterface.symExtensions
4445
*/
4546
trait BCodeHelpers extends BCodeIdiomatic {
4647
// for some reason singleton types aren't allowed in constructor calls. will need several casts in code to enforce
47-
//import global._
48-
import bTypes._
49-
import tpd._
50-
import coreBTypes._
48+
//import global.*
49+
import bTypes.*
50+
import tpd.*
51+
import coreBTypes.*
5152
import int.{_, given}
52-
import DottyBackendInterface._
53+
import DottyBackendInterface.*
5354

5455
// We need to access GenBCode phase to get access to post-processor components.
5556
// At this point it should always be initialized already.
@@ -576,7 +577,7 @@ trait BCodeHelpers extends BCodeIdiomatic {
576577
/* builder of mirror classes */
577578
class JMirrorBuilder extends JCommonBuilder {
578579

579-
private var cunit: CompilationUnit = _
580+
private var cunit: CompilationUnit = uninitialized
580581
def getCurrentCUnit(): CompilationUnit = cunit;
581582

582583
/* Generate a mirror class for a top-level module. A mirror class is a class
@@ -700,10 +701,10 @@ trait BCodeHelpers extends BCodeIdiomatic {
700701
* classes.
701702
*/
702703
private def typeToTypeKind(tp: Type)(ct: BCodeHelpers)(storage: ct.BCInnerClassGen): ct.bTypes.BType = {
703-
import ct.bTypes._
704+
import ct.bTypes.*
704705
val defn = ctx.definitions
705-
import coreBTypes._
706-
import Types._
706+
import coreBTypes.*
707+
import Types.*
707708
/**
708709
* Primitive types are represented as TypeRefs to the class symbol of, for example, scala.Int.
709710
* The `primitiveTypeMap` maps those class symbols to the corresponding PrimitiveBType.
@@ -851,7 +852,7 @@ trait BCodeHelpers extends BCodeIdiomatic {
851852
object BCodeHelpers {
852853

853854
class InvokeStyle(val style: Int) extends AnyVal {
854-
import InvokeStyle._
855+
import InvokeStyle.*
855856
def isVirtual: Boolean = this == Virtual
856857
def isStatic : Boolean = this == Static
857858
def isSpecial: Boolean = this == Special

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ trait BCodeIdiomatic {
2222
val bTypes: BTypesFromSymbols[int.type]
2323

2424
import int.{_, given}
25-
import bTypes._
26-
import coreBTypes._
25+
import bTypes.*
26+
import coreBTypes.*
2727

2828

2929
lazy val JavaStringBuilderClassName = jlStringBuilderRef.internalName
@@ -617,7 +617,7 @@ trait BCodeIdiomatic {
617617
/* Constant-valued val-members of JCodeMethodN at the companion object, so as to avoid re-initializing them multiple times. */
618618
object JCodeMethodN {
619619

620-
import asm.Opcodes._
620+
import asm.Opcodes.*
621621

622622
// ---------------- conversions ----------------
623623

@@ -651,7 +651,7 @@ trait BCodeIdiomatic {
651651
* can-multi-thread
652652
*/
653653
final def coercionFrom(code: Int): BType = {
654-
import ScalaPrimitivesOps._
654+
import ScalaPrimitivesOps.*
655655
(code: @switch) match {
656656
case B2B | B2C | B2S | B2I | B2L | B2F | B2D => BYTE
657657
case S2B | S2S | S2C | S2I | S2L | S2F | S2D => SHORT
@@ -668,7 +668,7 @@ trait BCodeIdiomatic {
668668
* can-multi-thread
669669
*/
670670
final def coercionTo(code: Int): BType = {
671-
import ScalaPrimitivesOps._
671+
import ScalaPrimitivesOps.*
672672
(code: @switch) match {
673673
case B2B | C2B | S2B | I2B | L2B | F2B | D2B => BYTE
674674
case B2C | C2C | S2C | I2C | L2C | F2C | D2C => CHAR

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ import dotty.tools.dotc.transform.SymUtils.*
3131
trait BCodeSkelBuilder extends BCodeHelpers {
3232
import int.{_, given}
3333
import DottyBackendInterface.{symExtensions, _}
34-
import tpd._
35-
import bTypes._
36-
import coreBTypes._
37-
import bCodeAsmCommon._
34+
import tpd.*
35+
import bTypes.*
36+
import coreBTypes.*
37+
import bCodeAsmCommon.*
3838

3939
lazy val NativeAttr: Symbol = requiredClass[scala.native]
4040

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import scala.tools.asm
99

1010
import dotty.tools.dotc.CompilationUnit
1111
import dotty.tools.dotc.core.StdNames.nme
12-
import dotty.tools.dotc.core.Symbols._
12+
import dotty.tools.dotc.core.Symbols.*
1313
import dotty.tools.dotc.ast.tpd
1414

1515
/*
@@ -20,9 +20,9 @@ import dotty.tools.dotc.ast.tpd
2020
*/
2121
trait BCodeSyncAndTry extends BCodeBodyBuilder {
2222
import int.given
23-
import tpd._
24-
import bTypes._
25-
import coreBTypes._
23+
import tpd.*
24+
import bTypes.*
25+
import coreBTypes.*
2626
/*
2727
* Functionality to lower `synchronized` and `try` expressions.
2828
*/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ abstract class BTypes { self =>
3939
def classBTypeFromInternalName(internalName: String) = classBTypeFromInternalNameMap(internalName)
4040

4141
val coreBTypes: CoreBTypes { val bTypes: self.type}
42-
import coreBTypes._
42+
import coreBTypes.*
4343

4444
/**
4545
* A BType is either a primitve type, a ClassBType, an ArrayBType of one of these, or a MethodType

0 commit comments

Comments
 (0)