JS: add test to prove that KT-14419 is not more reproducible. Add test to prove that extension delegate with extension getValue is translated correctly.
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
|||||||
|
open class C
|
||||||
|
|
||||||
|
object O : C()
|
||||||
|
|
||||||
|
object K : C()
|
||||||
|
|
||||||
|
class D(val value: String) {
|
||||||
|
operator fun getValue(thisRef: C, property: Any): String = value
|
||||||
|
}
|
||||||
|
|
||||||
|
val O.prop by D("O")
|
||||||
|
val K.prop by D("K")
|
||||||
|
|
||||||
|
fun box() = O.prop + K.prop
|
||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
class A(val o: String)
|
||||||
|
|
||||||
|
interface I {
|
||||||
|
val k: String
|
||||||
|
}
|
||||||
|
|
||||||
|
inline operator fun A.getValue(thisRef: I, property: Any): String = o + thisRef.k
|
||||||
|
|
||||||
|
class B(override val k: String) : I
|
||||||
|
|
||||||
|
val B.prop by A("O")
|
||||||
|
|
||||||
|
fun box() = B("K").prop
|
||||||
Vendored
+33
@@ -0,0 +1,33 @@
|
|||||||
|
public class C {
|
||||||
|
public method <init>(): void
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public final class D {
|
||||||
|
private final @org.jetbrains.annotations.NotNull field value: java.lang.String
|
||||||
|
public method <init>(@org.jetbrains.annotations.NotNull p0: java.lang.String): void
|
||||||
|
public final @org.jetbrains.annotations.NotNull method getValue(): java.lang.String
|
||||||
|
public final @org.jetbrains.annotations.NotNull method getValue(@org.jetbrains.annotations.NotNull p0: C, @org.jetbrains.annotations.NotNull p1: java.lang.Object): java.lang.String
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public final class ExtensionDelegatesWithSameNamesKt {
|
||||||
|
private synthetic final static field $$delegatedProperties: kotlin.reflect.KProperty[]
|
||||||
|
private final static @org.jetbrains.annotations.NotNull field prop$delegate$1: D
|
||||||
|
private final static @org.jetbrains.annotations.NotNull field prop$delegate: D
|
||||||
|
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||||
|
public final static @org.jetbrains.annotations.NotNull method getProp(@org.jetbrains.annotations.NotNull p0: K): java.lang.String
|
||||||
|
public final static @org.jetbrains.annotations.NotNull method getProp(@org.jetbrains.annotations.NotNull p0: O): java.lang.String
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public final class K {
|
||||||
|
public final static field INSTANCE: K
|
||||||
|
private method <init>(): void
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public final class O {
|
||||||
|
public final static field INSTANCE: O
|
||||||
|
private method <init>(): void
|
||||||
|
}
|
||||||
compiler/testData/codegen/light-analysis/delegatedProperty/extensionPropertyAndExtensionGetValue.txt
Vendored
+26
@@ -0,0 +1,26 @@
|
|||||||
|
public final class A {
|
||||||
|
private final @org.jetbrains.annotations.NotNull field o: java.lang.String
|
||||||
|
public method <init>(@org.jetbrains.annotations.NotNull p0: java.lang.String): void
|
||||||
|
public final @org.jetbrains.annotations.NotNull method getO(): java.lang.String
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public final class B {
|
||||||
|
private final @org.jetbrains.annotations.NotNull field k: java.lang.String
|
||||||
|
public method <init>(@org.jetbrains.annotations.NotNull p0: java.lang.String): void
|
||||||
|
public @org.jetbrains.annotations.NotNull method getK(): java.lang.String
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public final class ExtensionPropertyAndExtensionGetValueKt {
|
||||||
|
private synthetic final static field $$delegatedProperties: kotlin.reflect.KProperty[]
|
||||||
|
private final static @org.jetbrains.annotations.NotNull field prop$delegate: A
|
||||||
|
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||||
|
public final static @org.jetbrains.annotations.NotNull method getProp(@org.jetbrains.annotations.NotNull p0: B): java.lang.String
|
||||||
|
public final static @org.jetbrains.annotations.NotNull method getValue(@org.jetbrains.annotations.NotNull p0: A, @org.jetbrains.annotations.NotNull p1: I, @org.jetbrains.annotations.NotNull p2: java.lang.Object): java.lang.String
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public interface I {
|
||||||
|
public abstract @org.jetbrains.annotations.NotNull method getK(): java.lang.String
|
||||||
|
}
|
||||||
+12
@@ -5768,6 +5768,18 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("extensionDelegatesWithSameNames.kt")
|
||||||
|
public void testExtensionDelegatesWithSameNames() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/extensionDelegatesWithSameNames.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("extensionPropertyAndExtensionGetValue.kt")
|
||||||
|
public void testExtensionPropertyAndExtensionGetValue() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/extensionPropertyAndExtensionGetValue.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("genericDelegate.kt")
|
@TestMetadata("genericDelegate.kt")
|
||||||
public void testGenericDelegate() throws Exception {
|
public void testGenericDelegate() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/genericDelegate.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/genericDelegate.kt");
|
||||||
|
|||||||
@@ -5768,6 +5768,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("extensionDelegatesWithSameNames.kt")
|
||||||
|
public void testExtensionDelegatesWithSameNames() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/extensionDelegatesWithSameNames.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("extensionPropertyAndExtensionGetValue.kt")
|
||||||
|
public void testExtensionPropertyAndExtensionGetValue() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/extensionPropertyAndExtensionGetValue.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("genericDelegate.kt")
|
@TestMetadata("genericDelegate.kt")
|
||||||
public void testGenericDelegate() throws Exception {
|
public void testGenericDelegate() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/genericDelegate.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/genericDelegate.kt");
|
||||||
|
|||||||
+12
@@ -5768,6 +5768,18 @@ public class LightAnalysisModeCodegenTestGenerated extends AbstractLightAnalysis
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("extensionDelegatesWithSameNames.kt")
|
||||||
|
public void testExtensionDelegatesWithSameNames() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/extensionDelegatesWithSameNames.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("extensionPropertyAndExtensionGetValue.kt")
|
||||||
|
public void testExtensionPropertyAndExtensionGetValue() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/extensionPropertyAndExtensionGetValue.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("genericDelegate.kt")
|
@TestMetadata("genericDelegate.kt")
|
||||||
public void testGenericDelegate() throws Exception {
|
public void testGenericDelegate() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/genericDelegate.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/genericDelegate.kt");
|
||||||
|
|||||||
+12
@@ -6639,6 +6639,18 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("extensionDelegatesWithSameNames.kt")
|
||||||
|
public void testExtensionDelegatesWithSameNames() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/extensionDelegatesWithSameNames.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("extensionPropertyAndExtensionGetValue.kt")
|
||||||
|
public void testExtensionPropertyAndExtensionGetValue() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/extensionPropertyAndExtensionGetValue.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("genericDelegate.kt")
|
@TestMetadata("genericDelegate.kt")
|
||||||
public void testGenericDelegate() throws Exception {
|
public void testGenericDelegate() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/genericDelegate.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/genericDelegate.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user