KtLightMethod: isVarArgs() does not trigger exact delegate computation
This commit is contained in:
+1
-1
@@ -214,7 +214,7 @@ class KtLightMethodImpl private constructor(
|
||||
|
||||
override fun hasTypeParameters() = clsDelegate.hasTypeParameters()
|
||||
|
||||
override fun isVarArgs() = clsDelegate.isVarArgs
|
||||
override fun isVarArgs() = (dummyDelegate ?: clsDelegate).isVarArgs
|
||||
|
||||
override fun isConstructor() = dummyDelegate?.isConstructor ?: clsDelegate.isConstructor
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
public final class C {
|
||||
public final void f(@org.jetbrains.annotations.NotNull int... i) { /* compiled code */ }
|
||||
|
||||
public final void p(int i, @org.jetbrains.annotations.NotNull java.lang.String... s) { /* compiled code */ }
|
||||
|
||||
public C() { /* compiled code */ }
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// C
|
||||
|
||||
class C {
|
||||
|
||||
fun f(vararg i: Int) {
|
||||
|
||||
}
|
||||
|
||||
fun p(i: Int, vararg s: String) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -84,6 +84,12 @@ public class CompilerLightClassTestGenerated extends AbstractCompilerLightClassT
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("VarArgs.kt")
|
||||
public void testVarArgs() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/VarArgs.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/asJava/lightClasses/compilationErrors")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
@@ -225,13 +225,14 @@ object LightClassLazinessChecker {
|
||||
val name: String,
|
||||
val modifiers: List<String>,
|
||||
val isConstructor: Boolean,
|
||||
val parameterCount: Int
|
||||
val parameterCount: Int,
|
||||
val isVarargs: Boolean
|
||||
)
|
||||
|
||||
private fun methodInfo(method: PsiMethod) = with(method) {
|
||||
MethodInfo(
|
||||
name, PsiModifier.MODIFIERS.asList().filter { modifierList.hasModifierProperty(it) },
|
||||
isConstructor, method.parameterList.parametersCount
|
||||
isConstructor, method.parameterList.parametersCount, isVarArgs
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
+6
@@ -84,6 +84,12 @@ public class IdeCompiledLightClassTestGenerated extends AbstractIdeCompiledLight
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("VarArgs.kt")
|
||||
public void testVarArgs() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/VarArgs.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/asJava/lightClasses/delegation")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
@@ -84,6 +84,12 @@ public class IdeLightClassTestGenerated extends AbstractIdeLightClassTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("VarArgs.kt")
|
||||
public void testVarArgs() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/VarArgs.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/asJava/lightClasses/compilationErrors")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
Reference in New Issue
Block a user