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
Copy file name to clipboardExpand all lines: compiler/src/dotty/tools/dotc/config/ScalaSettings.scala
+1-1
Original file line number
Diff line number
Diff line change
@@ -165,7 +165,7 @@ class ScalaSettings extends Settings.SettingGroup with CommonScalaSettings {
165
165
valYstopBefore:Setting[List[String]] =PhasesSetting("-Ystop-before", "Stop before") // stop before erasure as long as we have not debugged it fully
166
166
valYshowSuppressedErrors:Setting[Boolean] =BooleanSetting("-Yshow-suppressed-errors", "Also show follow-on errors and warnings that are normally suppressed.")
167
167
valYdetailedStats:Setting[Boolean] =BooleanSetting("-Ydetailed-stats", "Show detailed internal compiler stats (needs Stats.enabled to be set to true).")
168
-
valYkindProjector:Setting[Boolean] =BooleanSetting("-Ykind-projector", "Allow `*` as wildcard to be compatible with kind projector.")
168
+
valYkindProjector:Setting[String] =ChoiceSetting("-Ykind-projector", "[underscores, disable]", "Allow `*` as type lambda placeholder to be compatible with kind projector. When invoked as -Ykind-projector:underscores will repurpose `_` to be a type parameter placeholder, this will disable usage of underscore as a wildcard.", List("disable", "", "underscores"), "disable")
169
169
valYprintPos:Setting[Boolean] =BooleanSetting("-Yprint-pos", "Show tree positions.")
170
170
valYprintPosSyms:Setting[Boolean] =BooleanSetting("-Yprint-pos-syms", "Show symbol definitions positions.")
171
171
valYnoDeepSubtypes:Setting[Boolean] =BooleanSetting("-Yno-deep-subtypes", "Throw an exception on deep subtyping call stacks.")
Copy file name to clipboardExpand all lines: docs/docs/reference/changed-features/wildcards.md
+5
Original file line number
Diff line number
Diff line change
@@ -42,3 +42,8 @@ option `-Ykind-projector`:
42
42
3. In Scala 3.3, `*` is removed again, and all type parameter placeholders will be expressed with `_`.
43
43
44
44
These rules make it possible to cross build between Scala 2 using the kind projector plugin and Scala 3.0 - 3.2 using the compiler option `-Ykind-projector`.
45
+
46
+
There is also a migration path for users that want a one-time transition to syntax with `_` as a type parameter placeholder.
47
+
With option `-Ykind-projector:underscores` Scala 3 will regard `_` as a type parameter placeholder, leaving `?` as the only syntax for wildcards.
48
+
49
+
To cross-compile with old Scala 2 sources, while using `_` a placeholder, you must use options `-Xsource:3 -P:kind-projector:underscore-placeholders` together with a recent version of kind-projector (`0.13` and higher) and most recent versions of Scala 2 (`2.13.5` and higher and `2.12.14` and higher)
0 commit comments