Skip to content

Commit ce9739d

Browse files
committed
Change bootstrap compiler to use flexible types
1 parent e8fbff1 commit ce9739d

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

compiler/src/dotty/tools/dotc/core/JavaNullInterop.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import Flags.JavaDefined
66
import StdNames.nme
77
import Symbols.*
88
import Types.*
9+
import dotty.tools.dotc.reporting.*
10+
import dotty.tools.dotc.core.Decorators.i
911

1012
/** This module defines methods to interpret types of Java symbols, which are implicitly nullable in Java,
1113
* as Scala types, which are explicitly nullable.
@@ -51,7 +53,7 @@ object JavaNullInterop {
5153
*
5254
* But the selection can throw an NPE if the returned value is `null`.
5355
*/
54-
def nullifyMember(sym: Symbol, tp: Type, isEnumValueDef: Boolean)(using Context): Type = {
56+
def nullifyMember(sym: Symbol, tp: Type, isEnumValueDef: Boolean)(using Context): Type = trace(i"nullifyMember ${sym}, ${tp}"){
5557
assert(ctx.explicitNulls)
5658
assert(sym.is(JavaDefined), "can only nullify java-defined members")
5759

project/Build.scala

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ object Build {
9595
* Reference version should track the latest version pushed to Maven:
9696
* - In main branch it should be the last RC version
9797
* - In release branch it should be the last stable release
98-
*
99-
* Warning: Change of this variable needs to be consulted with `expectedTastyVersion`
98+
*
99+
* Warning: Change of this variable needs to be consulted with `expectedTastyVersion`
100100
*/
101101
val referenceVersion = "3.6.3-RC1"
102102

@@ -106,8 +106,8 @@ object Build {
106106
*
107107
* Should only be referred from `dottyVersion` or settings/tasks requiring simplified version string,
108108
* eg. `compatMode` or Windows native distribution version.
109-
*
110-
* Warning: Change of this variable might require updating `expectedTastyVersion`
109+
*
110+
* Warning: Change of this variable might require updating `expectedTastyVersion`
111111
*/
112112
val developedVersion = "3.6.4"
113113

@@ -119,13 +119,13 @@ object Build {
119119
* During final, stable release is set exactly to `developedVersion`.
120120
*/
121121
val baseVersion = s"$developedVersion-RC1"
122-
123-
/** The version of TASTY that should be emitted, checked in runtime test
124-
* For defails on how TASTY version should be set see related discussions:
122+
123+
/** The version of TASTY that should be emitted, checked in runtime test
124+
* For defails on how TASTY version should be set see related discussions:
125125
* - https://github.com/scala/scala3/issues/13447#issuecomment-912447107
126126
* - https://github.com/scala/scala3/issues/14306#issuecomment-1069333516
127127
* - https://github.com/scala/scala3/pull/19321
128-
*
128+
*
129129
* Simplified rules, given 3.$minor.$patch = $developedVersion
130130
* - Major version is always 28
131131
* - TASTY minor version:
@@ -1058,7 +1058,6 @@ object Build {
10581058
// compiler is updated.
10591059
// Then, the next step is to enable flexible types by default and reduce the use of
10601060
// `unsafeNulls`.
1061-
scalacOptions ++= Seq("-Yno-flexible-types"),
10621061
packageAll := {
10631062
(`scala3-compiler` / packageAll).value ++ Seq(
10641063
"scala3-compiler" -> (Compile / packageBin).value.getAbsolutePath,
@@ -2505,7 +2504,7 @@ object Build {
25052504
case Bootstrapped => commonBootstrappedSettings
25062505
})
25072506
}
2508-
2507+
25092508
/* Tests TASTy version invariants during NIGHLY, RC or Stable releases */
25102509
def checkReleasedTastyVersion(): Unit = {
25112510
lazy val (scalaMinor, scalaPatch, scalaIsRC) = baseVersion.split("\\.|-").take(4) match {
@@ -2518,19 +2517,19 @@ object Build {
25182517
case Array("28", minor, "experimental", _) => (minor.toInt, true)
25192518
case other => sys.error(s"Invalid TASTy version string: $expectedTastyVersion")
25202519
}
2521-
2520+
25222521
if(isNightly) {
25232522
assert(tastyIsExperimental, "TASTY needs to be experimental in nightly builds")
25242523
val expectedTastyMinor = if(scalaPatch == 0) scalaMinor else scalaMinor + 1
25252524
assert(tastyMinor == expectedTastyMinor, "Invalid TASTy minor version")
25262525
}
2527-
2526+
25282527
if(isRelease) {
25292528
assert(scalaMinor == tastyMinor, "Minor versions of TASTY vesion and Scala version should match in release builds")
25302529
if (scalaIsRC && scalaPatch == 0)
25312530
assert(tastyIsExperimental, "TASTy should be experimental when releasing a new minor version RC")
25322531
else
2533-
assert(!tastyIsExperimental, "Stable version cannot use experimental TASTY")
2532+
assert(!tastyIsExperimental, "Stable version cannot use experimental TASTY")
25342533
}
25352534
}
25362535
}

0 commit comments

Comments
 (0)