Skip to content

Commit d8a0826

Browse files
bishaboshacheeseng
authored andcommitted
update scalaversionhelper
1 parent 6ab1ced commit d8a0826

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

project/ScalaVersionHelper.scala

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
object ScalaVersionHelper {
2-
def isStdLibCompat_213(scalaVersion: String): Boolean = {
3-
scalaVersion.startsWith("2.13") ||
4-
isDotty(scalaVersion)
5-
}
62

7-
def isDotty(scalaVersion: String): Boolean = {
8-
scalaVersion.startsWith("3.") ||
9-
scalaVersion.matches("""0\.(?:1[8-]|2).*""")
10-
}
3+
val dotty_series = """(?:3|0\.(?:1[8-9]|[2-9])).*""".r
4+
val scala_series = """2\.(?:1[3-9]|[2-9]).*""".r
5+
6+
def isStdLibCompat_213(scalaVersion: String): Boolean = scalaVersion match {
7+
case scala_series() | dotty_series() => true
8+
case _ => false
9+
}
10+
11+
def isDotty(scalaVersion: String): Boolean = scalaVersion match {
12+
case dotty_series() => true
13+
case _ => false
14+
}
1115
}

0 commit comments

Comments
 (0)