[FE1.0, FIR] Support secondary constructors for Value Classes

Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
This commit is contained in:
Evgeniy.Zhelenskiy
2022-10-13 19:18:08 +02:00
committed by Space Team
parent 8c3fa6f09f
commit 6107caa8e2
18 changed files with 296 additions and 93 deletions
@@ -80,7 +80,7 @@ object FirInlineClassDeclarationChecker : FirRegularClassChecker() {
primaryConstructorParametersByName.map { (_, parameter) -> parameter.symbol }.toSet()
}
innerDeclaration.body != null -> {
innerDeclaration.body != null && !context.languageVersionSettings.supportsFeature(LanguageFeature.ValueClassesSecondaryConstructorWithBody) -> {
val body = innerDeclaration.body!!
reporter.reportOn(
body.source, FirErrors.SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_VALUE_CLASS, context
@@ -263,11 +263,13 @@ class ReservedMembersAndConstructsForInlineClass : DeclarationChecker {
}
is ConstructorDescriptor -> {
val secondaryConstructor = declaration as? KtSecondaryConstructor ?: return
val bodyExpression = secondaryConstructor.bodyExpression
if (secondaryConstructor.hasBlockBody() && bodyExpression is KtBlockExpression) {
val lBrace = bodyExpression.lBrace ?: return
context.trace.report(Errors.SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_VALUE_CLASS.on(lBrace))
if (!context.languageVersionSettings.supportsFeature(LanguageFeature.ValueClassesSecondaryConstructorWithBody)) {
val secondaryConstructor = declaration as? KtSecondaryConstructor ?: return
val bodyExpression = secondaryConstructor.bodyExpression
if (secondaryConstructor.hasBlockBody() && bodyExpression is KtBlockExpression) {
val lBrace = bodyExpression.lBrace ?: return
context.trace.report(Errors.SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_VALUE_CLASS.on(lBrace))
}
}
}
}
@@ -1,10 +1,9 @@
// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses
// LANGUAGE: +ValueClasses, +ValueClassesSecondaryConstructorWithBody
OPTIONAL_JVM_INLINE_ANNOTATION
value class IC private constructor(val i: Int) {
@Suppress("SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_VALUE_CLASS")
constructor() : this(0) {
counter += 1
}
@@ -1,10 +1,9 @@
// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses, +GenericInlineClassParameter
// LANGUAGE: +ValueClasses, +GenericInlineClassParameter, +ValueClassesSecondaryConstructorWithBody
OPTIONAL_JVM_INLINE_ANNOTATION
value class IC<T: Int> private constructor(val i: T) {
@Suppress("SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_VALUE_CLASS")
constructor() : this(0 as T) {
counter += 1
}
@@ -1,8 +1,6 @@
// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses
@file:Suppress("SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_VALUE_CLASS")
// LANGUAGE: +ValueClasses, +ValueClassesSecondaryConstructorWithBody
var global = "wrong"
@@ -1,8 +1,6 @@
// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses, +GenericInlineClassParameter
@file:Suppress("SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_VALUE_CLASS")
// LANGUAGE: +ValueClasses, +GenericInlineClassParameter, +ValueClassesSecondaryConstructorWithBody
var global = "wrong"
@@ -1,6 +1,6 @@
// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses
// LANGUAGE: +ValueClasses, +ValueClassesSecondaryConstructorWithBody
var global = "wrong"
@@ -10,7 +10,6 @@ value class Foo(val x: Int) {
constructor(z: Long) : this(z.toInt() + 1)
@Suppress("SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_VALUE_CLASS")
constructor(other: Char) : this(other.toInt().toString()) {
global = "OK"
}
@@ -1,6 +1,6 @@
// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses, +GenericInlineClassParameter
// LANGUAGE: +ValueClasses, +GenericInlineClassParameter, +ValueClassesSecondaryConstructorWithBody
var global = "wrong"
@@ -10,7 +10,6 @@ value class Foo<T: Int>(val x: T) {
constructor(z: Long) : this((z.toInt() + 1) as T)
@Suppress("SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_VALUE_CLASS")
constructor(other: Char) : this(other.toInt().toString()) {
global = "OK"
}
@@ -4,9 +4,7 @@
// IGNORE_BACKEND: JS_IR_ES6
// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses
@file:Suppress("SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_VALUE_CLASS")
// LANGUAGE: +ValueClasses, +ValueClassesSecondaryConstructorWithBody
OPTIONAL_JVM_INLINE_ANNOTATION
value class Foo(val x: String) {
@@ -4,9 +4,7 @@
// IGNORE_BACKEND: JS_IR_ES6
// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses, +GenericInlineClassParameter
@file:Suppress("SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_VALUE_CLASS")
// LANGUAGE: +ValueClasses, +GenericInlineClassParameter, +ValueClassesSecondaryConstructorWithBody
OPTIONAL_JVM_INLINE_ANNOTATION
value class Foo<T: String>(val x: T) {
+13 -3
View File
@@ -6,20 +6,26 @@
// TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND: ANDROID, ANDROID_IR
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses
// LANGUAGE: +ValueClasses, +ValueClassesSecondaryConstructorWithBody
@JvmInline
value class A<T : Any>(val x: List<T>)
@JvmInline
value class B(val x: UInt)
value class B(val x: UInt) {
constructor(x: String) : this(x.toUInt()) {
supply(x)
}
}
@JvmInline
value class C(val x: Int, val y: B, val z: String = "3")
@JvmInline
value class D(val x: C) {
constructor(x: Int, y: UInt, z: Int) : this(C(x, B(y), z.toString()))
constructor(x: Int, y: UInt, z: Int) : this(C(x, B(y), z.toString())) {
supply(y)
}
init {
supply(x.x)
@@ -69,6 +75,7 @@ fun <T : List<Int>> h(r: R<T>) {
g(r.z)
f(r)
r
require(B("3") == B(3U))
C(2, B(3U), "")
D(C(2, B(3U), ""))
val x = D(C(2, B(3U), ""))
@@ -227,6 +234,7 @@ fun box(): String {
1
#3
3
4
#4
#5
R(x=1, y=2, z=E(x=D(x=C(x=3, y=B(x=4), z=5))), t=A(x=[[6]]))
@@ -257,12 +265,14 @@ fun box(): String {
B(x=4)
5
4
3
2
2
4
D(x=C(x=4, y=B(x=5), z=1))
6
6
7
6
6
D(x=C(x=6, y=B(x=7), z=2))
@@ -24,6 +24,7 @@ public final class B {
private final field x: int
private synthetic method <init>(p0: int): void
public synthetic final static method box-impl(p0: int): B
public static method constructor-impl(@org.jetbrains.annotations.NotNull p0: java.lang.String): int
public static method constructor-impl(p0: int): int
public method equals(p0: java.lang.Object): boolean
public static method equals-impl(p0: int, p1: java.lang.Object): boolean
@@ -1,18 +1,21 @@
// !LANGUAGE: +InlineClasses, -JvmInlineValueClasses, +CustomEqualsInInlineClasses
// WITH_STDLIB
// !LANGUAGE: +CustomEqualsInValueClasses
// !DIAGNOSTICS: -UNUSED_PARAMETER
inline class IC1(val x: Any) {
@JvmInline
value class IC1(val x: Any) {
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>() {}
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>(x: Any) {}
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>unbox<!>() {}
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>unbox<!>(x: Any) {}
override fun <!INEFFICIENT_EQUALS_OVERRIDING_IN_INLINE_CLASS!>equals<!>(other: Any?): Boolean = true
override fun <!INEFFICIENT_EQUALS_OVERRIDING_IN_VALUE_CLASS!>equals<!>(other: Any?): Boolean = true
override fun hashCode(): Int = 0
}
inline class IC2(val x: Any) {
@JvmInline
value class IC2(val x: Any) {
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>(x: Any) {}
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>(): Any = TODO()
@@ -23,7 +26,8 @@ inline class IC2(val x: Any) {
fun hashCode(a: Any): Int = 0
}
inline class IC3(val x: Any) {
@JvmInline
value class IC3(val x: Any) {
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>(x: Any): Any = TODO()
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>unbox<!>(x: Any): Any = TODO()
@@ -34,12 +38,34 @@ interface WithBox {
fun box(): String
}
inline class IC4(val s: String) : WithBox {
@JvmInline
value class IC4(val s: String) : WithBox {
override fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>(): String = ""
}
inline class IC5(val a: String) {
@JvmInline
value class IC5(val a: String) {
constructor(i: Int) : this(i.toString()) <!SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_VALUE_CLASS!>{
TODO("something")
}<!>
}
@JvmInline
value class IC6(val a: String) {
fun <!TYPE_PARAMETERS_NOT_ALLOWED!><T><!> equals(other: IC6): Boolean = true
}
@JvmInline
value class IC7<T>(val a: String) {
fun equals(other: IC7<*>): Boolean = true
}
@JvmInline
value class IC8<T>(val a: String) {
fun equals(other: <!TYPE_ARGUMENT_ON_TYPED_VALUE_CLASS_EQUALS!>IC8<T><!>): Boolean = true
}
@JvmInline
value class IC9<T>(val a: String) {
fun equals(other: <!TYPE_ARGUMENT_ON_TYPED_VALUE_CLASS_EQUALS!>IC9<String><!>): Boolean = true
}
@@ -0,0 +1,125 @@
// !SKIP_JAVAC
// !LANGUAGE: +CustomEqualsInValueClasses, +ValueClasses
// ALLOW_KOTLIN_PACKAGE
// !DIAGNOSTICS: -UNUSED_PARAMETER
package kotlin.jvm
annotation class JvmInline
@JvmInline
value class IC1(val x: Any) {
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>() {}
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>(x: Any) {}
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>unbox<!>() {}
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>unbox<!>(x: Any) {}
override fun <!INEFFICIENT_EQUALS_OVERRIDING_IN_VALUE_CLASS!>equals<!>(other: Any?): Boolean = true
override fun hashCode(): Int = 0
}
@JvmInline
value class IC2(val x: Any) {
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>(x: Any) {}
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>(): Any = TODO()
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>unbox<!>(x: Any) {}
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>unbox<!>(): Any = TODO()
fun equals(my: Any, other: Any): Boolean = true
fun hashCode(a: Any): Int = 0
}
@JvmInline
value class IC3(val x: Any) {
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>(x: Any): Any = TODO()
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>unbox<!>(x: Any): Any = TODO()
fun equals(): Boolean = true
}
interface WithBox {
fun box(): String
}
@JvmInline
value class IC4(val s: String) : WithBox {
override fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>(): String = ""
}
@JvmInline
value class IC5(val a: String) {
constructor(i: Int) : this(i.toString()) <!SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_VALUE_CLASS!>{
TODO("something")
}<!>
}
@JvmInline
value class IC6(val a: String) {
fun <!TYPE_PARAMETERS_NOT_ALLOWED!><T><!> equals(other: IC6): Boolean = true
}
@JvmInline
value class MFVC1(val x: Any, val y: Any) {
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>() {}
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>(x: Any) {}
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>unbox<!>() {}
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>unbox<!>(x: Any) {}
override fun <!INEFFICIENT_EQUALS_OVERRIDING_IN_VALUE_CLASS!>equals<!>(other: Any?): Boolean = true
override fun hashCode(): Int = 0
}
@JvmInline
value class MFVC2(val x: Any, val y: Any) {
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>(x: Any) {}
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>(): Any = TODO()
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>unbox<!>(x: Any) {}
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>unbox<!>(): Any = TODO()
fun equals(my: Any, other: Any): Boolean = true
fun hashCode(a: Any): Int = 0
}
@JvmInline
value class MFVC3(val x: Any, val y: Any) {
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>(x: Any): Any = TODO()
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>unbox<!>(x: Any): Any = TODO()
fun equals(): Boolean = true
}
@JvmInline
value class MFVC4(val s: String, val t: String) : WithBox {
override fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>(): String = ""
}
@JvmInline
value class MFVC5(val a: String, val b: String) {
constructor(i: Int) : this(i.toString(), "6") <!SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_VALUE_CLASS!>{
TODO("something")
}<!>
}
@JvmInline
value class MFVC6(val a: String, val b: String) {
fun <!TYPE_PARAMETERS_NOT_ALLOWED!><T><!> equals(other: MFVC6): Boolean = true
}
@JvmInline
value class MFVC7<T>(val a: String, val b: String) {
fun equals(other: MFVC7<*>): Boolean = true
}
@JvmInline
value class MFVC8<T>(val a: String, val b: String) {
fun equals(other: <!TYPE_ARGUMENT_ON_TYPED_VALUE_CLASS_EQUALS!>MFVC8<T><!>): Boolean = true
}
@JvmInline
value class MFVC9<T>(val a: String, val b: String) {
fun equals(other: <!TYPE_ARGUMENT_ON_TYPED_VALUE_CLASS_EQUALS!>MFVC9<String><!>): Boolean = true
}
@@ -0,0 +1,105 @@
// !SKIP_JAVAC
// !LANGUAGE: +CustomEqualsInInlineClasses, +ValueClasses
// ALLOW_KOTLIN_PACKAGE
// !DIAGNOSTICS: -UNUSED_PARAMETER
package kotlin.jvm
annotation class JvmInline
@JvmInline
value class IC1(val x: Any) {
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>() {}
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>(x: Any) {}
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>unbox<!>() {}
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>unbox<!>(x: Any) {}
override fun <!INEFFICIENT_EQUALS_OVERRIDING_IN_VALUE_CLASS!>equals<!>(other: Any?): Boolean = true
override fun hashCode(): Int = 0
}
@JvmInline
value class IC2(val x: Any) {
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>(x: Any) {}
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>(): Any = TODO()
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>unbox<!>(x: Any) {}
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>unbox<!>(): Any = TODO()
fun equals(my: Any, other: Any): Boolean = true
fun hashCode(a: Any): Int = 0
}
@JvmInline
value class IC3(val x: Any) {
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>(x: Any): Any = TODO()
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>unbox<!>(x: Any): Any = TODO()
fun equals(): Boolean = true
}
interface WithBox {
fun box(): String
}
@JvmInline
value class IC4(val s: String) : WithBox {
override fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>(): String = ""
}
@JvmInline
value class IC5(val a: String) {
constructor(i: Int) : this(i.toString()) <!SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_VALUE_CLASS!>{<!>
TODO("something")
}
}
@JvmInline
value class IC6(val a: String) {
fun <!TYPE_PARAMETERS_NOT_ALLOWED!><T><!> equals(other: IC6): Boolean = true
}
@JvmInline
value class MFVC1(val x: Any, val y: Any) {
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>() {}
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>(x: Any) {}
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>unbox<!>() {}
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>unbox<!>(x: Any) {}
override fun <!INEFFICIENT_EQUALS_OVERRIDING_IN_VALUE_CLASS!>equals<!>(other: Any?): Boolean = true
override fun hashCode(): Int = 0
}
@JvmInline
value class MFVC2(val x: Any, val y: Any) {
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>(x: Any) {}
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>(): Any = TODO()
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>unbox<!>(x: Any) {}
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>unbox<!>(): Any = TODO()
fun equals(my: Any, other: Any): Boolean = true
fun hashCode(a: Any): Int = 0
}
@JvmInline
value class MFVC3(val x: Any, val y: Any) {
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>(x: Any): Any = TODO()
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>unbox<!>(x: Any): Any = TODO()
fun equals(): Boolean = true
}
@JvmInline
value class MFVC4(val s: String, val t: String) : WithBox {
override fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>(): String = ""
}
@JvmInline
value class MFVC5(val a: String, val b: String) {
constructor(i: Int) : this(i.toString(), "6") <!SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_VALUE_CLASS!>{<!>
TODO("something")
}
}
@@ -1,56 +0,0 @@
// !SKIP_JAVAC
// !LANGUAGE: +InlineClasses, +CustomEqualsInInlineClasses
// ALLOW_KOTLIN_PACKAGE
// !DIAGNOSTICS: -UNUSED_PARAMETER
package kotlin.jvm
annotation class JvmInline
@JvmInline
value class IC1(val x: Any) {
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>() {}
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>(x: Any) {}
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>unbox<!>() {}
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>unbox<!>(x: Any) {}
override fun <!INEFFICIENT_EQUALS_OVERRIDING_IN_INLINE_CLASS!>equals<!>(other: Any?): Boolean = true
override fun hashCode(): Int = 0
}
@JvmInline
value class IC2(val x: Any) {
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>(x: Any) {}
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>(): Any = TODO()
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>unbox<!>(x: Any) {}
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>unbox<!>(): Any = TODO()
fun equals(my: Any, other: Any): Boolean = true
fun hashCode(a: Any): Int = 0
}
@JvmInline
value class IC3(val x: Any) {
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>(x: Any): Any = TODO()
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>unbox<!>(x: Any): Any = TODO()
fun equals(): Boolean = true
}
interface WithBox {
fun box(): String
}
@JvmInline
value class IC4(val s: String) : WithBox {
override fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>(): String = ""
}
@JvmInline
value class IC5(val a: String) {
constructor(i: Int) : this(i.toString()) <!SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_VALUE_CLASS!>{
TODO("something")
}<!>
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !SKIP_JAVAC
// !LANGUAGE: +InlineClasses, +CustomEqualsInInlineClasses
// ALLOW_KOTLIN_PACKAGE
@@ -50,7 +51,7 @@ value class IC4(val s: String) : WithBox {
@JvmInline
value class IC5(val a: String) {
constructor(i: Int) : this(i.toString()) <!SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_VALUE_CLASS!>{<!>
constructor(i: Int) : this(i.toString()) {
TODO("something")
}
}
@@ -317,6 +317,7 @@ enum class LanguageFeature(
JavaSamConversionEqualsHashCode(sinceVersion = null, kind = UNSTABLE_FEATURE),
UnitConversionsOnArbitraryExpressions(sinceVersion = null),
JsAllowImplementingFunctionInterface(sinceVersion = null, kind = UNSTABLE_FEATURE),
ValueClassesSecondaryConstructorWithBody(sinceVersion = null, kind = UNSTABLE_FEATURE),
;
init {