Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1663038

Browse files
committed
Rename YnullifyTasty to YflexifyTasty
1 parent 57235ef commit 1663038

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

‎compiler/src/dotty/tools/dotc/config/ScalaSettings.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ private sealed trait YSettings:
455455
val YnoKindPolymorphism: Setting[Boolean] = BooleanSetting(ForkSetting, "Yno-kind-polymorphism", "Disable kind polymorphism. (This flag has no effect)", deprecation = Deprecation.removed())
456456
val YexplicitNulls: Setting[Boolean] = BooleanSetting(ForkSetting, "Yexplicit-nulls", "Make reference types non-nullable. Nullable types can be expressed with unions: e.g. String|Null.")
457457
val YnoFlexibleTypes: Setting[Boolean] = BooleanSetting(ForkSetting, "Yno-flexible-types", "Disable turning nullable Java return types and parameter types into flexible types, which behave like abstract types with a nullable lower bound and non-nullable upper bound.")
458-
val YnullifyTasty: Setting[Boolean] = BooleanSetting(ForkSetting, "Ynullify-tasty", "Apply nullification to Scala code compiled without -Yexplicit-nulls, when reading from tasty.")
458+
val YflexifyTasty: Setting[Boolean] = BooleanSetting(ForkSetting, "Yflexify-tasty", "Apply flexification to Scala code compiled without -Yexplicit-nulls, when reading from tasty.")
459459
val YsafeInitGlobal: Setting[Boolean] = BooleanSetting(ForkSetting, "Ysafe-init-global", "Check safe initialization of global objects.")
460460
val YrequireTargetName: Setting[Boolean] = BooleanSetting(ForkSetting, "Yrequire-targetName", "Warn if an operator is defined without a @targetName annotation.")
461461
val YrecheckTest: Setting[Boolean] = BooleanSetting(ForkSetting, "Yrecheck-test", "Run basic rechecking (internal test only).")

‎compiler/src/dotty/tools/dotc/core/Contexts.scala‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,8 @@ object Contexts {
480480
/** Is the flexible types option set? */
481481
def flexibleTypes: Boolean = base.settings.YexplicitNulls.value && !base.settings.YnoFlexibleTypes.value
482482

483-
def nullifyTasty: Boolean = base.settings.YexplicitNulls.value && base.settings.YnullifyTasty.value
483+
/** Is the flexify tasty option set? */
484+
def flexifyTasty: Boolean = base.settings.YexplicitNulls.value && base.settings.YflexifyTasty.value
484485

485486
/** Is the best-effort option set? */
486487
def isBestEffort: Boolean = base.settings.YbestEffort.value

‎compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -921,10 +921,10 @@ class TreeUnpickler(reader: TastyReader,
921921

922922
def ta = ctx.typeAssigner
923923

924-
// If explicit nulls and `YnullifyTasty` is enabled, and the source file did not have explicit
924+
// If explicit nulls and `Yflexify-tasty` is enabled, and the source file did not have explicit
925925
// nulls enabled, nullify the member to allow for compatibility.
926926
def nullify(sym: Symbol) =
927-
if (ctx.nullifyTasty && !explicitNulls) then
927+
if (ctx.flexifyTasty && !explicitNulls) then
928928
sym.info = ImplicitNullInterop.nullifyMember(sym, sym.info, sym.is(Enum))
929929

930930
val name = readName()

‎compiler/test/dotty/tools/dotc/CompilationTests.scala‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ class CompilationTests {
217217
locally {
218218
val unsafeFile = compileFile("tests/explicit-nulls/flexible-unpickle/neg/Unsafe_1.scala", explicitNullsOptions without "-Yexplicit-nulls")
219219
val flexibleFile = compileFile("tests/explicit-nulls/flexible-unpickle/neg/Flexible_2.scala",
220-
explicitNullsOptions.and("-Ynullify-tasty").withClasspath(defaultOutputDir + testGroup + "/Unsafe_1/neg/Unsafe_1"))
220+
explicitNullsOptions.and("-Yflexify-tasty").withClasspath(defaultOutputDir + testGroup + "/Unsafe_1/neg/Unsafe_1"))
221221

222222
flexibleFile.keepOutput.checkExpectedErrors()
223223

@@ -238,7 +238,7 @@ class CompilationTests {
238238
val tests = List(
239239
compileFile("tests/explicit-nulls/flexible-unpickle/pos/Unsafe_1.scala", explicitNullsOptions without "-Yexplicit-nulls"),
240240
compileFile("tests/explicit-nulls/flexible-unpickle/pos/Flexible_2.scala",
241-
explicitNullsOptions.and("-Ynullify-tasty").withClasspath(defaultOutputDir + testGroup + "/Unsafe_1/pos/Unsafe_1")),
241+
explicitNullsOptions.and("-Yflexify-tasty").withClasspath(defaultOutputDir + testGroup + "/Unsafe_1/pos/Unsafe_1")),
242242
).map(_.keepOutput.checkCompile())
243243

244244
tests.foreach(_.delete())

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /