Minor. Add more tests

This commit is contained in:
Ilmir Usmanov
2021-12-28 11:52:26 +01:00
parent c8817893d4
commit cece7120df
274 changed files with 20551 additions and 25 deletions
@@ -0,0 +1,24 @@
// IGNORE_BACKEND: WASM
// WASM_MUTE_REASON: IGNORED_IN_JS
// IGNORE_BACKEND: JS, JS_IR, NATIVE, JVM
// IGNORE_BACKEND: JS_IR_ES6
// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses, +GenericInlineClassParameter
@file:Suppress("SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_VALUE_CLASS")
OPTIONAL_JVM_INLINE_ANNOTATION
value class Foo<T: String>(val x: T) {
constructor(y: Int) : this("OK" as T) {
if (y == 0) return throw java.lang.IllegalArgumentException()
if (y == 1) return
return Unit
}
constructor(z: Double) : this(z.toInt())
}
fun box(): String {
return Foo<String>(42.0).x
}