Drop package facades:

- update tests
- cleanup JetTyMapper after rebase
This commit is contained in:
Dmitry Petrov
2015-10-19 15:20:23 +03:00
parent 639300a89d
commit dda508234f
17 changed files with 83 additions and 82 deletions
@@ -177,7 +177,7 @@ public class JetTypeMapper {
}
@NotNull
private String internalNameForPackageMemberOwner(@NotNull CallableMemberDescriptor descriptor, boolean isImplementation) {
private String internalNameForPackageMemberOwner(@NotNull CallableMemberDescriptor descriptor, boolean publicFacade) {
boolean isAccessor = descriptor instanceof AccessorForCallableDescriptor;
if (isAccessor) {
descriptor = ((AccessorForCallableDescriptor) descriptor).getCalleeDescriptor();
@@ -185,7 +185,7 @@ public class JetTypeMapper {
JetFile file = DescriptorToSourceUtils.getContainingFile(descriptor);
if (file != null) {
Visibility visibility = descriptor.getVisibility();
if (isImplementation ||
if (!publicFacade ||
descriptor instanceof PropertyDescriptor ||
Visibilities.isPrivate(visibility) ||
isAccessor/*Cause of KT-9603*/
@@ -7,6 +7,8 @@ public final class Class {
private final java.lang.String notNullVal = "";
@org.jetbrains.annotations.NotNull
private java.lang.String notNullVar;
private final java.lang.String privateNN = "";
private final java.lang.String privateN = "";
@org.jetbrains.annotations.NotNull
public final java.lang.String notNull(@org.jetbrains.annotations.NotNull java.lang.String a) { /* compiled code */ }
@@ -31,4 +31,7 @@ class Class {
var nullableVarWithGetSet: String?
@[NotNull] get() = ""
@[NotNull] set(v) {}
private val privateNN: String = ""
private val privateN: String? = ""
}
@@ -1,4 +1,4 @@
public final class _DefaultPackageKt {
public final class FileFacadeKt {
@org.jetbrains.annotations.Nullable
static final java.lang.String nullableVal = "";
@org.jetbrains.annotations.Nullable
@@ -7,9 +7,7 @@ public final class _DefaultPackageKt {
static final java.lang.String notNullVal = "";
@org.jetbrains.annotations.NotNull
static java.lang.String notNullVar;
@org.jetbrains.annotations.NotNull
static final java.lang.String privateNn = "";
@org.jetbrains.annotations.Nullable
static final java.lang.String privateN = "";
@org.jetbrains.annotations.NotNull
@@ -52,7 +50,13 @@ public final class _DefaultPackageKt {
@org.jetbrains.annotations.NotNull
public static final java.lang.String getNotNullValWithGet() { /* compiled code */ }
@kotlin.jvm.internal.KotlinDelegatedMethod(implementationClassName = "_DefaultPackageKt")
@org.jetbrains.annotations.Nullable
@org.jetbrains.annotations.NotNull
public static final java.lang.String getNotNullVarWithGetSet() { /* compiled code */ }
@org.jetbrains.annotations.Nullable
public static final void setNotNullVarWithGetSet(@org.jetbrains.annotations.NotNull java.lang.String v) { /* compiled code */ }
@org.jetbrains.annotations.NotNull
@org.jetbrains.annotations.Nullable
public static final java.lang.String getNullableValWithGet() { /* compiled code */ }
@@ -64,9 +68,5 @@ public final class _DefaultPackageKt {
@org.jetbrains.annotations.NotNull
public static final void setNullableVarWithGetSet(@org.jetbrains.annotations.Nullable java.lang.String v) { /* compiled code */ }
@org.jetbrains.annotations.NotNull
static final java.lang.String getPrivateNn() { /* compiled code */ }
@org.jetbrains.annotations.Nullable
public static final java.lang.String nullableWithNN() { /* compiled code */ }
private static final java.lang.String privateFun(java.lang.String a, java.lang.String b) { /* compiled code */ }
}
@@ -1,4 +1,4 @@
// _DefaultPackageKt
// FileFacadeKt
import org.jetbrains.annotations.NotNull
import org.jetbrains.annotations.Nullable
@@ -1,61 +1,61 @@
compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$setFoo$p(LA;I)V):
fun `access$setFoo$p`(a: A, d: kotlin.Int): kotlin.Unit
fun <set-foo>(<set-?>: kotlin.Int): kotlin.Unit
compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo$cp()I):
fun <get-foo>(): kotlin.Int
fun `access$getFoo$cp`(): kotlin.Int
class A {
^
compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo$p(LA;)I):
fun `access$getFoo$p`(a: A): kotlin.Int
fun <get-foo>(): kotlin.Int
fun `access$getFoo$p`(a: A): kotlin.Int
class A {
^
compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$setFoo$p(LA;I)V):
fun <set-foo>(<set-?>: kotlin.Int): kotlin.Unit
fun `access$setFoo$p`(a: A, d: kotlin.Int): kotlin.Unit
class A {
^
compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$setFoo$cp(I)V):
fun `access$setFoo$cp`(d: kotlin.Int): kotlin.Unit
fun <set-foo>(<set-?>: kotlin.Int): kotlin.Unit
class A {
^
compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo$cp()I):
fun `access$getFoo$cp`(): kotlin.Int
fun <get-foo>(): kotlin.Int
fun `access$setFoo$cp`(d: kotlin.Int): kotlin.Unit
class A {
^
compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:5:5: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo$p(LA;)I):
fun `access$getFoo$p`(a: A): kotlin.Int
fun <get-foo>(): kotlin.Int
fun `access$getFoo$p`(a: A): kotlin.Int
fun `access$getFoo$p`(a: A): Int = 1
^
compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:6:5: error: platform declaration clash: The following declarations have the same JVM signature (access$setFoo$p(LA;I)V):
fun `access$setFoo$p`(a: A, d: kotlin.Int): kotlin.Unit
fun <set-foo>(<set-?>: kotlin.Int): kotlin.Unit
fun `access$setFoo$p`(a: A, d: kotlin.Int): kotlin.Unit
fun `access$setFoo$p`(a: A, d: Int) {}
^
compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:9:5: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo$cp()I):
fun `access$getFoo$cp`(): kotlin.Int
fun <get-foo>(): kotlin.Int
fun `access$getFoo$cp`(): kotlin.Int
fun `access$getFoo$cp`(): Int = 1
^
compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:10:5: error: platform declaration clash: The following declarations have the same JVM signature (access$setFoo$cp(I)V):
fun `access$setFoo$cp`(d: kotlin.Int): kotlin.Unit
fun <set-foo>(<set-?>: kotlin.Int): kotlin.Unit
fun `access$setFoo$cp`(d: kotlin.Int): kotlin.Unit
fun `access$setFoo$cp`(d: Int) {}
^
compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:12:15: error: platform declaration clash: The following declarations have the same JVM signature (access$setFoo$p(LA$Companion;I)V):
fun `access$setFoo$p`(p: A.Companion, d: kotlin.Int): kotlin.Unit
fun <set-foo>(<set-?>: kotlin.Int): kotlin.Unit
compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:12:15: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo$p(LA$Companion;)I):
fun <get-foo>(): kotlin.Int
fun `access$getFoo$p`(p: A.Companion): kotlin.Int
companion object {
^
compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:12:15: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo$p(LA$Companion;)I):
fun `access$getFoo$p`(p: A.Companion): kotlin.Int
fun <get-foo>(): kotlin.Int
compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:12:15: error: platform declaration clash: The following declarations have the same JVM signature (access$setFoo$p(LA$Companion;I)V):
fun <set-foo>(<set-?>: kotlin.Int): kotlin.Unit
fun `access$setFoo$p`(p: A.Companion, d: kotlin.Int): kotlin.Unit
companion object {
^
compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:22:9: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo$p(LA$Companion;)I):
fun `access$getFoo$p`(p: A.Companion): kotlin.Int
fun <get-foo>(): kotlin.Int
fun `access$getFoo$p`(p: A.Companion): kotlin.Int
fun `access$getFoo$p`(p: A.Companion): Int = 1
^
compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:23:9: error: platform declaration clash: The following declarations have the same JVM signature (access$setFoo$p(LA$Companion;I)V):
fun `access$setFoo$p`(p: A.Companion, d: kotlin.Int): kotlin.Unit
fun <set-foo>(<set-?>: kotlin.Int): kotlin.Unit
fun `access$setFoo$p`(p: A.Companion, d: kotlin.Int): kotlin.Unit
fun `access$setFoo$p`(p: A.Companion, d: Int) {}
^
COMPILATION_ERROR
@@ -1,6 +1,6 @@
compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo(LA;)I):
fun `access$getFoo`(a: A): kotlin.Int
fun getFoo(): kotlin.Int
compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$setFoo$p(LA;I)V):
fun <set-foo>(<set-?>: kotlin.Int): kotlin.Unit
fun `access$setFoo$p`(a: A, d: kotlin.Int): kotlin.Unit
class A {
^
compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$setFoo(LA;I)V):
@@ -8,24 +8,24 @@ compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.kt:1:7:
fun setFoo(i: kotlin.Int): kotlin.Unit
class A {
^
compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo$p(LA;)I):
fun `access$getFoo$p`(a: A): kotlin.Int
fun <get-foo>(): kotlin.Int
compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo(LA;)I):
fun `access$getFoo`(a: A): kotlin.Int
fun getFoo(): kotlin.Int
class A {
^
compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$setFoo$p(LA;I)V):
fun `access$setFoo$p`(a: A, d: kotlin.Int): kotlin.Unit
fun <set-foo>(<set-?>: kotlin.Int): kotlin.Unit
compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo$p(LA;)I):
fun <get-foo>(): kotlin.Int
fun `access$getFoo$p`(a: A): kotlin.Int
class A {
^
compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.kt:5:5: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo$p(LA;)I):
fun `access$getFoo$p`(a: A): kotlin.Int
fun <get-foo>(): kotlin.Int
fun `access$getFoo$p`(a: A): kotlin.Int
fun `access$getFoo$p`(a: A): Int = 1
^
compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.kt:6:5: error: platform declaration clash: The following declarations have the same JVM signature (access$setFoo$p(LA;I)V):
fun `access$setFoo$p`(a: A, d: kotlin.Int): kotlin.Unit
fun <set-foo>(<set-?>: kotlin.Int): kotlin.Unit
fun `access$setFoo$p`(a: A, d: kotlin.Int): kotlin.Unit
fun `access$setFoo$p`(a: A, d: Int) {}
^
compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.kt:11:5: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo(LA;)I):
+10 -10
View File
@@ -3,29 +3,29 @@ compiler/testData/cli/jvm/syntheticAccessorSignatureClash.kt:15:5: error: accide
fun foo(): kotlin.Unit
private fun foo() {}
^
compiler/testData/cli/jvm/syntheticAccessorSignatureClash.kt:18:9: error: accidental override: The following declarations have the same JVM signature (access$getBar$1(LDerived;)I):
compiler/testData/cli/jvm/syntheticAccessorSignatureClash.kt:18:9: error: accidental override: The following declarations have the same JVM signature (access$getBar$p(LDerived;)I):
fun <get-bar>(): kotlin.Int
fun `access$getBar$1`(d: Derived): kotlin.Int
fun `access$getBar$p`(d: Derived): kotlin.Int
get
^
compiler/testData/cli/jvm/syntheticAccessorSignatureClash.kt:19:9: error: accidental override: The following declarations have the same JVM signature (access$setBar$1(LDerived;I)V):
compiler/testData/cli/jvm/syntheticAccessorSignatureClash.kt:19:9: error: accidental override: The following declarations have the same JVM signature (access$setBar$p(LDerived;I)V):
fun <set-bar>(<set-?>: kotlin.Int): kotlin.Unit
fun `access$setBar$1`(d: Derived, i: kotlin.Int): kotlin.Unit
fun `access$setBar$p`(d: Derived, i: kotlin.Int): kotlin.Unit
set
^
compiler/testData/cli/jvm/syntheticAccessorSignatureClash.kt:21:5: error: accidental override: The following declarations have the same JVM signature (access$getBaz$2(LDerived;)I):
compiler/testData/cli/jvm/syntheticAccessorSignatureClash.kt:21:5: error: accidental override: The following declarations have the same JVM signature (access$getBaz$p(LDerived;)I):
fun <get-baz>(): kotlin.Int
fun `access$getBaz$2`(d: Derived): kotlin.Int
fun `access$getBaz$p`(d: Derived): kotlin.Int
private var baz = 1
^
compiler/testData/cli/jvm/syntheticAccessorSignatureClash.kt:23:5: error: accidental override: The following declarations have the same JVM signature (access$getBoo$3(LDerived;)I):
compiler/testData/cli/jvm/syntheticAccessorSignatureClash.kt:23:5: error: accidental override: The following declarations have the same JVM signature (access$getBoo$p(LDerived;)I):
fun <get-boo>(): kotlin.Int
fun `access$getBoo$3`(d: Derived): kotlin.Int
fun `access$getBoo$p`(d: Derived): kotlin.Int
private val boo = 1
^
compiler/testData/cli/jvm/syntheticAccessorSignatureClash.kt:27:9: error: accidental override: The following declarations have the same JVM signature (access$setBar1$4(LDerived;I)V):
compiler/testData/cli/jvm/syntheticAccessorSignatureClash.kt:27:9: error: accidental override: The following declarations have the same JVM signature (access$setBar1$p(LDerived;I)V):
fun <set-bar1>(<set-?>: kotlin.Int): kotlin.Unit
fun `access$setBar1$4`(d: Derived, i: kotlin.Int): kotlin.Unit
fun `access$setBar1$p`(d: Derived, i: kotlin.Int): kotlin.Unit
set
^
COMPILATION_ERROR
@@ -12,6 +12,6 @@ fun test() {
// 2 ILOAD
// 2 ASTORE
// 5 ALOAD
// 2 MAXLOCALS = 3
// 1 MAXLOCALS = 3
// 1 MAXLOCALS = 4
// 0 InlineMarker
@@ -121,6 +121,12 @@ public class CompilerLightClassTestGenerated extends AbstractCompilerLightClassT
doTest(fileName);
}
@TestMetadata("FileFacade.kt")
public void testFileFacade() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/FileFacade.kt");
doTest(fileName);
}
@TestMetadata("Generic.kt")
public void testGeneric() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/Generic.kt");
@@ -210,12 +216,6 @@ public class CompilerLightClassTestGenerated extends AbstractCompilerLightClassT
String fileName = JetTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/VoidReturn.kt");
doTest(fileName);
}
@TestMetadata("_DefaultPackage.kt")
public void test_DefaultPackage() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/_DefaultPackage.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/asJava/lightClasses/object")
@@ -1,3 +1,4 @@
Function a.test uses package-private class a.Foo
Function a.test uses package-private function a.foo
Package-private function a.test will no longer be accessible from function a.bar
Package-private function a.test will no longer be accessible from function a.bar
Package-private function a.test will no longer be accessible from method J.bar()
@@ -1,3 +1,4 @@
Package-private property a.test will no longer be accessible from function a.bar
Package-private property a.test will no longer be accessible from method J.bar()
Property a.test uses package-private class a.Foo
Property a.test uses package-private function a.foo
@@ -94,6 +94,12 @@ public class IdeLightClassTestGenerated extends AbstractIdeLightClassTest {
doTest(fileName);
}
@TestMetadata("FileFacade.kt")
public void testFileFacade() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/FileFacade.kt");
doTest(fileName);
}
@TestMetadata("Generic.kt")
public void testGeneric() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/Generic.kt");
@@ -183,12 +189,6 @@ public class IdeLightClassTestGenerated extends AbstractIdeLightClassTest {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/VoidReturn.kt");
doTest(fileName);
}
@TestMetadata("_DefaultPackage.kt")
public void test_DefaultPackage() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/_DefaultPackage.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/asJava/lightClasses/object")
@@ -8,7 +8,6 @@ End of files
Cleaning output files:
out/production/module1/META-INF/module1.kotlin_module
out/production/module1/test/Module1_constKt.class
out/production/module1/test/TestPackage.class
End of files
Compiling files:
module1/src/module1_const.kt
@@ -18,4 +17,4 @@ out/production/module2/usage/Usage.class
End of files
Compiling files:
module2/src/module2_usage.kt
End of files
End of files
@@ -17,10 +17,9 @@ End of files
Cleaning output files:
out/production/module/META-INF/module.kotlin_module
out/production/module/test/ConstKt.class
out/production/module/test/TestPackage.class
out/production/module/test/Usage.class
End of files
Compiling files:
src/const.kt
src/usage.kt
End of files
End of files
@@ -8,10 +8,9 @@ End of files
Cleaning output files:
out/production/module/META-INF/module.kotlin_module
out/production/module/test/ConstKt.class
out/production/module/test/TestPackage.class
out/production/module/test/Usage.class
End of files
Compiling files:
src/const.kt
src/usage.kt
End of files
End of files
@@ -5,10 +5,7 @@ End of files
Compiling files:
src/prop2.kt
End of files
Cleaning output files:
out/production/module/META-INF/module.kotlin_module
out/production/module/test/Prop1Kt.class
End of files
Compiling files:
src/prop1.kt
End of files
COMPILATION FAILED
Platform declaration clash: The following declarations have the same JVM signature (getProperty()I):
fun <get-property>(): kotlin.Int
fun <get-property>(): kotlin.Int