Analysis API: fix some compilation errors in reference resolve testdata

This commit is contained in:
Ilya Kirillov
2022-01-25 15:29:09 +01:00
parent d926dda27f
commit 96e1f1e7d4
41 changed files with 62 additions and 53 deletions
@@ -3,7 +3,7 @@ package test
annotation class Annotation
fun test() {
<caret>Annotation fun some() {
@<caret>Annotation fun some() {
}
}
@@ -1,2 +1,2 @@
Resolved to:
0: (in test) annotation class Annotation
0: (in test.Annotation) constructor()
@@ -1,4 +1,4 @@
@file:[kotlin.<caret>Deprecated("message")]
@file:[kotlin.<caret>Suppress("message")]
package foo
@@ -1,2 +1,2 @@
Resolved to:
0: (in kotlin.Deprecated) constructor(message: kotlin.String, replaceWith: kotlin.ReplaceWith = ..., level: kotlin.DeprecationLevel = ...)
0: (in kotlin.Suppress) constructor(vararg names: kotlin.String)
@@ -1,6 +1,6 @@
@file:[<caret>D("message")]
@file:[<caret>S("message")]
package foo
import kotlin.Deprecated as D
import kotlin.Suppress as S
@@ -1,2 +1,2 @@
Resolved to:
0: (in kotlin.Deprecated) constructor(message: kotlin.String, replaceWith: kotlin.ReplaceWith = ..., level: kotlin.DeprecationLevel = ...)
0: (in kotlin.Suppress) constructor(vararg names: kotlin.String)
@@ -3,6 +3,8 @@ package testing
annotation class Annotation<T>(val clazz: Class<T>)
class ATest
@[Annotation<ATest>(javaClass<<caret>ATest>())]
class A<T>
@[Annotation<ATest>(A<<caret>ATest>())]
class BTest
@@ -3,6 +3,6 @@ package testing
annotation class Annotation<T>(val clazz: Class<T>)
class ATest
@[Annotation<<caret>ATest>(ATest::class.java)]
@[Annotation<<caret>ATest>(ATest::class)]
class BTest
@@ -2,7 +2,7 @@ package t
class A {
companion object Named {
val i: Int
val i: Int = 10
}
}
@@ -1,9 +1,9 @@
package ctrl_click
fun IntArray(vararg content : Int) : IntArray = content
fun <T> array(vararg t : T) : Array<T> = t
fun IntArray(vararg content : String) : Array<out String> = content
inline fun <reified T> array(vararg t : T) : Array<T> = arrayOf(*t)
fun main(args : Array<String>) {
var a = <caret>IntArray(array(1, 2, 3))
var a = <caret>IntArray(*array("1", "2", "3"))
}
@@ -1,2 +1,2 @@
Resolved to:
0: (in ctrl_click) fun IntArray(vararg content: kotlin.Int): kotlin.IntArray
0: (in ctrl_click) fun IntArray(vararg content: kotlin.String): kotlin.Array<out kotlin.String>
@@ -2,7 +2,7 @@ package t
class A {
companion object Companion {
fun test()
fun test() {}
}
}
@@ -3,7 +3,7 @@ package test
class A
object b {
companion object {
class object {
val x = <caret>A()
}
}
@@ -1,7 +1,7 @@
// FILE: main.kt
class A {
fun foo() {
<caret>JavaClass()
<caret>JavaClass("")
}
}
@@ -2,7 +2,7 @@ package a
class A {
companion object Named {
val i: Int
val i: Int = 1
}
}
@@ -13,7 +13,7 @@ fun JavaClass.foo(javaClass: JavaClass) {
}
// FILE: JavaClass.java
class JavaClass {
public class JavaClass {
public int getSomething() { return 1; }
public void setSomething(int value) {}
}
@@ -1,5 +1,5 @@
class Generic<T> {
class Nested
inner class Nested
}
class C {
@@ -12,4 +12,10 @@ interface Zoo {
operator fun setValue(p1: Any?, p2: Any?, p3: Any?)
}
class Baz: Foo, Bar, Zoo
class Baz: Foo, Bar, Zoo {
override fun getValue(p1: Any?, p2: Any?): Int = TODO("")
override fun setValue(p1: Any?, p2: Any?, p3: Any?) {
TODO("")
}
}
@@ -1,3 +1,3 @@
Resolved to:
0: (in Baz) open operator fun getValue(p1: kotlin.Any?, p2: kotlin.Any?): kotlin.Int
1: (in Zoo) operator fun setValue(p1: kotlin.Any?, p2: kotlin.Any?, p3: kotlin.Any?)
0: (in Baz) override operator fun getValue(p1: kotlin.Any?, p2: kotlin.Any?): kotlin.Int
1: (in Baz) override operator fun setValue(p1: kotlin.Any?, p2: kotlin.Any?, p3: kotlin.Any?)
@@ -1,4 +1,4 @@
var x : Int <caret>by Baz()
val x : Int <caret>by Baz()
interface Foo {
operator fun getValue(p1: Any?, p2: Any?): Int = 1
@@ -3,9 +3,10 @@ fun test(f: Foo) {
}
interface Foo
fun Foo.iterator(): Iterator
fun Foo.iterator(): Iterator = TODO()
interface Iterator
fun Iterator.next(): Any
fun Iterator.hasNext(): Boolean
fun Iterator.next(): Any= TODO()
fun Iterator.hasNext(): Boolean = TODO()
@@ -3,12 +3,12 @@ fun test(f: Foo) {
}
interface Foo {
fun iterator(): Iterator
operator fun iterator(): Iterator
}
interface Iterator {
fun next(): Any
fun hasNext(): Boolean
operator fun next(): Any
operator fun hasNext(): Boolean
}
// MULTIRESOLVE
@@ -1,4 +1,4 @@
Resolved to:
0: (in Foo) fun iterator(): Iterator
1: (in Iterator) fun hasNext(): kotlin.Boolean
2: (in Iterator) fun next(): kotlin.Any
0: (in Foo) operator fun iterator(): Iterator
1: (in Iterator) operator fun hasNext(): kotlin.Boolean
2: (in Iterator) operator fun next(): kotlin.Any
@@ -3,11 +3,11 @@ fun test(f: Foo) {
}
interface Foo {
fun iterator(): Iterator
operator fun iterator(): Iterator
}
interface Iterator {
fun hasNext(): Boolean
operator fun hasNext(): Boolean
}
// MULTIRESOLVE
@@ -1,3 +1,3 @@
Resolved to:
0: (in Foo) fun iterator(): Iterator
1: (in Iterator) fun hasNext(): kotlin.Boolean
0: (in Foo) operator fun iterator(): Iterator
1: (in Iterator) operator fun hasNext(): kotlin.Boolean
@@ -1,5 +1,5 @@
class Foo {
fun invoke(vararg a: Any) {}
operator fun invoke(vararg a: Any) {}
}
fun test(f: Foo) {
@@ -1,2 +1,2 @@
Resolved to:
0: (in Foo) fun invoke(vararg a: kotlin.Any)
0: (in Foo) operator fun invoke(vararg a: kotlin.Any)
@@ -1,5 +1,5 @@
class Foo {
fun invoke(vararg a: Any) {}
operator fun invoke(vararg a: Any) {}
}
fun test(f: Foo) {
@@ -1,2 +1,2 @@
Resolved to:
0: (in Foo) fun invoke(vararg a: kotlin.Any)
0: (in Foo) operator fun invoke(vararg a: kotlin.Any)
@@ -1,5 +1,5 @@
class Foo {
fun invoke(vararg a: Any) {}
operator fun invoke(vararg a: Any) {}
}
fun test(f: Foo) {
@@ -1,2 +1,2 @@
Resolved to:
0: (in Foo) fun invoke(vararg a: kotlin.Any)
0: (in Foo) operator fun invoke(vararg a: kotlin.Any)
@@ -1,5 +1,5 @@
class Foo {
fun invoke(vararg a: Any) {}
operator fun invoke(vararg a: Any) {}
}
fun test(f: Foo) {
@@ -1,2 +1,2 @@
Resolved to:
0: (in Foo) fun invoke(vararg a: kotlin.Any)
0: (in Foo) operator fun invoke(vararg a: kotlin.Any)
@@ -1,3 +1,3 @@
fun x() {
val z = jav<caret>a.util.ArrayList()
val z = jav<caret>a.util.ArrayList<Int>()
}
@@ -1,3 +1,3 @@
fun x() {
val z = java.uti<caret>l.ArrayList()
val z = java.uti<caret>l.ArrayList<Int>()
}
@@ -1,3 +1,3 @@
fun x() {
val z = kotli<caret>n.text.toString()
val z = kotli<caret>n.text.charset("UTF8")
}
@@ -1,3 +1,3 @@
fun x() {
val z = kotlin.tex<caret>t.toString()
val z = kotlin.tex<caret>t.charset("UTF8")
}
@@ -1,4 +1,4 @@
fun sum(aa: Int, bb: Int) = a + b
fun sum(aa: Int, bb: Int) = aa + bb
fun main() {
println(sum(b<caret>b = 1, aa = 2))
@@ -1,6 +1,6 @@
class Foo {
val String.foo : Any
get() {
this@f<caret>oo
return this@f<caret>oo
}
}
@@ -1,6 +1,6 @@
class Foo {
val String.foo : Any
get() {
t<caret>his@foo
return t<caret>his@foo
}
}
@@ -1 +1 @@
fun <T> function(t: <caret>T) where T : Int, T : Long = TODO()
fun <T> function(t: <caret>T) where T : Int, T : Sequence<Int> = TODO()