Hide constructors accepting inline class parameters
This commit is contained in:
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
|
||||
}
|
||||
Reference in New Issue
Block a user