Skip to content

Commit

Permalink
Merge pull request #366 from sbt/Xsource-3
Browse files Browse the repository at this point in the history
add `-Xsource:3` option
  • Loading branch information
eed3si9n committed Dec 28, 2023
2 parents 3c1569c + 9af0d6f commit d7a2698
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions io/src/main/scala/sbt/internal/io/Milli.scala
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import scala.util.control.NonFatal
private abstract class Stat[Time_T](size: Int) extends NativeMapped {
val buffer = ByteBuffer.allocate(size).order(ByteOrder.nativeOrder())

def fromNative(nativeValue: Object, context: FromNativeContext) =
def fromNative(nativeValue: Object, context: FromNativeContext): Nothing =
throw new UnsupportedOperationException("Not supported.")

def toNative(): Object = buffer
Expand Down Expand Up @@ -149,7 +149,7 @@ private abstract class PosixMilliInt[Interface <: Posix[Int]: ClassTag]
//
private abstract class TimeSpec2[Time_T] extends NativeMapped {
val buffer: Array[Time_T]
def fromNative(nativeValue: Object, context: FromNativeContext) =
def fromNative(nativeValue: Object, context: FromNativeContext): Nothing =
throw new UnsupportedOperationException("Not supported.")
def toNative(): Object = buffer
def nativeType(): Class[Array[Time_T]] = classOf[Array[Time_T]]
Expand Down
2 changes: 1 addition & 1 deletion io/src/main/scala/sbt/internal/nio/TimeSource.scala
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ private[nio] trait Deadline extends Comparable[Deadline] {
private[nio] object Deadline {
def now(implicit timeSource: TimeSource): Deadline = timeSource.now
private[nio] object Inf extends Deadline {
override val value = Duration.Inf
override val value: Duration = Duration.Inf
override def isOverdue: Boolean = false
override def compareTo(o: Deadline): Int = this.value compareTo o.value
override def +(duration: FiniteDuration): Deadline = this
Expand Down
2 changes: 2 additions & 0 deletions project/HouseRulesPluglin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ object HouseRulesPlugin extends AutoPlugin {
})
.value
.toList,
scalacOptions ++= "-Xsource:3".ifScala213OrMinus.value.toList,
scalacOptions ++= "-Wconf:msg=package object inheritance is deprecated:warning".ifScala213OrMinus.value.toList,
scalacOptions ++= "-Yno-adapted-args".ifScala212OrMinus.value.toList,
scalacOptions ++= "-Ywarn-dead-code".ifScala213OrMinus.value.toList,
scalacOptions ++= "-Ywarn-numeric-widen".ifScala213OrMinus.value.toList,
Expand Down

0 comments on commit d7a2698

Please sign in to comment.