From 9e66df4303961733200f752815023df68bd9edfe Mon Sep 17 00:00:00 2001 From: Thanh Le Date: Wed, 21 Aug 2024 14:47:56 +0200 Subject: [PATCH] Add -Wsafe-init for scala 3.5.0 --- .../scala/org/typelevel/scalacoptions/ScalacOptions.scala | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/src/main/scala/org/typelevel/scalacoptions/ScalacOptions.scala b/lib/src/main/scala/org/typelevel/scalacoptions/ScalacOptions.scala index 07d337a..858ba8d 100644 --- a/lib/src/main/scala/org/typelevel/scalacoptions/ScalacOptions.scala +++ b/lib/src/main/scala/org/typelevel/scalacoptions/ScalacOptions.scala @@ -813,6 +813,12 @@ private[scalacoptions] trait ScalacOptions { version => version.isBetween(V2_13_0, V3_0_0) || version.isAtLeast(V3_3_0) ) + /** Enables safe initialization check. More info: + * [[https://docs.scala-lang.org/scala3/reference/other-new-features/safe-initialization.html]] + */ + val warnSafeInit = + warnOption("safe-init", version => version >= V3_5_0) + /** Unused warning options (-Wunused:) */ val warnUnusedOptions: Set[ScalacOption] = ListSet(