Skip to content

Commit

Permalink
Merge pull request #2096 from bjaglin/scala3minors
Browse files Browse the repository at this point in the history
test usage of minor Scala 3 PC versions
  • Loading branch information
bjaglin authored Oct 4, 2024
2 parents 7f12fe7 + 0fc1c99 commit 77f46da
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 0 deletions.
8 changes: 8 additions & 0 deletions project/ScalafixBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,14 @@ object ScalafixBuild extends AutoPlugin with GhpagesKeys {
Compile / console / scalacOptions :=
compilerOptions.value :+ "-Yrepl-class-based",
Compile / doc / scalacOptions ++= scaladocOptions,
Compile / unmanagedSourceDirectories ++= {
val dir = (Compile / sourceDirectory).value
scalaVersion.value match {
case `scala3LTS` => Seq(dir / "scala-3lts")
case `scala3Next` => Seq(dir / "scala-3next")
case _ => Nil
}
},
// Don't package sources & docs when publishing locally as it adds a significant
// overhead when testing because of publishLocalTransitive. Tweaking publishArtifact
// would more readable, but it would also affect remote (sonatype) publishing.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
rules = ExplicitResultTypes
ExplicitResultTypes.fetchScala3CompilerArtifactsOnVersionMismatch = true
*/
package test.explicitResultTypes

object BeforeScala3_4 {
def foo = {
val xs = List(Some(1), None)
for Some(x) <- xs yield x
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
rules = ExplicitResultTypes
ExplicitResultTypes.skipSimpleDefinitions = false
*/
package test.explicitResultTypes

object Scala3_5OrGreater {
def foo = 0b0010_0000
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package test.explicitResultTypes

object BeforeScala3_4 {
def foo: List[Int] = {
val xs = List(Some(1), None)
for Some(x) <- xs yield x
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package test.explicitResultTypes

object Scala3_5OrGreater {
def foo: Int = 0b0010_0000
}

0 comments on commit 77f46da

Please sign in to comment.