Minor. Add test with inline class inside inline class's init block
This commit is contained in:
@@ -127,6 +127,13 @@ value class InlineFunThis(val s: String) {
|
|||||||
inline fun ok(): String = s
|
inline fun ok(): String = s
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OPTIONAL_JVM_INLINE_ANNOTATION
|
||||||
|
value class InlineClass(val s: String) {
|
||||||
|
init {
|
||||||
|
SingleInitBlock(s)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var res: String = "FAIL"
|
var res: String = "FAIL"
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
@@ -181,5 +188,9 @@ fun box(): String {
|
|||||||
InlineFunThis("OK")
|
InlineFunThis("OK")
|
||||||
if (res != "OK") return "FAIL 131: $res"
|
if (res != "OK") return "FAIL 131: $res"
|
||||||
|
|
||||||
|
res = "FAIL 14"
|
||||||
|
InlineClass("OK")
|
||||||
|
if (res != "OK") return "FAIL 141: $res"
|
||||||
|
|
||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
@@ -137,6 +137,13 @@ value class InlineFunThis<T: String>(val s: T) {
|
|||||||
inline fun ok(): String = s
|
inline fun ok(): String = s
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OPTIONAL_JVM_INLINE_ANNOTATION
|
||||||
|
value class InlineClass<T: String>(val s: T) {
|
||||||
|
init {
|
||||||
|
SingleInitBlock(s)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var res: String = "FAIL"
|
var res: String = "FAIL"
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
@@ -195,5 +202,9 @@ fun box(): String {
|
|||||||
InlineFunThis("OK")
|
InlineFunThis("OK")
|
||||||
if (res != "OK") return "FAIL 131: $res"
|
if (res != "OK") return "FAIL 131: $res"
|
||||||
|
|
||||||
|
res = "FAIL 14"
|
||||||
|
InlineClass("OK")
|
||||||
|
if (res != "OK") return "FAIL 141: $res"
|
||||||
|
|
||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user