Skip to content

Commit 5ad2a2f

Browse files
committed
Add -Ysafe-init option
1 parent 4c9bbb2 commit 5ad2a2f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/src/main/scala/org/typelevel/scalacoptions/ScalacOptions.scala

+8-4
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,12 @@ private[scalacoptions] trait ScalacOptions {
461461
val privateKindProjector =
462462
privateOption("kind-projector", version => version >= V3_0_0)
463463

464+
/** Enables safe initialization check. More info:
465+
* [[https://docs.scala-lang.org/scala3/reference/other-new-features/safe-initialization.html]]
466+
*/
467+
val privateSafeInit =
468+
privateOption("safe-init", version => version >= V3_0_0)
469+
464470
/** Enables support for higher order unification in type constructor inference.
465471
*
466472
* Initially provided as a compiler option in the 2.12.x series to fix the infamous
@@ -469,10 +475,7 @@ private[scalacoptions] trait ScalacOptions {
469475
* Enabled by default in 2.13.0+ and no longer accepted by the compiler as an option.
470476
*/
471477
val privatePartialUnification =
472-
privateOption(
473-
"partial-unification",
474-
version => version.isBetween(V2_11_11, V2_13_0)
475-
)
478+
privateOption("partial-unification", version => version.isBetween(V2_11_11, V2_13_0))
476479

477480
/** Configures the number of worker threads for the compiler backend.
478481
*
@@ -647,6 +650,7 @@ private[scalacoptions] trait ScalacOptions {
647650
val privateOptions: Set[ScalacOption] = ListSet(
648651
privateNoAdaptedArgs,
649652
privateKindProjector,
653+
privateSafeInit,
650654
privatePartialUnification
651655
) ++ privateWarnOptions
652656

0 commit comments

Comments
 (0)