Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

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
}