Add diagnostics to test data from NI

This commit is contained in:
Mikhail Zarechenskiy
2017-11-22 08:50:30 +03:00
parent a71238bf94
commit 8757298994
480 changed files with 1136 additions and 1120 deletions
+4 -4
View File
@@ -149,7 +149,7 @@ fun illegalWhenBody(a: Any): Int = <!NO_ELSE_IN_WHEN!>when<!>(a) {
fun illegalWhenBlock(a: Any): Int {
when(a) {
is Int -> return <!DEBUG_INFO_SMARTCAST!>a<!>
is String -> return <!TYPE_MISMATCH!>a<!>
is String -> return <!NI;TYPE_MISMATCH, TYPE_MISMATCH!>a<!>
}
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
fun declarations(a: Any?) {
@@ -183,7 +183,7 @@ fun returnFunctionLiteral(a: Any?): Function0<Int> {
}
fun returnFunctionLiteralExpressionBody(a: Any?): Function0<Int> =
if (a is Int) { -> <!DEBUG_INFO_SMARTCAST!>a<!> }
if (a is Int) { -> <!NI;TYPE_MISMATCH, NI;TYPE_MISMATCH, NI;TYPE_MISMATCH, NI;TYPE_MISMATCH, OI;DEBUG_INFO_SMARTCAST!>a<!> }
else { -> 1 }
@@ -202,7 +202,7 @@ fun mergeSmartCasts(a: Any?) {
val <!UNUSED_VARIABLE!>i<!>: Int = <!DEBUG_INFO_SMARTCAST!>a<!>.compareTo("")
}
if (a is String && <!DEBUG_INFO_SMARTCAST!>a<!>.compareTo("") == 0) {}
if (a is String || a.<!UNRESOLVED_REFERENCE!>compareTo<!>("") <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>==<!> 0) {}
if (a is String || a.<!UNRESOLVED_REFERENCE!>compareTo<!>("") <!NI;RESULT_TYPE_MISMATCH, DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>==<!> 0) {}
}
//mutability
@@ -222,7 +222,7 @@ fun f(): String {
fun foo(aa: Any?): Int {
var a = aa
if (a is Int?) {
return <!TYPE_MISMATCH!>a<!>
return <!NI;TYPE_MISMATCH, TYPE_MISMATCH!>a<!>
}
return 1
}