[AA] Add tests for KDoc reference resolution of companion object members
^KTIJ-25995
This commit is contained in:
committed by
Space Team
parent
3dbae89cdd
commit
367b84d45e
+12
@@ -0,0 +1,12 @@
|
||||
// UNRESOLVED_REFERENCE
|
||||
|
||||
open class Base {
|
||||
companion object {
|
||||
fun foo() {}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [Child.f<caret>oo]
|
||||
*/
|
||||
class Child : Base() { }
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
class C {
|
||||
class X {
|
||||
companion object {
|
||||
class YY {
|
||||
class ZZ { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [X.YY.Z<caret>Z]
|
||||
*/
|
||||
fun g() {
|
||||
|
||||
}
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
0: (in C.X.Companion.YY) class ZZ
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
class ClassWithCompanion {
|
||||
companion object {
|
||||
fun foo() { }
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [ClassWithCompanion.f<caret>oo]
|
||||
*/
|
||||
fun test() { }
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
0: (in ClassWithCompanion.Companion) fun foo()
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// FILE: ClassWithCompanion.kt
|
||||
|
||||
class ClassWithCompanion {
|
||||
companion object {
|
||||
fun foo() { }
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
/**
|
||||
* [ClassWithCompanion.f<caret>oo]
|
||||
*/
|
||||
fun test() { }
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
0: (in ClassWithCompanion.Companion) fun foo()
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// FILE: ClassWithCompanion.kt
|
||||
package bar
|
||||
|
||||
class ClassWithCompanion {
|
||||
companion object {
|
||||
fun foo() { }
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
import bar.ClassWithCompanion
|
||||
|
||||
/**
|
||||
* [ClassWithCompanion.f<caret>oo]
|
||||
*/
|
||||
fun test() { }
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
0: (in bar.ClassWithCompanion.Companion) fun foo()
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* [Base.f<caret>oo]
|
||||
*/
|
||||
class Base {
|
||||
companion object {
|
||||
fun foo() {}
|
||||
}
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
0: (in Base.Companion) fun foo()
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
open class Base {
|
||||
companion object {
|
||||
fun foo() {}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [Base.f<caret>oo]
|
||||
*/
|
||||
class Child : Base() { }
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
0: (in Base.Companion) fun foo()
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// FILE: Base.kt
|
||||
|
||||
open class Base {
|
||||
companion object {
|
||||
fun foo() {}
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
/**
|
||||
* [Base.f<caret>oo]
|
||||
*/
|
||||
class Child : Base() { }
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
0: (in Base.Companion) fun foo()
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
class C {
|
||||
class X {
|
||||
companion object {
|
||||
class YY {
|
||||
fun aa() {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [X.YY.a<caret>a]
|
||||
*/
|
||||
fun g() {
|
||||
|
||||
}
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
0: (in C.X.Companion.YY) fun aa()
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* [f<caret>oo]
|
||||
*/
|
||||
class Base {
|
||||
companion object {
|
||||
fun foo() {}
|
||||
}
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
0: (in Base.Companion) fun foo()
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// UNRESOLVED_REFERENCE
|
||||
|
||||
open class Base {
|
||||
companion object {
|
||||
fun foo() {}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [f<caret>oo]
|
||||
*/
|
||||
class Child : Base() { }
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
class A {
|
||||
companion object {
|
||||
fun toName(): String = ""
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [A.<caret>toName.length]
|
||||
*/
|
||||
fun foo() {}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
0: (in A.Companion) fun toName(): kotlin.String
|
||||
Reference in New Issue
Block a user