[FE 1.0] Fix some diagnostic spec tests

This commit is contained in:
Victor Petukhov
2021-07-22 11:00:06 +03:00
committed by Mikhael Bogdanov
parent 0ed9b75428
commit ca0b8be53b
16 changed files with 820 additions and 662 deletions
@@ -15,22 +15,22 @@
annotation class Ann(val x: Int)
// TESTCASE NUMBER: 1
abstract class Foo : @<!DEBUG_INFO_MISSING_UNRESOLVED!>Ann<!>(10) Any()
abstract class Foo : <!WRONG_ANNOTATION_TARGET!>@Ann(10)<!> Any()
// TESTCASE NUMBER: 2
abstract class Bar<T : @Ann(10) Any>
abstract class Bar<T : <!WRONG_ANNOTATION_TARGET!>@Ann(10)<!> Any>
// TESTCASE NUMBER: 3
fun case_3(a: Any) {
if (a is @Ann(10) String) return
if (a is <!WRONG_ANNOTATION_TARGET!>@Ann(10)<!> String) return
}
// TESTCASE NUMBER: 4
open class TypeToken<T>
val case_4 = object : TypeToken<@<!DEBUG_INFO_MISSING_UNRESOLVED!>Ann<!>(10) String>() {}
val case_4 = object : TypeToken<<!WRONG_ANNOTATION_TARGET!>@Ann(10)<!> String>() {}
// TESTCASE NUMBER: 5
fun case_5(a: Any) {
a as @<!DEBUG_INFO_MISSING_UNRESOLVED!>Ann<!>(10) Int
a as <!WRONG_ANNOTATION_TARGET!>@Ann(10)<!> Int
}
@@ -18,7 +18,7 @@ annotation class Ann(val x: Int)
* UNEXPECTED BEHAVIOUR
*/
fun case_1(a: Any) {
if (a is @Ann(<!DEBUG_INFO_MISSING_UNRESOLVED!>unresolved_reference<!>) String) return
if (a is @Ann(<!UNRESOLVED_REFERENCE!>unresolved_reference<!>) String) return
}
/*
@@ -26,7 +26,7 @@ fun case_1(a: Any) {
* UNEXPECTED BEHAVIOUR
*/
fun case_2(a: Any) {
a as @<!DEBUG_INFO_MISSING_UNRESOLVED!>Ann<!>(<!DEBUG_INFO_MISSING_UNRESOLVED!>unresolved_reference<!>) String // OK, no error in IDE and in the compiler
a as @Ann(<!UNRESOLVED_REFERENCE!>unresolved_reference<!>) String // OK, no error in IDE and in the compiler
}
/*
@@ -36,7 +36,7 @@ fun case_2(a: Any) {
fun case_3_1(a: Any) {}
fun case_3_2(a: Any) {
case_3_1(a as @Ann(<!DEBUG_INFO_MISSING_UNRESOLVED!>unresolved_reference<!>) String) // OK, no error in IDE and in the compiler
case_3_1(a as @Ann(<!UNRESOLVED_REFERENCE!>unresolved_reference<!>) String) // OK, no error in IDE and in the compiler
}
// TESTCASE NUMBER: 4