LightClassTest: test corner cases related to inherited visiblity
EA-99155 #KT-16899 Fixed
This commit is contained in:
+6
@@ -0,0 +1,6 @@
|
||||
package p
|
||||
|
||||
abstract class A {
|
||||
internal val ap: Int = 4
|
||||
internal fun af(): Int
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
public final class C extends p.A {
|
||||
public int getAp$production_sources_for_module_light_idea_test_case() { /* compiled code */ }
|
||||
|
||||
public int af$production_sources_for_module_light_idea_test_case() { /* compiled code */ }
|
||||
|
||||
public C() { /* compiled code */ }
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// p.C
|
||||
package p
|
||||
|
||||
class C : A() {
|
||||
override val ap: Int
|
||||
get() = super.c
|
||||
|
||||
override fun af(): Int {
|
||||
return super.foo()
|
||||
}
|
||||
}
|
||||
|
||||
// LAZINESS:NoConsistency
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package p
|
||||
|
||||
abstract class A {
|
||||
open internal val ap: Int = 4
|
||||
abstract internal fun af(): Int
|
||||
}
|
||||
|
||||
interface I {
|
||||
internal val ip: Int
|
||||
internal fun if(): Int
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
public final class C extends p.A implements p.I {
|
||||
private final int ip = 5;
|
||||
|
||||
public int getAp$production_sources_for_module_light_idea_test_case() { /* compiled code */ }
|
||||
|
||||
public int af$production_sources_for_module_light_idea_test_case() { /* compiled code */ }
|
||||
|
||||
public int getIp$production_sources_for_module_light_idea_test_case() { /* compiled code */ }
|
||||
|
||||
public int $$<no name provided>$production_sources_for_module_light_idea_test_case /* Real name is '<no name provided>$production_sources_for_module_light_idea_test_case' */() { /* compiled code */ }
|
||||
|
||||
public C() { /* compiled code */ }
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// p.C
|
||||
package p
|
||||
|
||||
class C : A(), I {
|
||||
override val ap: Int
|
||||
get() = super.c
|
||||
|
||||
override fun af(): Int {
|
||||
return super.foo()
|
||||
}
|
||||
|
||||
override val ip = 5
|
||||
override fun if() = 5
|
||||
}
|
||||
|
||||
// LAZINESS:NoLaziness
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package p
|
||||
|
||||
abstract class A {
|
||||
protected val ap: Int = 4
|
||||
abstract protected fun af(): Int
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
public final class C extends p.A {
|
||||
protected int getAp() { /* compiled code */ }
|
||||
|
||||
protected int af() { /* compiled code */ }
|
||||
|
||||
public C() { /* compiled code */ }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// p.C
|
||||
package p
|
||||
|
||||
class C : A() {
|
||||
override val ap: Int
|
||||
get() = super.c
|
||||
|
||||
override fun af(): Int {
|
||||
return super.foo()
|
||||
}
|
||||
}
|
||||
|
||||
// LAZINESS:NoLaziness
|
||||
@@ -33,7 +33,7 @@ import java.util.regex.Pattern;
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public class CompilerLightClassTestGenerated extends AbstractCompilerLightClassTest {
|
||||
public void testAllFilesPresentInLightClasses() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/asJava/lightClasses"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true, "local");
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/asJava/lightClasses"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true, "local", "ideRegression");
|
||||
}
|
||||
|
||||
@TestMetadata("AnnotationClass.kt")
|
||||
@@ -98,6 +98,12 @@ public class CompilerLightClassTestGenerated extends AbstractCompilerLightClassT
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("PrivateInTrait.kt")
|
||||
public void testPrivateInTrait() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/compilationErrors/PrivateInTrait.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("SameName.kt")
|
||||
public void testSameName() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/compilationErrors/SameName.kt");
|
||||
@@ -110,6 +116,12 @@ public class CompilerLightClassTestGenerated extends AbstractCompilerLightClassT
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("TraitClassObjectField.kt")
|
||||
public void testTraitClassObjectField() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/compilationErrors/TraitClassObjectField.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("WrongAnnotations.kt")
|
||||
public void testWrongAnnotations() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/compilationErrors/WrongAnnotations.kt");
|
||||
@@ -263,12 +275,6 @@ public class CompilerLightClassTestGenerated extends AbstractCompilerLightClassT
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("PrivateInTrait.NoCompile.kt")
|
||||
public void testPrivateInTrait_NoCompile() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/PrivateInTrait.NoCompile.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("Synthetic.kt")
|
||||
public void testSynthetic() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/Synthetic.kt");
|
||||
@@ -281,12 +287,6 @@ public class CompilerLightClassTestGenerated extends AbstractCompilerLightClassT
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("TraitClassObjectField.NoCompile.kt")
|
||||
public void testTraitClassObjectField_NoCompile() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/TraitClassObjectField.NoCompile.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("UnitAsGenericArgument.kt")
|
||||
public void testUnitAsGenericArgument() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/UnitAsGenericArgument.kt");
|
||||
|
||||
Reference in New Issue
Block a user