[SLC] Ignore callables with invalid or absent names (KTIJ-23584)
This commit is contained in:
+3
-3
@@ -193,9 +193,8 @@ internal fun SymbolLightClassBase.createMethods(
|
|||||||
when (declaration) {
|
when (declaration) {
|
||||||
is KtFunctionSymbol -> {
|
is KtFunctionSymbol -> {
|
||||||
// TODO: check if it has expect modifier
|
// TODO: check if it has expect modifier
|
||||||
if (declaration.hasReifiedParameters ||
|
if (declaration.hasReifiedParameters || declaration.isHiddenOrSynthetic()) return
|
||||||
declaration.isHiddenOrSynthetic()
|
if (declaration.name.isSpecial) return
|
||||||
) return
|
|
||||||
|
|
||||||
result.add(
|
result.add(
|
||||||
SymbolLightSimpleMethod(
|
SymbolLightSimpleMethod(
|
||||||
@@ -272,6 +271,7 @@ internal fun SymbolLightClassBase.createPropertyAccessors(
|
|||||||
) {
|
) {
|
||||||
if (declaration is KtKotlinPropertySymbol && declaration.isConst) return
|
if (declaration is KtKotlinPropertySymbol && declaration.isConst) return
|
||||||
if (declaration.origin == KtSymbolOrigin.SOURCE_MEMBER_GENERATED) return
|
if (declaration.origin == KtSymbolOrigin.SOURCE_MEMBER_GENERATED) return
|
||||||
|
if (declaration.name.isSpecial) return
|
||||||
|
|
||||||
if (declaration.visibility.isPrivateOrPrivateToThis() &&
|
if (declaration.visibility.isPrivateOrPrivateToThis() &&
|
||||||
declaration.getter?.hasBody == false &&
|
declaration.getter?.hasBody == false &&
|
||||||
|
|||||||
+12
@@ -285,6 +285,12 @@ public class SymbolLightClassesForSourceTestGenerated extends AbstractSymbolLigh
|
|||||||
runTest("compiler/testData/asJava/lightClasses/compilationErrors/ExpectedNestedClassInObject.kt");
|
runTest("compiler/testData/asJava/lightClasses/compilationErrors/ExpectedNestedClassInObject.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("FunctionWithoutName.kt")
|
||||||
|
public void testFunctionWithoutName() throws Exception {
|
||||||
|
runTest("compiler/testData/asJava/lightClasses/compilationErrors/FunctionWithoutName.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("JvmPackageName.kt")
|
@TestMetadata("JvmPackageName.kt")
|
||||||
public void testJvmPackageName() throws Exception {
|
public void testJvmPackageName() throws Exception {
|
||||||
@@ -303,6 +309,12 @@ public class SymbolLightClassesForSourceTestGenerated extends AbstractSymbolLigh
|
|||||||
runTest("compiler/testData/asJava/lightClasses/compilationErrors/PrivateInTrait.kt");
|
runTest("compiler/testData/asJava/lightClasses/compilationErrors/PrivateInTrait.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("PropertyWithoutName.kt")
|
||||||
|
public void testPropertyWithoutName() throws Exception {
|
||||||
|
runTest("compiler/testData/asJava/lightClasses/compilationErrors/PropertyWithoutName.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("RepetableAnnotations.kt")
|
@TestMetadata("RepetableAnnotations.kt")
|
||||||
public void testRepetableAnnotations() throws Exception {
|
public void testRepetableAnnotations() throws Exception {
|
||||||
|
|||||||
+12
@@ -285,6 +285,12 @@ public class SymbolLightClassesParentingForSourceTestGenerated extends AbstractS
|
|||||||
runTest("compiler/testData/asJava/lightClasses/compilationErrors/ExpectedNestedClassInObject.kt");
|
runTest("compiler/testData/asJava/lightClasses/compilationErrors/ExpectedNestedClassInObject.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("FunctionWithoutName.kt")
|
||||||
|
public void testFunctionWithoutName() throws Exception {
|
||||||
|
runTest("compiler/testData/asJava/lightClasses/compilationErrors/FunctionWithoutName.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("JvmPackageName.kt")
|
@TestMetadata("JvmPackageName.kt")
|
||||||
public void testJvmPackageName() throws Exception {
|
public void testJvmPackageName() throws Exception {
|
||||||
@@ -303,6 +309,12 @@ public class SymbolLightClassesParentingForSourceTestGenerated extends AbstractS
|
|||||||
runTest("compiler/testData/asJava/lightClasses/compilationErrors/PrivateInTrait.kt");
|
runTest("compiler/testData/asJava/lightClasses/compilationErrors/PrivateInTrait.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("PropertyWithoutName.kt")
|
||||||
|
public void testPropertyWithoutName() throws Exception {
|
||||||
|
runTest("compiler/testData/asJava/lightClasses/compilationErrors/PropertyWithoutName.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("RepetableAnnotations.kt")
|
@TestMetadata("RepetableAnnotations.kt")
|
||||||
public void testRepetableAnnotations() throws Exception {
|
public void testRepetableAnnotations() throws Exception {
|
||||||
|
|||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
public abstract interface Foo /* test.Foo*/ {
|
||||||
|
@org.jetbrains.annotations.NotNull()
|
||||||
|
public abstract java.lang.String foo();// foo()
|
||||||
|
|
||||||
|
}
|
||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
public abstract interface Foo /* test.Foo*/ {
|
||||||
|
@org.jetbrains.annotations.NotNull()
|
||||||
|
public abstract java.lang.String foo();// foo()
|
||||||
|
|
||||||
|
public abstract int <no name provided>();// <no name provided>()
|
||||||
|
|
||||||
|
}
|
||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
// test.Foo
|
||||||
|
package test
|
||||||
|
|
||||||
|
interface Foo {
|
||||||
|
fun foo(): String
|
||||||
|
fun (): Int
|
||||||
|
}
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
public abstract interface Foo /* test.Foo*/ {
|
||||||
|
@org.jetbrains.annotations.NotNull()
|
||||||
|
public abstract java.lang.String getFoo();// getFoo()
|
||||||
|
|
||||||
|
}
|
||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
// test.Foo
|
||||||
|
package test
|
||||||
|
|
||||||
|
interface Foo {
|
||||||
|
val foo: String
|
||||||
|
val
|
||||||
|
}
|
||||||
-2
@@ -3,8 +3,6 @@ public final class C /* p.C*/ {
|
|||||||
|
|
||||||
public C();// .ctor()
|
public C();// .ctor()
|
||||||
|
|
||||||
public int <no name provided>();// <no name provided>()
|
|
||||||
|
|
||||||
public int af();// af()
|
public int af();// af()
|
||||||
|
|
||||||
public int getAp();// getAp()
|
public int getAp();// getAp()
|
||||||
|
|||||||
-80
@@ -1,80 +0,0 @@
|
|||||||
public final class FileFacadeKt /* FileFacadeKt*/ {
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
|
||||||
private static final java.lang.String notNullVal;
|
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
|
||||||
private static final java.lang.String privateNn;
|
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
|
||||||
private static java.lang.String notNullVar;
|
|
||||||
|
|
||||||
@org.jetbrains.annotations.Nullable()
|
|
||||||
private static final java.lang.String nullableVal;
|
|
||||||
|
|
||||||
@org.jetbrains.annotations.Nullable()
|
|
||||||
private static final java.lang.String privateN;
|
|
||||||
|
|
||||||
@org.jetbrains.annotations.Nullable()
|
|
||||||
private static java.lang.String nullableVar;
|
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
|
||||||
@org.jetbrains.annotations.Nullable()
|
|
||||||
public static final java.lang.String getNotNullValWithGet();// getNotNullValWithGet()
|
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
|
||||||
@org.jetbrains.annotations.Nullable()
|
|
||||||
public static final java.lang.String getNotNullVarWithGetSet();// getNotNullVarWithGetSet()
|
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
|
||||||
@org.jetbrains.annotations.Nullable()
|
|
||||||
public static final java.lang.String getNullableValWithGet();// getNullableValWithGet()
|
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
|
||||||
@org.jetbrains.annotations.Nullable()
|
|
||||||
public static final java.lang.String getNullableVarWithGetSet();// getNullableVarWithGetSet()
|
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
|
||||||
@org.jetbrains.annotations.Nullable()
|
|
||||||
public static final java.lang.String notNullWithN();// notNullWithN()
|
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
|
||||||
@org.jetbrains.annotations.Nullable()
|
|
||||||
public static final java.lang.String nullableWithNN();// nullableWithNN()
|
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
|
||||||
public static final java.lang.String getNotNullVal();// getNotNullVal()
|
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
|
||||||
public static final java.lang.String getNotNullVar();// getNotNullVar()
|
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
|
||||||
public static final java.lang.String notNull(@org.jetbrains.annotations.NotNull() java.lang.String);// notNull(java.lang.String)
|
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
|
||||||
public static final java.lang.String notNullWithNN();// notNullWithNN()
|
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
|
||||||
public static final void setNullableVarWithGetSet(@org.jetbrains.annotations.Nullable() java.lang.String);// setNullableVarWithGetSet(java.lang.String)
|
|
||||||
|
|
||||||
@org.jetbrains.annotations.Nullable()
|
|
||||||
public static final java.lang.String getNullableVal();// getNullableVal()
|
|
||||||
|
|
||||||
@org.jetbrains.annotations.Nullable()
|
|
||||||
public static final java.lang.String getNullableVar();// getNullableVar()
|
|
||||||
|
|
||||||
@org.jetbrains.annotations.Nullable()
|
|
||||||
public static final java.lang.String nullable(@org.jetbrains.annotations.Nullable() java.lang.String);// nullable(java.lang.String)
|
|
||||||
|
|
||||||
@org.jetbrains.annotations.Nullable()
|
|
||||||
public static final java.lang.String nullableWithN();// nullableWithN()
|
|
||||||
|
|
||||||
@org.jetbrains.annotations.Nullable()
|
|
||||||
public static final void setNotNullVarWithGetSet(@org.jetbrains.annotations.NotNull() java.lang.String);// setNotNullVarWithGetSet(java.lang.String)
|
|
||||||
|
|
||||||
private static final java.lang.String privateFun(java.lang.String, java.lang.String);// privateFun(java.lang.String, java.lang.String)
|
|
||||||
|
|
||||||
public static final void setNotNullVar(@org.jetbrains.annotations.NotNull() java.lang.String);// setNotNullVar(java.lang.String)
|
|
||||||
|
|
||||||
public static final void setNullableVar(@org.jetbrains.annotations.Nullable() java.lang.String);// setNullableVar(java.lang.String)
|
|
||||||
|
|
||||||
}
|
|
||||||
+10
@@ -251,6 +251,11 @@ public class CompilerLightClassTestGenerated extends AbstractCompilerLightClassT
|
|||||||
runTest("compiler/testData/asJava/lightClasses/compilationErrors/ExpectedNestedClassInObject.kt");
|
runTest("compiler/testData/asJava/lightClasses/compilationErrors/ExpectedNestedClassInObject.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("FunctionWithoutName.kt")
|
||||||
|
public void testFunctionWithoutName() throws Exception {
|
||||||
|
runTest("compiler/testData/asJava/lightClasses/compilationErrors/FunctionWithoutName.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("JvmPackageName.kt")
|
@TestMetadata("JvmPackageName.kt")
|
||||||
public void testJvmPackageName() throws Exception {
|
public void testJvmPackageName() throws Exception {
|
||||||
runTest("compiler/testData/asJava/lightClasses/compilationErrors/JvmPackageName.kt");
|
runTest("compiler/testData/asJava/lightClasses/compilationErrors/JvmPackageName.kt");
|
||||||
@@ -266,6 +271,11 @@ public class CompilerLightClassTestGenerated extends AbstractCompilerLightClassT
|
|||||||
runTest("compiler/testData/asJava/lightClasses/compilationErrors/PrivateInTrait.kt");
|
runTest("compiler/testData/asJava/lightClasses/compilationErrors/PrivateInTrait.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("PropertyWithoutName.kt")
|
||||||
|
public void testPropertyWithoutName() throws Exception {
|
||||||
|
runTest("compiler/testData/asJava/lightClasses/compilationErrors/PropertyWithoutName.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("RepetableAnnotations.kt")
|
@TestMetadata("RepetableAnnotations.kt")
|
||||||
public void testRepetableAnnotations() throws Exception {
|
public void testRepetableAnnotations() throws Exception {
|
||||||
runTest("compiler/testData/asJava/lightClasses/compilationErrors/RepetableAnnotations.kt");
|
runTest("compiler/testData/asJava/lightClasses/compilationErrors/RepetableAnnotations.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user