added CHECK_TYPE directive to diagnostic tests

This commit is contained in:
Svetlana Isakova
2013-12-18 16:11:56 +04:00
parent c9a600a405
commit dd6940be41
14 changed files with 95 additions and 59 deletions
@@ -1,3 +1,4 @@
// !CHECK_TYPE
fun test() {
val a = if (true) {
val x = 1
@@ -5,7 +6,5 @@ fun test() {
} else {
{ 2 }
}
TypeOf(a): TypeOf<Function0<Int>>
}
class TypeOf<T>(t: T)
a checkType { it : _<() -> Int> }
}
@@ -1,8 +1,7 @@
class TypeOf<T>(t: T)
// !CHECK_TYPE
fun <T> id(t: T) = t
fun foo() {
val i = id { 22 } //type inference error: no information for parameter
TypeOf(i): TypeOf<()->Int>
i checkType { it : _<()->Int> }
}