Hide constructors accepting inline class parameters
This commit is contained in:
@@ -20,6 +20,7 @@ import org.jetbrains.kotlin.codegen.context.CodegenContext;
|
||||
import org.jetbrains.kotlin.codegen.intrinsics.HashCode;
|
||||
import org.jetbrains.kotlin.codegen.intrinsics.IntrinsicMethods;
|
||||
import org.jetbrains.kotlin.codegen.state.GenerationState;
|
||||
import org.jetbrains.kotlin.codegen.state.InlineClassManglingUtilsKt;
|
||||
import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper;
|
||||
import org.jetbrains.kotlin.config.JvmTarget;
|
||||
import org.jetbrains.kotlin.descriptors.*;
|
||||
@@ -402,6 +403,14 @@ public class AsmUtil {
|
||||
return ACC_PRIVATE;
|
||||
}
|
||||
|
||||
if (kind != OwnerKind.ERASED_INLINE_CLASS &&
|
||||
memberDescriptor instanceof ConstructorDescriptor &&
|
||||
!(memberDescriptor instanceof AccessorForConstructorDescriptor) &&
|
||||
InlineClassManglingUtilsKt.shouldHideConstructorDueToInlineClassTypeValueParameters((ConstructorDescriptor) memberDescriptor)
|
||||
) {
|
||||
return ACC_PRIVATE;
|
||||
}
|
||||
|
||||
if (isEffectivelyInlineOnly(memberDescriptor)) {
|
||||
return ACC_PRIVATE;
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import org.jetbrains.kotlin.codegen.context.ConstructorContext;
|
||||
import org.jetbrains.kotlin.codegen.context.FieldOwnerContext;
|
||||
import org.jetbrains.kotlin.codegen.context.MethodContext;
|
||||
import org.jetbrains.kotlin.codegen.state.GenerationState;
|
||||
import org.jetbrains.kotlin.codegen.state.InlineClassManglingUtilsKt;
|
||||
import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper;
|
||||
import org.jetbrains.kotlin.descriptors.*;
|
||||
import org.jetbrains.kotlin.psi.*;
|
||||
@@ -108,9 +109,16 @@ public class ConstructorCodegen {
|
||||
functionCodegen.generateDefaultIfNeeded(constructorContext, constructorDescriptor, OwnerKind.IMPLEMENTATION,
|
||||
DefaultParameterValueLoader.DEFAULT, null);
|
||||
|
||||
registerAccessorForHiddenConstructorIfNeeded(constructorDescriptor);
|
||||
|
||||
new DefaultParameterValueSubstitutor(state).generatePrimaryConstructorOverloadsIfNeeded(constructorDescriptor, v, memberCodegen, kind, myClass);
|
||||
}
|
||||
|
||||
private void registerAccessorForHiddenConstructorIfNeeded(ClassConstructorDescriptor descriptor) {
|
||||
if (!InlineClassManglingUtilsKt.shouldHideConstructorDueToInlineClassTypeValueParameters(descriptor)) return;
|
||||
context.getAccessor(descriptor, AccessorKind.NORMAL, null, null);
|
||||
}
|
||||
|
||||
public void generateSecondaryConstructor(
|
||||
@NotNull ClassConstructorDescriptor constructorDescriptor,
|
||||
@NotNull Type superClassAsmType
|
||||
@@ -138,6 +146,8 @@ public class ConstructorCodegen {
|
||||
new DefaultParameterValueSubstitutor(state).generateOverloadsIfNeeded(
|
||||
constructor, constructorDescriptor, constructorDescriptor, kind, v, memberCodegen
|
||||
);
|
||||
|
||||
registerAccessorForHiddenConstructorIfNeeded(constructorDescriptor);
|
||||
}
|
||||
|
||||
private void generateDelegatorToConstructorCall(
|
||||
|
||||
@@ -36,6 +36,7 @@ import org.jetbrains.kotlin.codegen.range.forLoop.ForLoopGenerator;
|
||||
import org.jetbrains.kotlin.codegen.signature.BothSignatureWriter;
|
||||
import org.jetbrains.kotlin.codegen.signature.JvmSignatureWriter;
|
||||
import org.jetbrains.kotlin.codegen.state.GenerationState;
|
||||
import org.jetbrains.kotlin.codegen.state.InlineClassManglingUtilsKt;
|
||||
import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper;
|
||||
import org.jetbrains.kotlin.codegen.when.SwitchCodegen;
|
||||
import org.jetbrains.kotlin.codegen.when.SwitchCodegenProvider;
|
||||
@@ -2256,10 +2257,23 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
|
||||
descriptor = CoroutineCodegenUtilKt.unwrapInitialDescriptorForSuspendFunction(descriptor);
|
||||
|
||||
// $default method is not private, so you need no accessor to call it
|
||||
return CallUtilKt.usesDefaultArguments(resolvedCall)
|
||||
? descriptor
|
||||
: context.accessibleDescriptor(descriptor, getSuperCallTarget(resolvedCall.getCall()));
|
||||
if (CallUtilKt.usesDefaultArguments(resolvedCall)) {
|
||||
// $default method is not private, so you need no accessor to call it
|
||||
return descriptor;
|
||||
}
|
||||
else if (InlineClassManglingUtilsKt.shouldHideConstructorDueToInlineClassTypeValueParameters(descriptor)) {
|
||||
// Constructors with inline class type value parameters should always be called using an accessor.
|
||||
// NB this will require accessors even if the constructor itself is in a different module.
|
||||
return new AccessorForConstructorDescriptor(
|
||||
(ClassConstructorDescriptor) descriptor,
|
||||
descriptor.getContainingDeclaration(),
|
||||
getSuperCallTarget(resolvedCall.getCall()),
|
||||
AccessorKind.NORMAL
|
||||
);
|
||||
}
|
||||
else {
|
||||
return context.accessibleDescriptor(descriptor, getSuperCallTarget(resolvedCall.getCall()));
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -27,6 +27,16 @@ fun getInlineClassSignatureManglingSuffix(descriptor: CallableMemberDescriptor):
|
||||
return getInlineClassSignatureManglingSuffix(actualValueParameterTypes)
|
||||
}
|
||||
|
||||
fun shouldHideConstructorDueToInlineClassTypeValueParameters(descriptor: CallableMemberDescriptor): Boolean {
|
||||
if (descriptor !is ClassConstructorDescriptor) return false
|
||||
if (Visibilities.isPrivate(descriptor.visibility)) return false
|
||||
if (descriptor.constructedClass.isInline) return false
|
||||
|
||||
// TODO inner class in inline class
|
||||
|
||||
return descriptor.valueParameters.any { it.type.requiresFunctionNameMangling() }
|
||||
}
|
||||
|
||||
fun getInlineClassSignatureManglingSuffix(valueParameterTypes: List<KotlinType>) =
|
||||
if (valueParameterTypes.none { it.requiresFunctionNameMangling() })
|
||||
null
|
||||
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
|
||||
inline class S(val string: String)
|
||||
|
||||
class Test(val x: S, val y: S = S("K")) {
|
||||
val test = x.string + y.string
|
||||
}
|
||||
|
||||
fun box() = Test(S("O")).test
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
|
||||
inline class S(val string: String)
|
||||
|
||||
abstract class Base(val x: S)
|
||||
|
||||
class Test(x: S) : Base(x)
|
||||
|
||||
fun box() = Test(S("OK")).x.string
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
|
||||
inline class S(val string: String)
|
||||
|
||||
abstract class Base(val x: S)
|
||||
|
||||
class Test : Base {
|
||||
constructor() : super(S("OK"))
|
||||
}
|
||||
|
||||
fun box() = Test().x.string
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
|
||||
inline class S(val string: String)
|
||||
|
||||
class Test(val x: S, val y: S) {
|
||||
constructor(x: S) : this(x, S("K"))
|
||||
|
||||
val test = x.string + y.string
|
||||
}
|
||||
|
||||
fun box() = Test(S("O")).test
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
|
||||
inline class S(val string: String)
|
||||
|
||||
enum class Test(val s: S) {
|
||||
OK(S("OK"))
|
||||
}
|
||||
|
||||
fun box() = Test.OK.s.string
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
|
||||
inline class S(val string: String)
|
||||
|
||||
class Outer(val s1: S) {
|
||||
inner class Inner(val s2: S) {
|
||||
val test = s1.string + s2.string
|
||||
}
|
||||
}
|
||||
|
||||
fun box() = Outer(S("O")).Inner(S("K")).test
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
|
||||
inline class S(val string: String)
|
||||
|
||||
class Test(val s: S)
|
||||
|
||||
fun box() = Test(S("OK")).s.string
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
|
||||
inline class S(val string: String)
|
||||
|
||||
class Outer private constructor(val s: S) {
|
||||
class Nested {
|
||||
fun test(s: S) = Outer(s)
|
||||
}
|
||||
}
|
||||
|
||||
fun box() = Outer.Nested().test(S("OK")).s.string
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
|
||||
inline class S(val string: String)
|
||||
|
||||
sealed class Sealed(val x: S)
|
||||
|
||||
class Test(x: S) : Sealed(x)
|
||||
|
||||
fun box() = Test(S("OK")).x.string
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
|
||||
inline class S(val string: String)
|
||||
|
||||
class Test(val s: S) {
|
||||
constructor(x: String, s: S) : this(S(x + s.string))
|
||||
}
|
||||
|
||||
fun box() = Test("O", S("K")).s.string
|
||||
Vendored
+26
@@ -0,0 +1,26 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
|
||||
inline class Z(val x: Int)
|
||||
|
||||
interface PublicMarker
|
||||
interface ProtectedMarker
|
||||
interface PrivateMarker
|
||||
|
||||
|
||||
open class TestBasic(val z: Z) {
|
||||
constructor(z1: Z, publicMarker: PublicMarker) : this(z1)
|
||||
protected constructor(z: Z, protectedMarker: ProtectedMarker) : this(z)
|
||||
private constructor(z: Z, privateMarker: PrivateMarker) : this(z)
|
||||
}
|
||||
|
||||
sealed class TestSealed(val z: Z) {
|
||||
class Case(z: Z) : TestSealed(z)
|
||||
}
|
||||
|
||||
enum class TestEnum(val z: Z) {
|
||||
ANSWER(Z(42))
|
||||
}
|
||||
|
||||
class TestInner {
|
||||
inner class Inner(val z: Z)
|
||||
}
|
||||
Vendored
+82
@@ -0,0 +1,82 @@
|
||||
@kotlin.Metadata
|
||||
public interface PrivateMarker
|
||||
|
||||
@kotlin.Metadata
|
||||
public interface ProtectedMarker
|
||||
|
||||
@kotlin.Metadata
|
||||
public interface PublicMarker
|
||||
|
||||
@kotlin.Metadata
|
||||
public class TestBasic {
|
||||
private final field z: int
|
||||
private method <init>(p0: int): void
|
||||
public synthetic method <init>(p0: int, @org.jetbrains.annotations.NotNull p1: ProtectedMarker, p2: kotlin.jvm.internal.DefaultConstructorMarker): void
|
||||
public synthetic method <init>(p0: int, @org.jetbrains.annotations.NotNull p1: PublicMarker, p2: kotlin.jvm.internal.DefaultConstructorMarker): void
|
||||
private method <init>(p0: int, p1: PrivateMarker): void
|
||||
private method <init>(p0: int, p1: ProtectedMarker): void
|
||||
private method <init>(p0: int, p1: PublicMarker): void
|
||||
public synthetic method <init>(p0: int, p1: kotlin.jvm.internal.DefaultConstructorMarker): void
|
||||
public final method getZ(): int
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final enum class TestEnum {
|
||||
private synthetic final static field $VALUES: TestEnum[]
|
||||
public final static field ANSWER: TestEnum
|
||||
private final field z: int
|
||||
static method <clinit>(): void
|
||||
protected method <init>(p0: java.lang.String, p1: int, p2: int): void
|
||||
public final method getZ(): int
|
||||
public static method valueOf(p0: java.lang.String): TestEnum
|
||||
public static method values(): TestEnum[]
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class TestInner$Inner {
|
||||
synthetic final field this$0: TestInner
|
||||
private final field z: int
|
||||
inner class TestInner$Inner
|
||||
private method <init>(p0: TestInner, p1: int): void
|
||||
public synthetic method <init>(p0: TestInner, p1: int, p2: kotlin.jvm.internal.DefaultConstructorMarker): void
|
||||
public final method getZ(): int
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class TestInner {
|
||||
inner class TestInner$Inner
|
||||
public method <init>(): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class TestSealed$Case {
|
||||
inner class TestSealed$Case
|
||||
private method <init>(p0: int): void
|
||||
public synthetic method <init>(p0: int, p1: kotlin.jvm.internal.DefaultConstructorMarker): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public abstract class TestSealed {
|
||||
private final field z: int
|
||||
inner class TestSealed$Case
|
||||
private method <init>(p0: int): void
|
||||
public synthetic method <init>(p0: int, p1: kotlin.jvm.internal.DefaultConstructorMarker): void
|
||||
public final method getZ(): int
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class Z {
|
||||
private final field x: int
|
||||
private synthetic method <init>(p0: int): void
|
||||
public synthetic final static @org.jetbrains.annotations.NotNull method box-impl(p0: int): Z
|
||||
public static method constructor-impl(p0: int): int
|
||||
public method equals(p0: java.lang.Object): boolean
|
||||
public static method equals-impl(p0: int, @org.jetbrains.annotations.Nullable p1: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: int, p1: int): boolean
|
||||
public final method getX(): int
|
||||
public method hashCode(): int
|
||||
public static method hashCode-impl(p0: int): int
|
||||
public method toString(): java.lang.String
|
||||
public static @org.jetbrains.annotations.NotNull method toString-impl(p0: int): java.lang.String
|
||||
public synthetic final method unbox-impl(): int
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
// FILE: A.kt
|
||||
package lib
|
||||
|
||||
inline class S(val string: String)
|
||||
|
||||
class Test(val s: S)
|
||||
|
||||
// FILE: B.kt
|
||||
import lib.*
|
||||
|
||||
fun box() = Test(S("OK")).s.string
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
inline class X(val x: Int)
|
||||
inline class Z(val x: Int)
|
||||
|
||||
class TestOk1(val a: Int, val b: Int) {
|
||||
constructor(x: X) : this(x.x, 1)
|
||||
}
|
||||
|
||||
class TestErr1(val a: Int) {
|
||||
<!CONFLICTING_JVM_DECLARATIONS!>constructor(x: X)<!> : this(x.x)
|
||||
}
|
||||
|
||||
class <!CONFLICTING_JVM_DECLARATIONS!>TestErr2(val a: Int, val b: Int)<!> {
|
||||
<!CONFLICTING_JVM_DECLARATIONS!>constructor(x: X)<!> : this(x.x, 1)
|
||||
<!CONFLICTING_JVM_DECLARATIONS!>constructor(z: Z)<!> : this(z.x, 2)
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
package
|
||||
|
||||
public final class TestErr1 {
|
||||
public constructor TestErr1(/*0*/ x: X)
|
||||
public constructor TestErr1(/*0*/ a: kotlin.Int)
|
||||
public final val a: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class TestErr2 {
|
||||
public constructor TestErr2(/*0*/ x: X)
|
||||
public constructor TestErr2(/*0*/ z: Z)
|
||||
public constructor TestErr2(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int)
|
||||
public final val a: kotlin.Int
|
||||
public final val b: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class TestOk1 {
|
||||
public constructor TestOk1(/*0*/ x: X)
|
||||
public constructor TestOk1(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int)
|
||||
public final val a: kotlin.Int
|
||||
public final val b: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final inline class X {
|
||||
public constructor X(/*0*/ x: kotlin.Int)
|
||||
public final val x: kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final inline class Z {
|
||||
public constructor Z(/*0*/ x: kotlin.Int)
|
||||
public final val x: kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -10872,6 +10872,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
||||
runTest("compiler/testData/diagnostics/tests/inlineClasses/basicInlineClassDeclarationDisabled.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("constructorsJvmSignaturesClash.kt")
|
||||
public void testConstructorsJvmSignaturesClash() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inlineClasses/constructorsJvmSignaturesClash.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("delegatedPropertyInInlineClass.kt")
|
||||
public void testDelegatedPropertyInInlineClass() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inlineClasses/delegatedPropertyInInlineClass.kt");
|
||||
|
||||
Generated
+5
@@ -10872,6 +10872,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
|
||||
runTest("compiler/testData/diagnostics/tests/inlineClasses/basicInlineClassDeclarationDisabled.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("constructorsJvmSignaturesClash.kt")
|
||||
public void testConstructorsJvmSignaturesClash() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inlineClasses/constructorsJvmSignaturesClash.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("delegatedPropertyInInlineClass.kt")
|
||||
public void testDelegatedPropertyInInlineClass() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inlineClasses/delegatedPropertyInInlineClass.kt");
|
||||
|
||||
+63
@@ -11938,6 +11938,69 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/functionNameMangling/syntheticAccessorsForPropertyOfInlineClassType.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/inlineClasses/hiddenConstructor")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class HiddenConstructor extends AbstractBlackBoxCodegenTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInHiddenConstructor() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/hiddenConstructor"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
|
||||
}
|
||||
|
||||
@TestMetadata("constructorWithDefaultParameters.kt")
|
||||
public void testConstructorWithDefaultParameters() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/constructorWithDefaultParameters.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("delegatingSuperConstructorCall.kt")
|
||||
public void testDelegatingSuperConstructorCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingSuperConstructorCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("delegatingSuperConstructorCallInSecondaryConstructor.kt")
|
||||
public void testDelegatingSuperConstructorCallInSecondaryConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingSuperConstructorCallInSecondaryConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("delegatingThisConstructorCall.kt")
|
||||
public void testDelegatingThisConstructorCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingThisConstructorCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("enumClassConstructor.kt")
|
||||
public void testEnumClassConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/enumClassConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("innerClassConstructor.kt")
|
||||
public void testInnerClassConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/innerClassConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("primaryConstructor.kt")
|
||||
public void testPrimaryConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/primaryConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("privateConstructor.kt")
|
||||
public void testPrivateConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/privateConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassConstructor.kt")
|
||||
public void testSealedClassConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/sealedClassConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("secondaryConstructor.kt")
|
||||
public void testSecondaryConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/secondaryConstructor.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/innerNested")
|
||||
|
||||
+5
@@ -289,6 +289,11 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest {
|
||||
runTest("compiler/testData/codegen/bytecodeListing/inlineClasses/inlineClassMembersVisibility.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineClassTypeParametersInConstructor.kt")
|
||||
public void testInlineClassTypeParametersInConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeListing/inlineClasses/inlineClassTypeParametersInConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineClassWithInlineClassUnderlyingType.kt")
|
||||
public void testInlineClassWithInlineClassUnderlyingType() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeListing/inlineClasses/inlineClassWithInlineClassUnderlyingType.kt");
|
||||
|
||||
+5
@@ -78,6 +78,11 @@ public class CompileKotlinAgainstKotlinTestGenerated extends AbstractCompileKotl
|
||||
runTest("compiler/testData/compileKotlinAgainstKotlin/constructorVararg.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("constructorWithInlineClassParametersInBinaryDependencies.kt")
|
||||
public void testConstructorWithInlineClassParametersInBinaryDependencies() throws Exception {
|
||||
runTest("compiler/testData/compileKotlinAgainstKotlin/constructorWithInlineClassParametersInBinaryDependencies.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("copySamOnInline.kt")
|
||||
public void testCopySamOnInline() throws Exception {
|
||||
runTest("compiler/testData/compileKotlinAgainstKotlin/copySamOnInline.kt");
|
||||
|
||||
+63
@@ -11938,6 +11938,69 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/functionNameMangling/syntheticAccessorsForPropertyOfInlineClassType.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/inlineClasses/hiddenConstructor")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class HiddenConstructor extends AbstractLightAnalysisModeTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInHiddenConstructor() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/hiddenConstructor"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
|
||||
}
|
||||
|
||||
@TestMetadata("constructorWithDefaultParameters.kt")
|
||||
public void testConstructorWithDefaultParameters() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/constructorWithDefaultParameters.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("delegatingSuperConstructorCall.kt")
|
||||
public void testDelegatingSuperConstructorCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingSuperConstructorCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("delegatingSuperConstructorCallInSecondaryConstructor.kt")
|
||||
public void testDelegatingSuperConstructorCallInSecondaryConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingSuperConstructorCallInSecondaryConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("delegatingThisConstructorCall.kt")
|
||||
public void testDelegatingThisConstructorCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingThisConstructorCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("enumClassConstructor.kt")
|
||||
public void testEnumClassConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/enumClassConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("innerClassConstructor.kt")
|
||||
public void testInnerClassConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/innerClassConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("primaryConstructor.kt")
|
||||
public void testPrimaryConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/primaryConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("privateConstructor.kt")
|
||||
public void testPrivateConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/privateConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassConstructor.kt")
|
||||
public void testSealedClassConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/sealedClassConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("secondaryConstructor.kt")
|
||||
public void testSecondaryConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/secondaryConstructor.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/innerNested")
|
||||
|
||||
+63
@@ -11938,6 +11938,69 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/functionNameMangling/syntheticAccessorsForPropertyOfInlineClassType.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/inlineClasses/hiddenConstructor")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class HiddenConstructor extends AbstractIrBlackBoxCodegenTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInHiddenConstructor() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/hiddenConstructor"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@TestMetadata("constructorWithDefaultParameters.kt")
|
||||
public void testConstructorWithDefaultParameters() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/constructorWithDefaultParameters.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("delegatingSuperConstructorCall.kt")
|
||||
public void testDelegatingSuperConstructorCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingSuperConstructorCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("delegatingSuperConstructorCallInSecondaryConstructor.kt")
|
||||
public void testDelegatingSuperConstructorCallInSecondaryConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingSuperConstructorCallInSecondaryConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("delegatingThisConstructorCall.kt")
|
||||
public void testDelegatingThisConstructorCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingThisConstructorCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("enumClassConstructor.kt")
|
||||
public void testEnumClassConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/enumClassConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("innerClassConstructor.kt")
|
||||
public void testInnerClassConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/innerClassConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("primaryConstructor.kt")
|
||||
public void testPrimaryConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/primaryConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("privateConstructor.kt")
|
||||
public void testPrivateConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/privateConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassConstructor.kt")
|
||||
public void testSealedClassConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/sealedClassConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("secondaryConstructor.kt")
|
||||
public void testSecondaryConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/secondaryConstructor.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/innerNested")
|
||||
|
||||
+63
@@ -10473,6 +10473,69 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/functionNameMangling/syntheticAccessorsForPropertyOfInlineClassType.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/inlineClasses/hiddenConstructor")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class HiddenConstructor extends AbstractIrJsCodegenBoxTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInHiddenConstructor() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/hiddenConstructor"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true);
|
||||
}
|
||||
|
||||
@TestMetadata("constructorWithDefaultParameters.kt")
|
||||
public void testConstructorWithDefaultParameters() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/constructorWithDefaultParameters.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("delegatingSuperConstructorCall.kt")
|
||||
public void testDelegatingSuperConstructorCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingSuperConstructorCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("delegatingSuperConstructorCallInSecondaryConstructor.kt")
|
||||
public void testDelegatingSuperConstructorCallInSecondaryConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingSuperConstructorCallInSecondaryConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("delegatingThisConstructorCall.kt")
|
||||
public void testDelegatingThisConstructorCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingThisConstructorCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("enumClassConstructor.kt")
|
||||
public void testEnumClassConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/enumClassConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("innerClassConstructor.kt")
|
||||
public void testInnerClassConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/innerClassConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("primaryConstructor.kt")
|
||||
public void testPrimaryConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/primaryConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("privateConstructor.kt")
|
||||
public void testPrivateConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/privateConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassConstructor.kt")
|
||||
public void testSealedClassConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/sealedClassConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("secondaryConstructor.kt")
|
||||
public void testSecondaryConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/secondaryConstructor.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/innerNested")
|
||||
|
||||
+63
@@ -11538,6 +11538,69 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/functionNameMangling/syntheticAccessorsForPropertyOfInlineClassType.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/inlineClasses/hiddenConstructor")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class HiddenConstructor extends AbstractJsCodegenBoxTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInHiddenConstructor() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/hiddenConstructor"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true);
|
||||
}
|
||||
|
||||
@TestMetadata("constructorWithDefaultParameters.kt")
|
||||
public void testConstructorWithDefaultParameters() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/constructorWithDefaultParameters.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("delegatingSuperConstructorCall.kt")
|
||||
public void testDelegatingSuperConstructorCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingSuperConstructorCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("delegatingSuperConstructorCallInSecondaryConstructor.kt")
|
||||
public void testDelegatingSuperConstructorCallInSecondaryConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingSuperConstructorCallInSecondaryConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("delegatingThisConstructorCall.kt")
|
||||
public void testDelegatingThisConstructorCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/delegatingThisConstructorCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("enumClassConstructor.kt")
|
||||
public void testEnumClassConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/enumClassConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("innerClassConstructor.kt")
|
||||
public void testInnerClassConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/innerClassConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("primaryConstructor.kt")
|
||||
public void testPrimaryConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/primaryConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("privateConstructor.kt")
|
||||
public void testPrivateConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/privateConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("sealedClassConstructor.kt")
|
||||
public void testSealedClassConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/sealedClassConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("secondaryConstructor.kt")
|
||||
public void testSecondaryConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/secondaryConstructor.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/innerNested")
|
||||
|
||||
Reference in New Issue
Block a user