You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lint function arrow intended context function (#23847)
Fixes#21187
If a function literal `x => body` has an expected type `X ?=> ?` then
maybe they intended to write `x ?=> body`.
As shown in the test, maybe types will misalign in other ways to emit
warnings.
valWhelp:Setting[Boolean] =BooleanSetting(WarningSetting, "W", "Print a synopsis of warning options.")
162
-
valXfatalWarnings:Setting[Boolean] =BooleanSetting(WarningSetting, "Werror", "Fail the compilation if there are any warnings.", aliases =List("-Xfatal-warnings"))
162
+
valWerror:Setting[Boolean] =BooleanSetting(WarningSetting, "Werror", "Fail the compilation if there are any warnings.", aliases =List("-Xfatal-warnings"))
163
163
valWall:Setting[Boolean] =BooleanSetting(WarningSetting, "Wall", "Enable all warning settings.")
164
164
privatevalWvalueDiscard:Setting[Boolean] =BooleanSetting(WarningSetting, "Wvalue-discard", "Warn when non-Unit expression results are unused.")
165
165
privatevalWNonUnitStatement=BooleanSetting(WarningSetting, "Wnonunit-statement", "Warn when block statements are non-Unit expressions.")
privatevalWunstableInlineAccessors=BooleanSetting(WarningSetting, "WunstableInlineAccessors", "Warn an inline methods has references to non-stable binary APIs.")
169
169
privatevalWtoStringInterpolated=BooleanSetting(WarningSetting, "Wtostring-interpolated", "Warn a standard interpolator used toString on a reference type.")
170
170
privatevalWrecurseWithDefault=BooleanSetting(WarningSetting, "Wrecurse-with-default", "Warn when a method calls itself with a default argument.")
171
+
privatevalWwrongArrow=BooleanSetting(WarningSetting, "Wwrong-arrow", "Warn if function arrow was used instead of context literal ?=>.")
valYnoKindPolymorphism:Setting[Boolean] =BooleanSetting(ForkSetting, "Yno-kind-polymorphism", "Disable kind polymorphism. (This flag has no effect)", deprecation =Deprecation.removed())
454
456
valYexplicitNulls:Setting[Boolean] =BooleanSetting(ForkSetting, "Yexplicit-nulls", "Make reference types non-nullable. Nullable types can be expressed with unions: e.g. String|Null.")
455
457
valYnoFlexibleTypes: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.")
456
-
valYcheckInitGlobal:Setting[Boolean] =BooleanSetting(ForkSetting, "Ysafe-init-global", "Check safe initialization of global objects.")
458
+
valYsafeInitGlobal:Setting[Boolean] =BooleanSetting(ForkSetting, "Ysafe-init-global", "Check safe initialization of global objects.")
457
459
valYrequireTargetName:Setting[Boolean] =BooleanSetting(ForkSetting, "Yrequire-targetName", "Warn if an operator is defined without a @targetName annotation.")
458
460
valYrecheckTest:Setting[Boolean] =BooleanSetting(ForkSetting, "Yrecheck-test", "Run basic rechecking (internal test only).")
459
461
valYccDebug:Setting[Boolean] =BooleanSetting(ForkSetting, "Ycc-debug", "Used in conjunction with captureChecking language import, debug info for captured references.")
// createTestCase(settings.Xlint , settings.Wshadow, ":all"), // this setting is not going to be mapped to replacement. Read more in the commit message
// createTestCase(settings.Xlint , settings.Wshadow, ":all"), // this setting is not going to be mapped to replacement. Read more in the commit message
0 commit comments