This commit is contained in:
Mark Harrah 2013-12-10 08:40:37 -05:00
parent c669606999
commit 90143986e4
2 changed files with 14 additions and 3 deletions

View File

@ -1 +1,12 @@
libraryDependencies += "org.scala-sbt" % "sbt" % sbtVersion.value
libraryDependencies += "org.scala-sbt" % "sbt" % sbtVersion.value
lazy val expectErrorNotCrash = taskKey[Unit]("Ensures that sbt properly set types on Trees so that the compiler doesn't crash on a bad reference to .value, but gives a proper error instead.")
expectErrorNotCrash := {
val fail = (compile in Compile).failure.value
fail.directCause match {
case Some(x: xsbti.CompileFailed) => ()
case _ => error("Compiler crashed instead of providing a compile-time-only exception.")
}
}

View File

@ -2,7 +2,7 @@ $ copy-file changes/A1.scala A.scala
> compile
$ copy-file changes/A2.scala A.scala
-> compile
> expectErrorNotCrash
$ copy-file changes/A3.scala A.scala
-> compile
> expectErrorNotCrash