[AA] KTIJ-23563 Add reference resolve tests for working cases

- Type arguments in invalid calls/property accesses are resolved
  correctly in many cases, for which this commit adds test cases.
This commit is contained in:
Marco Pennekamp
2023-01-25 15:22:26 +01:00
committed by Space Team
parent 42ded7be09
commit 2922f85a98
57 changed files with 1154 additions and 240 deletions
@@ -0,0 +1,4 @@
// COMPILATION_ERRORS
fun foo() {
false<<caret>Int>
}
@@ -0,0 +1,4 @@
// COMPILATION_ERRORS
fun foo() {
true<<caret>String>
}
@@ -0,0 +1,4 @@
// COMPILATION_ERRORS
fun foo() {
true<<caret>String>("hello")
}
@@ -0,0 +1,2 @@
Resolved to:
0: (in kotlin) class String : kotlin.Comparable<kotlin.String>, kotlin.CharSequence, java.io.Serializable
@@ -0,0 +1,2 @@
Resolved to:
0: (in kotlin) class String : kotlin.Comparable<kotlin.String>, kotlin.CharSequence, java.io.Serializable
@@ -0,0 +1,2 @@
Resolved to:
0: (in kotlin) class Intprivate constructor : kotlin.Number(), kotlin.Comparable<kotlin.Int>, java.io.Serializable
@@ -0,0 +1,4 @@
// COMPILATION_ERRORS
fun foo() {
unresolved<<caret>String>()
}
@@ -0,0 +1,2 @@
Resolved to:
0: (in kotlin) class String : kotlin.Comparable<kotlin.String>, kotlin.CharSequence, java.io.Serializable
@@ -0,0 +1,4 @@
// COMPILATION_ERRORS
fun foo() {
unresolved<String, <caret>Int>()
}
@@ -0,0 +1,2 @@
Resolved to:
0: (in kotlin) class Intprivate constructor : kotlin.Number(), kotlin.Comparable<kotlin.Int>, java.io.Serializable
@@ -0,0 +1,4 @@
// COMPILATION_ERRORS
fun foo() {
unresolved<<caret>String>(0)
}
@@ -0,0 +1,2 @@
Resolved to:
0: (in kotlin) class String : kotlin.Comparable<kotlin.String>, kotlin.CharSequence, java.io.Serializable
@@ -0,0 +1,4 @@
// COMPILATION_ERRORS
fun foo() {
unresolved<String, <caret>Int>("hello", 0)
}
@@ -0,0 +1,2 @@
Resolved to:
0: (in kotlin) class Intprivate constructor : kotlin.Number(), kotlin.Comparable<kotlin.Int>, java.io.Serializable
@@ -0,0 +1,6 @@
// COMPILATION_ERRORS
fun <A : Number> generic(a: A) { }
fun foo() {
generic<<caret>String>("wow")
}
@@ -0,0 +1,2 @@
Resolved to:
0: (in kotlin) class String : kotlin.Comparable<kotlin.String>, kotlin.CharSequence, java.io.Serializable
@@ -0,0 +1,6 @@
// COMPILATION_ERRORS
fun <A : Number> generic(a: A) { }
fun foo() {
generic<<caret>Int, String>(2L)
}
@@ -0,0 +1,2 @@
Resolved to:
0: (in kotlin) class Intprivate constructor : kotlin.Number(), kotlin.Comparable<kotlin.Int>, java.io.Serializable
@@ -0,0 +1,5 @@
// COMPILATION_ERRORS
fun foo() {
val variable = "hello"
variable<<caret>String>
}
@@ -0,0 +1,2 @@
Resolved to:
0: (in kotlin) class String : kotlin.Comparable<kotlin.String>, kotlin.CharSequence, java.io.Serializable
@@ -0,0 +1,5 @@
// COMPILATION_ERRORS
fun foo() {
val variable = "hello"
variable<String, <caret>Int>
}
@@ -0,0 +1,2 @@
Resolved to:
0: (in kotlin) class Intprivate constructor : kotlin.Number(), kotlin.Comparable<kotlin.Int>, java.io.Serializable
@@ -0,0 +1,4 @@
// COMPILATION_ERRORS
fun foo(parameter: Int) {
parameter<<caret>String>
}
@@ -0,0 +1,2 @@
Resolved to:
0: (in kotlin) class String : kotlin.Comparable<kotlin.String>, kotlin.CharSequence, java.io.Serializable
@@ -0,0 +1,4 @@
// COMPILATION_ERRORS
fun foo(parameter: Int) {
parameter<String, <caret>Int>
}
@@ -0,0 +1,2 @@
Resolved to:
0: (in kotlin) class Intprivate constructor : kotlin.Number(), kotlin.Comparable<kotlin.Int>, java.io.Serializable
@@ -0,0 +1,6 @@
// COMPILATION_ERRORS
val property: Int = 10
fun foo() {
property<<caret>Int>
}
@@ -0,0 +1,2 @@
Resolved to:
0: (in kotlin) class Intprivate constructor : kotlin.Number(), kotlin.Comparable<kotlin.Int>, java.io.Serializable
@@ -0,0 +1,6 @@
// COMPILATION_ERRORS
val property: Int = 10
fun foo() {
property<Int, <caret>String>
}
@@ -0,0 +1,2 @@
Resolved to:
0: (in kotlin) class String : kotlin.Comparable<kotlin.String>, kotlin.CharSequence, java.io.Serializable
@@ -0,0 +1,7 @@
// COMPILATION_ERRORS
val property: Int
get() = 10
fun foo() {
property<<caret>Int>
}
@@ -0,0 +1,2 @@
Resolved to:
0: (in kotlin) class Intprivate constructor : kotlin.Number(), kotlin.Comparable<kotlin.Int>, java.io.Serializable
@@ -0,0 +1,7 @@
// COMPILATION_ERRORS
val property: Int
get() = 10
fun foo() {
property<Int, <caret>String>
}
@@ -0,0 +1,2 @@
Resolved to:
0: (in kotlin) class String : kotlin.Comparable<kotlin.String>, kotlin.CharSequence, java.io.Serializable
@@ -0,0 +1,4 @@
// COMPILATION_ERRORS
fun foo() {
unresolved<<caret>String>
}
@@ -0,0 +1,2 @@
Resolved to:
0: (in kotlin) class String : kotlin.Comparable<kotlin.String>, kotlin.CharSequence, java.io.Serializable