mirror of https://github.com/sbt/sbt.git
Add tests that check `sbtUnchecked` is respected
This commit is contained in:
parent
b017eaee39
commit
6a31251a01
|
|
@ -27,6 +27,30 @@ class TaskPosSpec {
|
|||
}
|
||||
}
|
||||
|
||||
locally {
|
||||
import sbt._
|
||||
import sbt.Def._
|
||||
val foo = taskKey[String]("")
|
||||
var condition = true
|
||||
val baz = Def.task[String] {
|
||||
val fooAnon = () => foo.value: @sbtUnchecked
|
||||
if (condition) fooAnon()
|
||||
else fooAnon()
|
||||
}
|
||||
}
|
||||
|
||||
locally {
|
||||
import sbt._
|
||||
import sbt.Def._
|
||||
val foo = taskKey[String]("")
|
||||
var condition = true
|
||||
val baz = Def.task[String] {
|
||||
val fooAnon = () => (foo.value: @sbtUnchecked) + ""
|
||||
if (condition) fooAnon()
|
||||
else fooAnon()
|
||||
}
|
||||
}
|
||||
|
||||
locally {
|
||||
import sbt._
|
||||
import sbt.Def._
|
||||
|
|
@ -77,6 +101,18 @@ class TaskPosSpec {
|
|||
}
|
||||
}
|
||||
|
||||
locally {
|
||||
// missing .value error should not happen inside task dyn
|
||||
import sbt._
|
||||
import sbt.Def._
|
||||
val foo = taskKey[String]("")
|
||||
val avoidDCE = ""
|
||||
val baz = Def.task[String] {
|
||||
foo: @sbtUnchecked
|
||||
avoidDCE
|
||||
}
|
||||
}
|
||||
|
||||
locally {
|
||||
import sbt._
|
||||
import sbt.Def._
|
||||
|
|
|
|||
Loading…
Reference in New Issue