Fix self-reference to singleton in initializer
Singleton instance is "initialized" by delegating constructor call, which is superclass constructor call in case of singletons (because singletons can't have more than one constructor). Singleton constructor is effectively split into two stages: - before a super constructor call; - after a super constructor call. Before super constructor call, singleton instance can't be used directly (see KT-20662), because neither 'this' nor static instance is initialized yet. However, it can be used in closures, in which case a static instance should be used (escaping uninitialized this is prohibited by JVM). Actually using this static instance before it is initialized (e.g., invoking a method that uses this singleton) will cause a correct ExceptionInInitializerError. After a super constructor call, static instance of a singleton may be not initialized yet (in case of enum entries and interface companion objects). However, we already have an initialized 'this', which we should use for singleton references. #KT-20651 Fixed
This commit is contained in:
@@ -1736,7 +1736,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
|
||||
if (descriptor instanceof ClassDescriptor) {
|
||||
ClassDescriptor classDescriptor = (ClassDescriptor) descriptor;
|
||||
if (isPossiblyUninitializedSingleton(classDescriptor) && isInsideSingleton(classDescriptor)) {
|
||||
if (shouldGenerateSingletonAsThisOrOuterFromContext(classDescriptor)) {
|
||||
return generateThisOrOuterFromContext(classDescriptor, false, false);
|
||||
}
|
||||
if (isObject(classDescriptor)) {
|
||||
@@ -1759,6 +1759,27 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
throw new UnsupportedOperationException("don't know how to generate reference " + descriptor);
|
||||
}
|
||||
|
||||
private boolean shouldGenerateSingletonAsThisOrOuterFromContext(ClassDescriptor classDescriptor) {
|
||||
return isPossiblyUninitializedSingleton(classDescriptor) &&
|
||||
isInsideSingleton(classDescriptor) &&
|
||||
isThisInitialized(classDescriptor);
|
||||
}
|
||||
|
||||
private boolean isThisInitialized(ClassDescriptor classDescriptor) {
|
||||
CodegenContext context = this.context;
|
||||
while (context != null) {
|
||||
if (context instanceof ConstructorContext) {
|
||||
ConstructorContext constructorContext = (ConstructorContext) context;
|
||||
ClassDescriptor constructedClass = constructorContext.getConstructorDescriptor().getConstructedClass();
|
||||
if (constructedClass == classDescriptor) {
|
||||
return constructorContext.isThisInitialized();
|
||||
}
|
||||
}
|
||||
context = context.getParentContext();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private StackValue applyIntrinsic(
|
||||
DeclarationDescriptor descriptor,
|
||||
@@ -2601,7 +2622,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
!CodegenUtilKt.isJvmStaticInObjectOrClass(context.getFunctionDescriptor())) {
|
||||
return StackValue.local(0, typeMapper.mapType(calleeContainingClass));
|
||||
}
|
||||
else if (CodegenUtilKt.isPossiblyUninitializedSingleton(calleeContainingClass) && isInsideSingleton(calleeContainingClass)) {
|
||||
else if (shouldGenerateSingletonAsThisOrOuterFromContext(calleeContainingClass)) {
|
||||
return generateThisOrOuterFromContext(calleeContainingClass, isSuper, forceOuter);
|
||||
}
|
||||
else if (isEnumEntry(calleeContainingClass)) {
|
||||
|
||||
@@ -1382,10 +1382,28 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
@NotNull ClassConstructorDescriptor constructorDescriptor,
|
||||
@Nullable ResolvedCall<ConstructorDescriptor> delegationConstructorCall
|
||||
) {
|
||||
MethodContext codegenContext = codegen.context;
|
||||
assert codegenContext instanceof ConstructorContext :
|
||||
"Constructor context expected: " + codegenContext;
|
||||
assert !((ConstructorContext) codegenContext).isThisInitialized() :
|
||||
"Delegating constructor call is already generated for " + ((ConstructorContext) codegenContext).getConstructorDescriptor();
|
||||
|
||||
if (delegationConstructorCall == null) {
|
||||
genSimpleSuperCall(iv);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
generateDelegationConstructorCall(iv, codegen, constructorDescriptor, delegationConstructorCall);
|
||||
}
|
||||
|
||||
((ConstructorContext) codegenContext).setThisInitialized(true);
|
||||
}
|
||||
|
||||
private void generateDelegationConstructorCall(
|
||||
@NotNull InstructionAdapter iv,
|
||||
@NotNull ExpressionCodegen codegen,
|
||||
@NotNull ClassConstructorDescriptor constructorDescriptor,
|
||||
@NotNull ResolvedCall<ConstructorDescriptor> delegationConstructorCall
|
||||
) {
|
||||
iv.load(0, OBJECT_TYPE);
|
||||
ConstructorDescriptor delegateConstructor = SamCodegenUtil.resolveSamAdapter(codegen.getConstructorDescriptor(delegationConstructorCall));
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ import static org.jetbrains.kotlin.resolve.jvm.AsmTypes.OBJECT_TYPE;
|
||||
|
||||
public class ConstructorContext extends MethodContext {
|
||||
private static final StackValue LOCAL_1 = StackValue.local(1, OBJECT_TYPE);
|
||||
private boolean thisInitialized = false;
|
||||
|
||||
public ConstructorContext(
|
||||
@NotNull ConstructorDescriptor contextDescriptor,
|
||||
@@ -46,6 +47,18 @@ public class ConstructorContext extends MethodContext {
|
||||
return stackValue;
|
||||
}
|
||||
|
||||
public ConstructorDescriptor getConstructorDescriptor() {
|
||||
return (ConstructorDescriptor) getContextDescriptor();
|
||||
}
|
||||
|
||||
public boolean isThisInitialized() {
|
||||
return thisInitialized;
|
||||
}
|
||||
|
||||
public void setThisInitialized(boolean thisInitialized) {
|
||||
this.thisInitialized = thisInitialized;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Constructor: " + getContextDescriptor();
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
enum class Test(val x: String, val closure1: () -> String) {
|
||||
FOO("O", { FOO.x }) {
|
||||
override val y: String = "K"
|
||||
val closure2 = { y } // Implicit 'FOO'
|
||||
override val z: String = closure2()
|
||||
};
|
||||
|
||||
abstract val y: String
|
||||
abstract val z: String
|
||||
|
||||
fun test() = closure1() + z
|
||||
}
|
||||
|
||||
fun box() = Test.FOO.test()
|
||||
@@ -0,0 +1,14 @@
|
||||
enum class Test(val x: String, val closure1: () -> String) {
|
||||
FOO("O", run { { FOO.x } }) {
|
||||
override val y: String = "K"
|
||||
val closure2 = { y } // Implicit 'FOO'
|
||||
override val z: String = closure2()
|
||||
};
|
||||
|
||||
abstract val y: String
|
||||
abstract val z: String
|
||||
|
||||
fun test() = closure1() + z
|
||||
}
|
||||
|
||||
fun box() = Test.FOO.test()
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
interface IFn {
|
||||
operator fun invoke(): String
|
||||
}
|
||||
|
||||
abstract class Base(val fn: IFn)
|
||||
|
||||
class Host {
|
||||
companion object : Base(
|
||||
object : IFn {
|
||||
override fun invoke(): String = Host.ok()
|
||||
}
|
||||
) {
|
||||
fun ok() = "OK"
|
||||
}
|
||||
}
|
||||
|
||||
fun box() = Host.Companion.fn()
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
class Test {
|
||||
companion object {
|
||||
fun ok() = "OK"
|
||||
val x = run { Test.ok() }
|
||||
fun test() = x
|
||||
}
|
||||
}
|
||||
|
||||
fun box() = Test.test()
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
abstract class Base(val fn: () -> String)
|
||||
|
||||
class Host {
|
||||
companion object : Base(run { { Host.ok() } }) {
|
||||
fun ok() = "OK"
|
||||
}
|
||||
}
|
||||
|
||||
fun box() = Host.Companion.fn()
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
abstract class Base(val fn: () -> String)
|
||||
|
||||
class Host {
|
||||
companion object : Base({ Host.ok() }) {
|
||||
fun ok() = "OK"
|
||||
}
|
||||
}
|
||||
|
||||
fun box() = Host.Companion.fn()
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
interface IFn {
|
||||
operator fun invoke(): String
|
||||
}
|
||||
|
||||
abstract class Base(val fn: IFn)
|
||||
|
||||
interface Host {
|
||||
companion object : Base(
|
||||
object : IFn {
|
||||
override fun invoke(): String = Host.ok()
|
||||
}
|
||||
) {
|
||||
fun ok() = "OK"
|
||||
}
|
||||
}
|
||||
|
||||
fun box() = Host.Companion.fn()
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
interface Test {
|
||||
companion object {
|
||||
fun ok() = "OK"
|
||||
val x = run { Test.ok() }
|
||||
fun test() = x
|
||||
}
|
||||
}
|
||||
|
||||
fun box() = Test.test()
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
abstract class Base(val fn: () -> String)
|
||||
|
||||
interface Host {
|
||||
companion object : Base(run { { Host.ok() } }) {
|
||||
fun ok() = "OK"
|
||||
}
|
||||
}
|
||||
|
||||
fun box() = Host.Companion.fn()
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
abstract class Base(val fn: () -> String)
|
||||
|
||||
interface Host {
|
||||
companion object : Base({ Host.ok() }) {
|
||||
fun ok() = "OK"
|
||||
}
|
||||
}
|
||||
|
||||
fun box() = Host.Companion.fn()
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
interface IFn {
|
||||
operator fun invoke(): String
|
||||
}
|
||||
|
||||
abstract class Base(val fn: IFn)
|
||||
|
||||
object Test : Base(
|
||||
object : IFn {
|
||||
override fun invoke(): String = Test.ok()
|
||||
}
|
||||
) {
|
||||
fun ok() = "OK"
|
||||
}
|
||||
|
||||
fun box() = Test.fn()
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
object Test {
|
||||
fun ok() = "OK"
|
||||
val x = run { Test.ok() }
|
||||
fun test() = x
|
||||
}
|
||||
|
||||
fun box() = Test.test()
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
abstract class Base(val fn: () -> String)
|
||||
|
||||
object Test : Base(run { { Test.ok() } }) {
|
||||
fun ok() = "OK"
|
||||
}
|
||||
|
||||
fun box() = Test.fn()
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
abstract class Base(val fn: () -> String)
|
||||
|
||||
object Test : Base({ Test.ok() }) {
|
||||
fun ok() = "OK"
|
||||
}
|
||||
|
||||
fun box() = Test.fn()
|
||||
+84
@@ -7982,6 +7982,18 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt20651.kt")
|
||||
public void testKt20651() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt20651.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt20651_inlineLambda.kt")
|
||||
public void testKt20651_inlineLambda() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt20651_inlineLambda.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt2350.kt")
|
||||
public void testKt2350() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt2350.kt");
|
||||
@@ -12191,6 +12203,78 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToCompanionObjectInAnonymousObjectInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToCompanionObjectInAnonymousObjectInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToCompanionObjectInAnonymousObjectInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToCompanionObjectInInlineLambdaInConstructorBody.kt")
|
||||
public void testSelfReferenceToCompanionObjectInInlineLambdaInConstructorBody() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToCompanionObjectInInlineLambdaInConstructorBody.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToCompanionObjectInInlineLambdaInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToCompanionObjectInInlineLambdaInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToCompanionObjectInInlineLambdaInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToCompanionObjectInLambdaInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToCompanionObjectInLambdaInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToCompanionObjectInLambdaInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToInterfaceCompanionObjectInAnonymousObjectInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToInterfaceCompanionObjectInAnonymousObjectInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInAnonymousObjectInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToInterfaceCompanionObjectInInlineLambdaInConstructorBody.kt")
|
||||
public void testSelfReferenceToInterfaceCompanionObjectInInlineLambdaInConstructorBody() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInInlineLambdaInConstructorBody.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToInterfaceCompanionObjectInInlineLambdaInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToInterfaceCompanionObjectInInlineLambdaInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInInlineLambdaInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToInterfaceCompanionObjectInLambdaInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToInterfaceCompanionObjectInLambdaInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInLambdaInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToObjectInAnonymousObjectInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToObjectInAnonymousObjectInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToObjectInAnonymousObjectInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToObjectInInlineLambdaInConstructorBody.kt")
|
||||
public void testSelfReferenceToObjectInInlineLambdaInConstructorBody() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToObjectInInlineLambdaInConstructorBody.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToObjectInInlineLambdaInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToObjectInInlineLambdaInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToObjectInInlineLambdaInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToObjectInLambdaInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToObjectInLambdaInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToObjectInLambdaInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("simpleObject.kt")
|
||||
public void testSimpleObject() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/simpleObject.kt");
|
||||
|
||||
@@ -7982,6 +7982,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt20651.kt")
|
||||
public void testKt20651() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt20651.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt20651_inlineLambda.kt")
|
||||
public void testKt20651_inlineLambda() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt20651_inlineLambda.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt2350.kt")
|
||||
public void testKt2350() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt2350.kt");
|
||||
@@ -12191,6 +12203,78 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToCompanionObjectInAnonymousObjectInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToCompanionObjectInAnonymousObjectInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToCompanionObjectInAnonymousObjectInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToCompanionObjectInInlineLambdaInConstructorBody.kt")
|
||||
public void testSelfReferenceToCompanionObjectInInlineLambdaInConstructorBody() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToCompanionObjectInInlineLambdaInConstructorBody.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToCompanionObjectInInlineLambdaInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToCompanionObjectInInlineLambdaInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToCompanionObjectInInlineLambdaInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToCompanionObjectInLambdaInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToCompanionObjectInLambdaInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToCompanionObjectInLambdaInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToInterfaceCompanionObjectInAnonymousObjectInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToInterfaceCompanionObjectInAnonymousObjectInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInAnonymousObjectInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToInterfaceCompanionObjectInInlineLambdaInConstructorBody.kt")
|
||||
public void testSelfReferenceToInterfaceCompanionObjectInInlineLambdaInConstructorBody() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInInlineLambdaInConstructorBody.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToInterfaceCompanionObjectInInlineLambdaInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToInterfaceCompanionObjectInInlineLambdaInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInInlineLambdaInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToInterfaceCompanionObjectInLambdaInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToInterfaceCompanionObjectInLambdaInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInLambdaInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToObjectInAnonymousObjectInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToObjectInAnonymousObjectInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToObjectInAnonymousObjectInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToObjectInInlineLambdaInConstructorBody.kt")
|
||||
public void testSelfReferenceToObjectInInlineLambdaInConstructorBody() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToObjectInInlineLambdaInConstructorBody.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToObjectInInlineLambdaInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToObjectInInlineLambdaInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToObjectInInlineLambdaInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToObjectInLambdaInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToObjectInLambdaInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToObjectInLambdaInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("simpleObject.kt")
|
||||
public void testSimpleObject() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/simpleObject.kt");
|
||||
|
||||
@@ -7982,6 +7982,18 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt20651.kt")
|
||||
public void testKt20651() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt20651.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt20651_inlineLambda.kt")
|
||||
public void testKt20651_inlineLambda() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt20651_inlineLambda.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt2350.kt")
|
||||
public void testKt2350() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt2350.kt");
|
||||
@@ -12191,6 +12203,78 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToCompanionObjectInAnonymousObjectInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToCompanionObjectInAnonymousObjectInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToCompanionObjectInAnonymousObjectInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToCompanionObjectInInlineLambdaInConstructorBody.kt")
|
||||
public void testSelfReferenceToCompanionObjectInInlineLambdaInConstructorBody() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToCompanionObjectInInlineLambdaInConstructorBody.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToCompanionObjectInInlineLambdaInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToCompanionObjectInInlineLambdaInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToCompanionObjectInInlineLambdaInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToCompanionObjectInLambdaInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToCompanionObjectInLambdaInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToCompanionObjectInLambdaInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToInterfaceCompanionObjectInAnonymousObjectInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToInterfaceCompanionObjectInAnonymousObjectInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInAnonymousObjectInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToInterfaceCompanionObjectInInlineLambdaInConstructorBody.kt")
|
||||
public void testSelfReferenceToInterfaceCompanionObjectInInlineLambdaInConstructorBody() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInInlineLambdaInConstructorBody.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToInterfaceCompanionObjectInInlineLambdaInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToInterfaceCompanionObjectInInlineLambdaInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInInlineLambdaInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToInterfaceCompanionObjectInLambdaInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToInterfaceCompanionObjectInLambdaInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInLambdaInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToObjectInAnonymousObjectInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToObjectInAnonymousObjectInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToObjectInAnonymousObjectInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToObjectInInlineLambdaInConstructorBody.kt")
|
||||
public void testSelfReferenceToObjectInInlineLambdaInConstructorBody() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToObjectInInlineLambdaInConstructorBody.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToObjectInInlineLambdaInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToObjectInInlineLambdaInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToObjectInInlineLambdaInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToObjectInLambdaInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToObjectInLambdaInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToObjectInLambdaInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("simpleObject.kt")
|
||||
public void testSimpleObject() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/simpleObject.kt");
|
||||
|
||||
+84
@@ -8684,6 +8684,18 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt20651.kt")
|
||||
public void testKt20651() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt20651.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt20651_inlineLambda.kt")
|
||||
public void testKt20651_inlineLambda() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt20651_inlineLambda.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt2350.kt")
|
||||
public void testKt2350() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt2350.kt");
|
||||
@@ -13415,6 +13427,78 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToCompanionObjectInAnonymousObjectInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToCompanionObjectInAnonymousObjectInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToCompanionObjectInAnonymousObjectInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToCompanionObjectInInlineLambdaInConstructorBody.kt")
|
||||
public void testSelfReferenceToCompanionObjectInInlineLambdaInConstructorBody() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToCompanionObjectInInlineLambdaInConstructorBody.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToCompanionObjectInInlineLambdaInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToCompanionObjectInInlineLambdaInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToCompanionObjectInInlineLambdaInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToCompanionObjectInLambdaInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToCompanionObjectInLambdaInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToCompanionObjectInLambdaInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToInterfaceCompanionObjectInAnonymousObjectInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToInterfaceCompanionObjectInAnonymousObjectInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInAnonymousObjectInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToInterfaceCompanionObjectInInlineLambdaInConstructorBody.kt")
|
||||
public void testSelfReferenceToInterfaceCompanionObjectInInlineLambdaInConstructorBody() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInInlineLambdaInConstructorBody.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToInterfaceCompanionObjectInInlineLambdaInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToInterfaceCompanionObjectInInlineLambdaInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInInlineLambdaInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToInterfaceCompanionObjectInLambdaInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToInterfaceCompanionObjectInLambdaInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInLambdaInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToObjectInAnonymousObjectInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToObjectInAnonymousObjectInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToObjectInAnonymousObjectInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToObjectInInlineLambdaInConstructorBody.kt")
|
||||
public void testSelfReferenceToObjectInInlineLambdaInConstructorBody() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToObjectInInlineLambdaInConstructorBody.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToObjectInInlineLambdaInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToObjectInInlineLambdaInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToObjectInInlineLambdaInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferenceToObjectInLambdaInSuperConstructorCall.kt")
|
||||
public void testSelfReferenceToObjectInLambdaInSuperConstructorCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/selfReferenceToObjectInLambdaInSuperConstructorCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("simpleObject.kt")
|
||||
public void testSimpleObject() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/simpleObject.kt");
|
||||
|
||||
Reference in New Issue
Block a user