Find Usages: Support primary constructors
#KT-7881 Fixed
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
// PSI_ELEMENT: com.intellij.psi.PsiMethod
|
||||
// OPTIONS: usages
|
||||
// FIND_BY_REF
|
||||
// WITH_FILE_NAME
|
||||
class J extends A {
|
||||
constructor(n: Int) {
|
||||
super(n);
|
||||
}
|
||||
|
||||
static void test() {
|
||||
new A();
|
||||
new <caret>A(1);
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
open class A (n: Int) {
|
||||
constructor(): this(1)
|
||||
}
|
||||
|
||||
class B: A {
|
||||
constructor(n: Int): super(n)
|
||||
}
|
||||
|
||||
class C(): A(1)
|
||||
|
||||
fun test() {
|
||||
A()
|
||||
A(1)
|
||||
}
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
[primaryConstructorByJavaRef.0.java] New instance creation (12: 13) new A(1);
|
||||
[primaryConstructorByJavaRef.0.java] Unclassified usage (7: 9) super(n);
|
||||
[primaryConstructorByJavaRef.1.kt] New instance creation (13: 5) A(1)
|
||||
[primaryConstructorByJavaRef.1.kt] Supertype (9: 12) class C(): A(1)
|
||||
[primaryConstructorByJavaRef.1.kt] Unclassified usage (2: 20) constructor(): this(1)
|
||||
[primaryConstructorByJavaRef.1.kt] Unclassified usage (6: 26) constructor(n: Int): super(n)
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
// PSI_ELEMENT: com.intellij.psi.PsiMethod
|
||||
// OPTIONS: usages
|
||||
// FIND_BY_REF
|
||||
// WITH_FILE_NAME
|
||||
class J extends A {
|
||||
constructor(n: Int) {
|
||||
<caret>super(n);
|
||||
}
|
||||
|
||||
static void test() {
|
||||
new A();
|
||||
new A(1);
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
open class A (n: Int) {
|
||||
constructor(): this(1)
|
||||
}
|
||||
|
||||
class B: A {
|
||||
constructor(n: Int): super(n)
|
||||
}
|
||||
|
||||
class C(): A(1)
|
||||
|
||||
fun test() {
|
||||
A()
|
||||
A(1)
|
||||
}
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
[primaryConstructorByJavaSuperRef.0.java] New instance creation (12: 13) new A(1);
|
||||
[primaryConstructorByJavaSuperRef.0.java] Unclassified usage (7: 9) super(n);
|
||||
[primaryConstructorByJavaSuperRef.1.kt] New instance creation (13: 5) A(1)
|
||||
[primaryConstructorByJavaSuperRef.1.kt] Supertype (9: 12) class C(): A(1)
|
||||
[primaryConstructorByJavaSuperRef.1.kt] Unclassified usage (2: 20) constructor(): this(1)
|
||||
[primaryConstructorByJavaSuperRef.1.kt] Unclassified usage (6: 26) constructor(n: Int): super(n)
|
||||
Reference in New Issue
Block a user