Remove OI/NI attributes from test data
This commit is contained in:
committed by
teamcityserver
parent
2ecba6ac39
commit
ddbdfafa79
+3
-3
@@ -8,7 +8,7 @@ class None<T> : Option<T>
|
||||
fun <T> bind(r: Option<T>): Option<T> {
|
||||
return if (r is Some) {
|
||||
// Ideally we should infer Option<T> here (see KT-10896)
|
||||
(<!TYPE_INFERENCE_FAILED_ON_SPECIAL_CONSTRUCT{OI}!>if<!> (true) <!TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH{OI}!>None()<!> else <!DEBUG_INFO_SMARTCAST{OI}!>r<!>) checkType { <!TYPE_MISMATCH{OI}!>_<!><Option<T>>() }
|
||||
(if (true) None() else r) checkType { _<Option<T>>() }
|
||||
// Works correctly
|
||||
if (true) None() else r
|
||||
}
|
||||
@@ -24,9 +24,9 @@ fun <T> bind2(r: Option<T>): Option<T> {
|
||||
}
|
||||
|
||||
fun <T, R> bind3(r: Option<T>): Option<T> {
|
||||
return if (r is Some) <!TYPE_MISMATCH{NI}!>{
|
||||
return if (r is Some) <!TYPE_MISMATCH!>{
|
||||
// Diagnoses an error correctly
|
||||
if (true) <!TYPE_MISMATCH{OI}!>None<R>()<!> else r
|
||||
if (true) None<R>() else r
|
||||
}<!>
|
||||
else r
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
// NI_EXPECTED_FILE
|
||||
|
||||
val test1 = { if (true) <!IMPLICIT_CAST_TO_ANY{OI}!>1<!> else <!IMPLICIT_CAST_TO_ANY{OI}!>""<!> }
|
||||
val test1 = { if (true) 1 else "" }
|
||||
|
||||
val test2 = { { if (true) <!IMPLICIT_CAST_TO_ANY{OI}!>1<!> else <!IMPLICIT_CAST_TO_ANY{OI}!>""<!> } }
|
||||
val test2 = { { if (true) 1 else "" } }
|
||||
|
||||
val test3: (Boolean) -> Any = { if (it) 1 else "" }
|
||||
|
||||
|
||||
+3
-3
@@ -16,8 +16,8 @@ fun testResultOfLambda2() =
|
||||
|
||||
fun testResultOfAnonFun1() =
|
||||
run(fun () =
|
||||
if (true) <!IMPLICIT_CAST_TO_ANY{OI}!>42<!>
|
||||
else <!IMPLICIT_CAST_TO_ANY{OI}!>println()<!>
|
||||
if (true) 42
|
||||
else println()
|
||||
)
|
||||
|
||||
fun testResultOfAnonFun2() =
|
||||
@@ -27,7 +27,7 @@ fun testResultOfAnonFun2() =
|
||||
|
||||
fun testReturnFromAnonFun() =
|
||||
run(fun () {
|
||||
return <!TYPE_MISMATCH{NI}!>if (true) <!CONSTANT_EXPECTED_TYPE_MISMATCH{OI}!>42<!> else println()<!>
|
||||
return <!TYPE_MISMATCH!>if (true) 42 else println()<!>
|
||||
})
|
||||
|
||||
fun <!IMPLICIT_NOTHING_RETURN_TYPE!>testReturn1<!>() =
|
||||
|
||||
@@ -19,10 +19,10 @@ val xx6 = null ?: <!INVALID_IF_AS_EXPRESSION!>if<!> (true) 42
|
||||
val xx7 = "" + <!INVALID_IF_AS_EXPRESSION!>if<!> (true) 42
|
||||
|
||||
val wxx1 = <!NO_ELSE_IN_WHEN!>when<!> { true -> 42 }
|
||||
val wxx2: Unit = <!TYPE_MISMATCH{NI}!><!NO_ELSE_IN_WHEN!>when<!> { true -> <!CONSTANT_EXPECTED_TYPE_MISMATCH{OI}!>42<!> }<!>
|
||||
val wxx2: Unit = <!TYPE_MISMATCH!><!NO_ELSE_IN_WHEN!>when<!> { true -> 42 }<!>
|
||||
val wxx3 = idAny(<!NO_ELSE_IN_WHEN!>when<!> { true -> 42 })
|
||||
val wxx4 = id(<!NO_ELSE_IN_WHEN!>when<!> { true -> 42 })
|
||||
val wxx5 = idUnit(<!TYPE_MISMATCH{NI}!><!NO_ELSE_IN_WHEN!>when<!> { true -> <!CONSTANT_EXPECTED_TYPE_MISMATCH{OI}!>42<!> }<!>)
|
||||
val wxx5 = idUnit(<!TYPE_MISMATCH!><!NO_ELSE_IN_WHEN!>when<!> { true -> 42 }<!>)
|
||||
val wxx6 = null ?: <!NO_ELSE_IN_WHEN!>when<!> { true -> 42 }
|
||||
val wxx7 = "" + <!NO_ELSE_IN_WHEN!>when<!> { true -> 42 }
|
||||
|
||||
@@ -50,8 +50,8 @@ fun g1() = <!NO_ELSE_IN_WHEN!>when<!> { true -> work() }
|
||||
fun g2() = <!NO_ELSE_IN_WHEN!>when<!> { true -> mlist.add() }
|
||||
fun g3() = <!NO_ELSE_IN_WHEN!>when<!> { true -> 42 }
|
||||
fun g4(): Unit = <!NO_ELSE_IN_WHEN!>when<!> { true -> work() }
|
||||
fun g5(): Unit = <!TYPE_MISMATCH{NI}!><!NO_ELSE_IN_WHEN!>when<!> { true -> <!TYPE_MISMATCH{OI}!>mlist.add()<!> }<!>
|
||||
fun g6(): Unit = <!TYPE_MISMATCH{NI}!><!NO_ELSE_IN_WHEN!>when<!> { true -> <!CONSTANT_EXPECTED_TYPE_MISMATCH{OI}!>42<!> }<!>
|
||||
fun g5(): Unit = <!TYPE_MISMATCH!><!NO_ELSE_IN_WHEN!>when<!> { true -> mlist.add() }<!>
|
||||
fun g6(): Unit = <!TYPE_MISMATCH!><!NO_ELSE_IN_WHEN!>when<!> { true -> 42 }<!>
|
||||
|
||||
fun foo1(x: String?) {
|
||||
"" + <!INVALID_IF_AS_EXPRESSION!>if<!> (true) 42
|
||||
|
||||
+1
-1
@@ -29,5 +29,5 @@ fun example() {
|
||||
return <!TYPE_MISMATCH!><!INVALID_IF_AS_EXPRESSION!>if<!> (true) true<!>
|
||||
}
|
||||
|
||||
return <!TYPE_MISMATCH{NI}!>if (true) <!CONSTANT_EXPECTED_TYPE_MISMATCH{OI}!>true<!> else {}<!>
|
||||
return <!TYPE_MISMATCH!>if (true) true else {}<!>
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ package kt1075
|
||||
|
||||
fun foo(b: String) {
|
||||
if (<!TYPE_MISMATCH!>b<!> in 1..10) {} //type mismatch
|
||||
when (<!TYPE_MISMATCH{NI}!>b<!>) {
|
||||
when (<!TYPE_MISMATCH!>b<!>) {
|
||||
<!TYPE_MISMATCH_IN_RANGE!>in<!> 1..10 -> 1 //no type mismatch, but it should be here
|
||||
else -> 2
|
||||
}
|
||||
|
||||
@@ -3,9 +3,9 @@ package f
|
||||
fun test(a: Boolean, b: Boolean): Int {
|
||||
return if(a) {
|
||||
1
|
||||
} else <!TYPE_MISMATCH{NI}!>{
|
||||
<!TYPE_MISMATCH{OI}!><!INVALID_IF_AS_EXPRESSION!>if<!> (b) {
|
||||
} else <!TYPE_MISMATCH!>{
|
||||
<!INVALID_IF_AS_EXPRESSION!>if<!> (b) {
|
||||
3
|
||||
}<!>
|
||||
}
|
||||
}<!>
|
||||
}
|
||||
|
||||
+2
-2
@@ -104,8 +104,8 @@ fun testImplicitCoercion() {
|
||||
val g = <!INVALID_IF_AS_EXPRESSION!>if<!> (true) 4
|
||||
val h = if (false) <!IMPLICIT_CAST_TO_ANY!>4<!> else <!IMPLICIT_CAST_TO_ANY!>{}<!>
|
||||
|
||||
bar(<!TYPE_MISMATCH{NI}!>if (true) {
|
||||
<!CONSTANT_EXPECTED_TYPE_MISMATCH{OI}!>4<!>
|
||||
bar(<!TYPE_MISMATCH!>if (true) {
|
||||
4
|
||||
} else {
|
||||
z = 342
|
||||
}<!>)
|
||||
|
||||
+2
-2
@@ -7,9 +7,9 @@ fun test() {
|
||||
use({ }<!NOT_NULL_ASSERTION_ON_LAMBDA_EXPRESSION!>!!<!>);
|
||||
|
||||
// KT-KT-9070
|
||||
<!TYPE_MISMATCH{OI}!>{ }<!> <!USELESS_ELVIS!>?: 1<!>
|
||||
{ } <!USELESS_ELVIS!>?: 1<!>
|
||||
use({ 2 } <!USELESS_ELVIS!>?: 1<!>);
|
||||
|
||||
1 <!USELESS_ELVIS!>?: <!TYPE_MISMATCH{OI}!>{ }<!><!>
|
||||
1 <!USELESS_ELVIS!>?: { }<!>
|
||||
use(1 <!USELESS_ELVIS!>?: { }<!>)
|
||||
}
|
||||
|
||||
@@ -13,11 +13,11 @@ fun foo() : Int {
|
||||
}
|
||||
|
||||
fun bar() : Int =
|
||||
try <!TYPE_MISMATCH{NI}!>{
|
||||
<!TYPE_MISMATCH{OI}!>doSmth()<!>
|
||||
try <!TYPE_MISMATCH!>{
|
||||
doSmth()
|
||||
}<!>
|
||||
catch (e: Exception) <!TYPE_MISMATCH{NI}!>{
|
||||
<!TYPE_MISMATCH{OI}!>""<!>
|
||||
catch (e: Exception) <!TYPE_MISMATCH!>{
|
||||
""
|
||||
}<!>
|
||||
finally {
|
||||
""
|
||||
|
||||
+2
-2
@@ -12,9 +12,9 @@ fun <T: Any> exclExcl(t: T?): T = t!!
|
||||
fun test11() {
|
||||
// not 'String!'
|
||||
exclExcl(A.foo()) checkType { _<String>() }
|
||||
exclExcl(A.foo()) checkType { <!TYPE_MISMATCH{OI}, UNRESOLVED_REFERENCE_WRONG_RECEIVER{NI}!>_<!><String?>() }
|
||||
exclExcl(A.foo()) checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><String?>() }
|
||||
|
||||
// not 'String!'
|
||||
A.foo()!! checkType { _<String>() }
|
||||
A.foo()!! checkType { <!TYPE_MISMATCH{OI}, UNRESOLVED_REFERENCE_WRONG_RECEIVER{NI}!>_<!><String?>() }
|
||||
A.foo()!! checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><String?>() }
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
// NI_EXPECTED_FILE
|
||||
|
||||
val test1 = { when (true) { true -> <!IMPLICIT_CAST_TO_ANY{OI}!>1<!>; else -> <!IMPLICIT_CAST_TO_ANY{OI}!>""<!> } }
|
||||
val test1 = { when (true) { true -> 1; else -> "" } }
|
||||
|
||||
val test2 = { { when (true) { true -> <!IMPLICIT_CAST_TO_ANY{OI}!>1<!>; else -> <!IMPLICIT_CAST_TO_ANY{OI}!>""<!> } } }
|
||||
val test2 = { { when (true) { true -> 1; else -> "" } } }
|
||||
|
||||
val test3: (Boolean) -> Any = { when (true) { true -> 1; else -> "" } }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user