Minor. Add tests

This commit is contained in:
Ilmir Usmanov
2021-12-22 09:05:10 +01:00
parent 909b455758
commit 4f95171472
103 changed files with 6538 additions and 2 deletions
@@ -0,0 +1,20 @@
// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses, +GenericInlineClassParameter
OPTIONAL_JVM_INLINE_ANNOTATION
value class Z<T: Int>(val x: T)
OPTIONAL_JVM_INLINE_ANNOTATION
value class L<T: Long>(val x: T)
OPTIONAL_JVM_INLINE_ANNOTATION
value class S<T: String>(val x: T)
fun box(): String {
if ((Z<Int>::x).get(Z(42)) != 42) throw AssertionError()
if ((L<Long>::x).get(L(1234L)) != 1234L) throw AssertionError()
if ((S<String>::x).get(S("abcdef")) != "abcdef") throw AssertionError()
return "OK"
}