Front-end test data fixed to have no complex patterns

#KT-2359 In Progress
This commit is contained in:
Andrey Breslav
2012-09-05 13:03:14 +04:00
parent 1b65ba644e
commit a267f65fa1
8 changed files with 55 additions and 144 deletions
+5 -25
View File
@@ -12,18 +12,9 @@ fun foo() : Int {
1 + <!UNRESOLVED_REFERENCE!>a<!> -> 1
in 1..<!UNRESOLVED_REFERENCE!>a<!> -> 1
!in 1..<!UNRESOLVED_REFERENCE!>a<!> -> 1
// Commented for KT-621 .<!!UNRESOLVED_REFERENCE!>a<!!> => 1
// Commented for KT-621 .equals(1).<!!UNRESOLVED_REFERENCE!>a<!!> => 1
// Commented for KT-621 <!UNNECESSARY_SAFE_CALL!!>?.<!!>equals(1) => 1
is * -> 1
else -> 1
}
// Commented for KT-621
// return when (<!!USELESS_ELVIS!>x<!!>?:null) {
// <!!UNSAFE_CALL!!>.<!!>foo() => 1
// .equals(1) => 1
// ?.equals(1).equals(2) => 1
// }
return 0
}
@@ -35,27 +26,16 @@ fun test() {
<!NO_ELSE_IN_WHEN!>when<!> (x) {
<!INCOMPATIBLE_TYPES!>s<!> -> 1
is <!INCOMPATIBLE_TYPES!>""<!> -> 1
<!INCOMPATIBLE_TYPES!>""<!> -> 1
x -> 1
is 1 -> 1
is <!TYPE_MISMATCH_IN_TUPLE_PATTERN!>#(1, 1)<!> -> 1
1 -> 1
}
val z = #(1, 1)
<!NO_ELSE_IN_WHEN!>when<!> (z) {
is #(*, *) -> 1
is #(*, 1) -> 1
is #(1, 1) -> 1
is #(1, <!INCOMPATIBLE_TYPES!>"1"<!>) -> 1
is <!TYPE_MISMATCH_IN_TUPLE_PATTERN!>#(1, "1", *)<!> -> 1
is boo #(1, <!INCOMPATIBLE_TYPES!>"a"<!>, *) -> 1
is boo <!TYPE_MISMATCH_IN_TUPLE_PATTERN!>#(1, *)<!> -> 1
}
val z = 1
when (z) {
<!ELSE_MISPLACED_IN_WHEN!>else<!> -> 1
<!UNREACHABLE_CODE!>#(1, 1) -> 2<!>
<!UNREACHABLE_CODE!>1 -> 2<!>
}
when (z) {