Add more tests for inline class equality

This commit is contained in:
Steven Schäfer
2019-08-22 16:02:43 +02:00
committed by Alexander Udalov
parent cdc5e1347b
commit b85b2d9af8
23 changed files with 1028 additions and 9 deletions
@@ -0,0 +1,14 @@
// !LANGUAGE: +InlineClasses
inline class A(val a: String)
fun isEqualNA(x: A?, y: A) = x == y
fun isEqualAN(x: A, y: A?) = x == y
fun box(): String {
if (isEqualNA(null, A(""))) return "Fail 1"
if (isEqualAN(A(""), null)) return "Fail 2"
if (!isEqualNA(A(""), A(""))) return "Fail 3"
if (!isEqualAN(A(""), A(""))) return "Fail 4"
return "OK"
}