Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Scala 3.3.0 #263

Merged
merged 1 commit into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: olafurpg/setup-scala@v10
- name: Test Incompatibilities 3.0
run: sbt '++3.0.0; incompat-30 / test; ++2.13.6; incompat-30 / test'
- name: Test Incompatibilities 3.1
run: sbt 'incompat-31 / test'
- name: Test Incompatibilities
run: sbt '++3.3.0; incompat-3 / test; ++2.13.11; incompat-3 / test'
- name: Test Future Incompatibilities
run: sbt 'incompat-3-future / test'
tutorials:
name: Check Tutorials
runs-on: ubuntu-latest
Expand All @@ -26,8 +26,8 @@ jobs:
- uses: actions/checkout@v2
- uses: olafurpg/setup-scala@v10
- name: Sbt Migration Tutorial
run: sbt '++3.0.0; sbt-migration-tutorial / run; ++2.13.6; sbt-migration-tutorial / run'
run: sbt '++3.3.0; sbt-migration-tutorial / run; ++2.13.11; sbt-migration-tutorial / run'
- name: Macro Cross-Building
run: sbt '++3.0.0; macro-cross-building-example / test; ++2.13.6; macro-cross-building-example / test'
run: sbt '++3.3.0; macro-cross-building-example / test; ++2.13.11; macro-cross-building-example / test'
- name: Macro Mixing
run: sbt '++3.0.0; macro-mixing-example-test / test; ++2.13.6; macro-mixing-example-test / test'
run: sbt '++3.3.0; macro-mixing-example-test / test; ++2.13.11; macro-mixing-example-test / test'
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ lazy val website = project
publish / skip := true,
mdoc := (Compile / run).evaluated,
mdocVariables := Map(
"scala30" -> scala30,
"scala30Binary" -> scala30,
"scala3" -> scala3,
"scala3Binary" -> scala3,
"scala213" -> scala213,
"sbtDotty" -> sbtDotty,
"scala3Migrate" -> scala3Migrate,
Expand Down
6 changes: 3 additions & 3 deletions docs/tooling/scala-3-migrate-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The solution consists of 3 independent steps that are packaged in an sbt plugin:
Each of this step is an sbt command that will be described in details in the following sections.

> #### Requirements
> - Scala 2.13, preferred 2.13.5
> - Scala 2.13, preferred 2.13.11
> - sbt 1.4 or higher
> - **Disclaimer:** This tool cannot migrate libraries containing macros.
> - **Not implemented yet:**
Expand Down Expand Up @@ -55,7 +55,7 @@ lazy val main = project
.in(file("."))
.settings(
name := "main",
scalaVersion := "2.13.5",
scalaVersion := "2.13.11",
semanticdbEnabled := true,
scalacOptions ++= Seq("-explaintypes", "-Wunused"),
libraryDependencies ++= Seq(
Expand Down Expand Up @@ -341,7 +341,7 @@ Then the tool compiles one last time in Scala 3 with `-rewrite` scalacOption.

## What to do next ?
You can start again with another module `MODULE2`. If `MODULE2` depends on the last module migrated, you need
either to add `-Ytasty-reader` to `MODULE2` scalacOptions, or `reload` or `set MODULE-MIGRATED/scalaVersion := "2.13.5"`
either to add `-Ytasty-reader` to `MODULE2` scalacOptions, or `reload` or `set MODULE-MIGRATED/scalaVersion := "2.13.11"`

Once you're done, you can remove `scala3-migrate` from your plugins.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 0 additions & 11 deletions incompat-30/type-infer-1/README.md

This file was deleted.

11 changes: 0 additions & 11 deletions incompat-30/type-infer-1/src/main/scala-2.13/type-infer.scala

This file was deleted.

11 changes: 0 additions & 11 deletions incompat-30/type-infer-1/src/main/scala/type-infer.scala

This file was deleted.

14 changes: 0 additions & 14 deletions incompat-30/type-infer-7/README.md

This file was deleted.

16 changes: 0 additions & 16 deletions incompat-30/type-infer-7/src/main/scala-2.13/type-infer.scala

This file was deleted.

16 changes: 0 additions & 16 deletions incompat-30/type-infer-7/src/main/scala/type-infer.scala

This file was deleted.

129 changes: 63 additions & 66 deletions incompat.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ ThisBuild /scalafixScalaBinaryVersion := CrossVersion.binaryScalaVersion(scalaVe
List of all incompatibilities between Scala 2.13 and Scala 3.0

You can run:
- `++0.26.0; <incompat> / test` to validate the incompatibility as well as the Dotty rewrite if it has one
- `++3.3.0; <incompat> / test` to validate the incompatibility as well as the Dotty rewrite if it has one
- `++2.13.3; <incompat> / test` to cross-compile the proposed solution and validate the scalafix rule if it has one
where <incompat> can be a single incompatibility or `incompat30` for all incompatibilities
where <incompat> can be a single incompatibility or `incompat3` for all incompatibilities
*/
lazy val `incompat-30` = project.in(file("incompat-30"))
lazy val `incompat-3` = project.in(file("incompat-3"))
.configs(CompileBackward)
.aggregate(dotty30MigrationRewrites: _*)
.aggregate(dotty3MigrationRewrites: _*)
.aggregate(typeInferIncompats: _*)
.aggregate(otherIncompats: _*)

Expand All @@ -28,18 +28,18 @@ lazy val `incompat-30` = project.in(file("incompat-30"))
It only contains the already existing future-migration rewrites in Dotty

You can run:
- `++0.26.0; <incompat> / test` to validate the Dotty rewrite
where <incompat> can be a single incompatibility or `incompat31` for all incompatibilities
- `++3.3.0; <incompat> / test` to validate the Dotty rewrite
where <incompat> can be a single incompatibility or `incompat3Future` for all incompatibilities
*/
lazy val `incompat-31` = project.in(file("incompat-31"))
lazy val `incompat-3-future` = project.in(file("incompat-3-future"))
.configs(CompileBackward)
.aggregate(dotty31MigrationRewrites: _*)
.aggregate(dotty3FutureMigrationRewrites: _*)

/*
Dotty migration rewrites between 2.13 and 3.0
`dotc -source:3.0-migration -rewrite`
*/
lazy val dotty30MigrationRewrites = Seq[ProjectReference](
lazy val dotty3MigrationRewrites = Seq[ProjectReference](
keywords,
lambdaParams,
symbolLiterals,
Expand All @@ -51,50 +51,47 @@ lazy val dotty30MigrationRewrites = Seq[ProjectReference](
valueEtaExpansion
)

lazy val keywords = project.in(file("incompat-30/keywords")).dotty30MigrationRewriteSettings
lazy val keywords = project.in(file("incompat-3/keywords")).dotty3MigrationRewriteSettings
lazy val lambdaParams =
project.in(file("incompat-30/lambda-params"))
.dotty30MigrationRewriteSettings
project.in(file("incompat-3/lambda-params"))
.dotty3MigrationRewriteSettings
.settings(scalafixRewrite := true)

lazy val symbolLiterals = project.in(file("incompat-30/symbol-literals")).dotty30MigrationRewriteSettings
lazy val indentArgument = project.in(file("incompat-30/indent-argument")).dotty30MigrationRewriteSettings
lazy val doWhile = project.in(file("incompat-30/do-while")).dotty30MigrationRewriteSettings
lazy val symbolLiterals = project.in(file("incompat-3/symbol-literals")).dotty3MigrationRewriteSettings
lazy val indentArgument = project.in(file("incompat-3/indent-argument")).dotty3MigrationRewriteSettings
lazy val doWhile = project.in(file("incompat-3/do-while")).dotty3MigrationRewriteSettings
lazy val procedureSyntax =
project.in(file("incompat-30/procedure-syntax"))
.dotty30MigrationRewriteSettings
project.in(file("incompat-3/procedure-syntax"))
.dotty3MigrationRewriteSettings
.settings(scalafixRewrite := true)
lazy val autoApplication =
project.in(file("incompat-30/auto-application"))
.dotty30MigrationRewriteSettings
project.in(file("incompat-3/auto-application"))
.dotty3MigrationRewriteSettings
.settings(scalafixRewrite := true)
lazy val inheritanceShadowing = project.in(file("incompat-30/inheritance-shadowing")).dotty30MigrationRewriteSettings
lazy val inheritanceShadowing = project.in(file("incompat-3/inheritance-shadowing")).dotty3MigrationRewriteSettings
lazy val valueEtaExpansion =
project.in(file("incompat-30/value-eta-expansion"))
.dotty30MigrationRewriteSettings
project.in(file("incompat-3/value-eta-expansion"))
.dotty3MigrationRewriteSettings
// does not add enclosing parens like dotc does
// .settings(scalafixRewrite := true)

/*
Type inference incompatibilities
*/
lazy val typeInferIncompats = Seq[ProjectReference](
typeInfer1,
typeInfer3,
typeInfer4,
typeInfer5,
typeInfer7,
typeInfer9,
typeInfer10
typeInfer10,
)

lazy val typeInfer1 = project.in(file("incompat-30/type-infer-1")).incompat30Settings
lazy val typeInfer3 = project.in(file("incompat-30/type-infer-3")).incompat30Settings
lazy val typeInfer4 = project.in(file("incompat-30/type-infer-4")).incompat30Settings
lazy val typeInfer5 = project.in(file("incompat-30/type-infer-5")).incompat30Settings
lazy val typeInfer7 = project.in(file("incompat-30/type-infer-7")).incompat30Settings
lazy val typeInfer9 = project.in(file("incompat-30/type-infer-9")).incompat30Settings
lazy val typeInfer10 = project.in(file("incompat-30/type-infer-10")).incompat30Settings

lazy val typeInfer3 = project.in(file("incompat-3/type-infer-3")).incompat3Settings
lazy val typeInfer4 = project.in(file("incompat-3/type-infer-4")).incompat3Settings
lazy val typeInfer5 = project.in(file("incompat-3/type-infer-5")).incompat3Settings
lazy val typeInfer9 = project.in(file("incompat-3/type-infer-9")).incompat3Settings
lazy val typeInfer10 = project.in(file("incompat-3/type-infer-10")).incompat3Settings

/*
Other incompatibilities
Expand Down Expand Up @@ -125,53 +122,53 @@ lazy val otherIncompats = Seq[ProjectReference](
)

// Syntactic incompatibilities
lazy val anonymousTypeParam = project.in(file("incompat-30/anonymous-type-param")).incompat30Settings
lazy val indentation1 = project.in(file("incompat-30/indentation/indentation-1")).incompat30Settings
lazy val restrictedOperator = project.in(file("incompat-30/restricted-operator")).incompat30Settings
lazy val typeParamIdentifier = project.in(file("incompat-30/type-param-identifier")).incompat30Settings
lazy val anonymousTypeParam = project.in(file("incompat-3/anonymous-type-param")).incompat3Settings
lazy val indentation1 = project.in(file("incompat-3/indentation/indentation-1")).incompat3Settings
lazy val restrictedOperator = project.in(file("incompat-3/restricted-operator")).incompat3Settings
lazy val typeParamIdentifier = project.in(file("incompat-3/type-param-identifier")).incompat3Settings

// Changed or dropped features
lazy val abstractOverride = project.in(file("incompat-30/abstract-override")).incompat30Settings
lazy val any2stringaddConversion = project.in(file("incompat-30/any2stringadd-conversion")).incompat30Settings
lazy val byNameParamTypeInfer = project.in(file("incompat-30/by-name-param-type-infer")).incompat30Settings
lazy val variance = project.in(file("incompat-30/variance")).incompat30Settings
lazy val earlyInitializer = project.in(file("incompat-30/early-initializer")).incompat30Settings
lazy val existentialType = project.in(file("incompat-30/existential-type")).incompat30Settings
lazy val wildcardArgument = project.in(file("incompat-30/wildcard-argument")).incompat30Settings
lazy val explicitCallToUnapply = project.in(file("incompat-30/explicit-call-to-unapply")).incompat30Settings
lazy val reflectiveCall = project.in(file("incompat-30/reflective-call")).incompat30Settings
lazy val caseClassCompanion = project.in(file("incompat-30/case-class-companion")).incompat30Settings
lazy val patternMatch = project.in(file("incompat-30/pattern-match")).incompat30Settings
lazy val `bean-property` = project.in(file("incompat-30/bean-property")).incompat30Settings
lazy val `infer-return-type` = project.in(file("incompat-30/infer-return-type")).incompat30Settings
lazy val abstractOverride = project.in(file("incompat-3/abstract-override")).incompat3Settings
lazy val any2stringaddConversion = project.in(file("incompat-3/any2stringadd-conversion")).incompat3Settings
lazy val byNameParamTypeInfer = project.in(file("incompat-3/by-name-param-type-infer")).incompat3Settings
lazy val variance = project.in(file("incompat-3/variance")).incompat3Settings
lazy val earlyInitializer = project.in(file("incompat-3/early-initializer")).incompat3Settings
lazy val existentialType = project.in(file("incompat-3/existential-type")).incompat3Settings
lazy val wildcardArgument = project.in(file("incompat-3/wildcard-argument")).incompat3Settings
lazy val explicitCallToUnapply = project.in(file("incompat-3/explicit-call-to-unapply")).incompat3Settings
lazy val reflectiveCall = project.in(file("incompat-3/reflective-call")).incompat3Settings
lazy val caseClassCompanion = project.in(file("incompat-3/case-class-companion")).incompat3Settings
lazy val patternMatch = project.in(file("incompat-3/pattern-match")).incompat3Settings
lazy val `bean-property` = project.in(file("incompat-3/bean-property")).incompat3Settings
lazy val `infer-return-type` = project.in(file("incompat-3/infer-return-type")).incompat3Settings

// Contextual abstraction incompatibilities
lazy val ambiguousConversion =
project.in(file("incompat-30/ambiguous-conversion"))
.incompat30Settings
project.in(file("incompat-3/ambiguous-conversion"))
.incompat3Settings
.settings(scalacOptions += "-language:implicitConversions")
lazy val typeOfImplicitDef =
project.in(file("incompat-30/type-of-implicit-def"))
.incompat30Settings
project.in(file("incompat-3/type-of-implicit-def"))
.incompat3Settings
.settings(scalafixRewrite := true)
lazy val accessModifier = project.in(file("incompat-30/access-modifier")).incompat30Settings
lazy val viewBound = project.in(file("incompat-30/view-bound"))
.incompat30Settings
lazy val accessModifier = project.in(file("incompat-3/access-modifier")).incompat3Settings
lazy val viewBound = project.in(file("incompat-3/view-bound"))
.incompat3Settings
.settings(scalacOptions += "-deprecation")

// This one is a runtime incompatibility
// It compiles but the runtime behavior is different
// In this case Scala 3 throws an `AssertionError`
lazy val implicitView =
project.in(file("incompat-30/implicit-view"))
.runtimeIncompat30Settings
project.in(file("incompat-3/implicit-view"))
.runtimeIncompat3Settings
.settings(scalacOptions += "-language:implicitConversions")

/*
Dotty migration rewrites between 3.0 and 3.1
`dotc -source:future-migration -rewrite`
*/
lazy val dotty31MigrationRewrites = Seq[ProjectReference](
lazy val dotty3FutureMigrationRewrites = Seq[ProjectReference](
alphanumericInfix,
contextBoundArg,
etaExpansion,
Expand All @@ -183,15 +180,15 @@ lazy val dotty31MigrationRewrites = Seq[ProjectReference](
// This one is not a migration rewrite but a 3.1 deprecation rewrite
// `dotc -source:future -deprecation -rewrite`
lazy val alphanumericInfix =
project.in(file("incompat-31/alphanumeric-infix"))
.dotty31MigrationRewriteSettings
project.in(file("incompat-3-future/alphanumeric-infix"))
.dotty3FutureMigrationRewriteSettings
.settings(
scalacOptions -= "-source:future-migration",
scalacOptions ++= Seq("-source:future", "-deprecation")
)

lazy val contextBoundArg = project.in(file("incompat-31/context-bound-arg")).dotty31MigrationRewriteSettings
lazy val etaExpansion = project.in(file("incompat-31/eta-expansion")).dotty31MigrationRewriteSettings
lazy val implicitLambdaParam = project.in(file("incompat-31/implicit-lambda-param")).dotty31MigrationRewriteSettings
lazy val patternBinding = project.in(file("incompat-31/pattern-binding")).dotty31MigrationRewriteSettings
lazy val wildcard = new IncompatSettings(project.in(file("incompat-31/wildcard"))).dotty31MigrationRewriteSettings
lazy val contextBoundArg = project.in(file("incompat-3-future/context-bound-arg")).dotty3FutureMigrationRewriteSettings
lazy val etaExpansion = project.in(file("incompat-3-future/eta-expansion")).dotty3FutureMigrationRewriteSettings
lazy val implicitLambdaParam = project.in(file("incompat-3-future/implicit-lambda-param")).dotty3FutureMigrationRewriteSettings
lazy val patternBinding = project.in(file("incompat-3-future/pattern-binding")).dotty3FutureMigrationRewriteSettings
lazy val wildcard = new IncompatSettings(project.in(file("incompat-3-future/wildcard"))).dotty3FutureMigrationRewriteSettings
Loading
Loading