From 70eabd1c3a151615f84212db1d329ccb9763eec4 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Mon, 15 Jul 2024 00:13:48 +0000 Subject: [PATCH] Use stable option for kind-projector in 3.5+ See https://github.com/scala/scala3/pull/20199 --- .../org/typelevel/sbt/TypelevelSettingsPlugin.scala | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/settings/src/main/scala/org/typelevel/sbt/TypelevelSettingsPlugin.scala b/settings/src/main/scala/org/typelevel/sbt/TypelevelSettingsPlugin.scala index 80df6db8..3778a177 100644 --- a/settings/src/main/scala/org/typelevel/sbt/TypelevelSettingsPlugin.scala +++ b/settings/src/main/scala/org/typelevel/sbt/TypelevelSettingsPlugin.scala @@ -194,11 +194,12 @@ object TypelevelSettingsPlugin extends AutoPlugin { }, scalacOptions ++= { scalaVersion.value match { - case V(V(3, _, _, _)) if onlyScala3.value => - Seq("-Ykind-projector:underscores") - - case V(V(3, _, _, _)) => - Seq("-language:implicitConversions", "-Ykind-projector") + case V(V(3, minor, _, _)) => + val kpFlag = if (minor >= 5) "-Xkind-projector" else "-Ykind-projector" + if (onlyScala3.value) + Seq(s"$kpFlag:underscores") + else + Seq("-language:implicitConversions", kpFlag) case V(V(2, minor, _, _)) if minor >= 12 => Seq("-language:_", "-Xsource:3")