Light classes: do not rely on dummy context when data class autogenerated members conflict with declared members
Fix related issues with nested classes
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
// p.Wrapper
|
||||
package p
|
||||
|
||||
class Wrapper {
|
||||
data class Equals(val code: G) {
|
||||
override fun equals(other: Any?): Boolean = true
|
||||
}
|
||||
|
||||
data class HashCode(val code: G) {
|
||||
override fun hashCode() = 3
|
||||
}
|
||||
|
||||
data class ToString(val code: G) {
|
||||
override fun toString() = "b"
|
||||
}
|
||||
}
|
||||
|
||||
class G
|
||||
|
||||
// LAZINESS:NoLaziness
|
||||
@@ -0,0 +1,13 @@
|
||||
public final class B {
|
||||
public B() { /* compiled code */ }
|
||||
|
||||
public static final class A implements p.I {
|
||||
private final p.I f;
|
||||
|
||||
public A(@org.jetbrains.annotations.NotNull p.I f) { /* compiled code */ }
|
||||
|
||||
public void f() { /* compiled code */ }
|
||||
|
||||
public void g() { /* compiled code */ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// p.B
|
||||
package p
|
||||
|
||||
class B {
|
||||
class A(private val f: I) : I by f {
|
||||
}
|
||||
}
|
||||
|
||||
interface I {
|
||||
fun g()
|
||||
|
||||
fun f()
|
||||
}
|
||||
|
||||
// LAZINESS:NoLaziness
|
||||
@@ -42,6 +42,18 @@ public class CompilerLightClassTestGenerated extends AbstractCompilerLightClassT
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("DataClassWithCustomImplementedMembers.kt")
|
||||
public void testDataClassWithCustomImplementedMembers() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/DataClassWithCustomImplementedMembers.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("DelegatedNested.kt")
|
||||
public void testDelegatedNested() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/DelegatedNested.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("Delegation.kt")
|
||||
public void testDelegation() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/Delegation.kt");
|
||||
|
||||
Reference in New Issue
Block a user