// KJS_WITH_FULL_RUNTIME // !LANGUAGE: +InlineClasses // WITH_RUNTIME inline class Bar(val y: Int) inline class Foo(val x: Int) inline class Foo2(val x: Foo) inline class Foo3(val x: Bar) fun testValueParameter(z: Foo) = z.x fun testValueParameter2(z: Foo2) = z.x.x fun testValueParameter3(z: Foo3) = z.x.y fun testReturnType(x: Int) = Foo(x) fun testReturnType2(x: Int) = Foo2(Foo(x)) fun testReturnType3(x: Int) = Foo3(Bar(x)) fun testGenericTypeArgumentInValueParameter(zs: List>) = zs[0].x fun testGenericTypeArgumentInValueParameter2(zs: List>) = zs[0].x.x fun testGenericTypeArgumentInValueParameter3(zs: List>) = zs[0].x.y fun testGenericTypeArgumentInReturnType(x: Int) = listOf(Foo(x)) fun testGenericTypeArgumentInReturnType2(x: Int) = listOf(Foo2(Foo(x))) fun testGenericTypeArgumentInReturnType3(x: Int) = listOf(Foo3(Bar(x))) fun box(): String { if (testValueParameter(Foo(42)) != 42) throw AssertionError() if (testValueParameter2(Foo2(Foo(42))) != 42) throw AssertionError() if (testValueParameter3(Foo3(Bar(42))) != 42) throw AssertionError() if (testReturnType(42).x != 42) throw AssertionError() if (testReturnType2(42).x.x != 42) throw AssertionError() if (testReturnType3(42).x.y != 42) throw AssertionError() if (testGenericTypeArgumentInValueParameter(listOf(Foo(42))) != 42) throw AssertionError() if (testGenericTypeArgumentInValueParameter2(listOf(Foo2(Foo(42)))) != 42) throw AssertionError() if (testGenericTypeArgumentInValueParameter3(listOf(Foo3(Bar(42)))) != 42) throw AssertionError() if (testGenericTypeArgumentInReturnType(42)[0].x != 42) throw AssertionError() if (testGenericTypeArgumentInReturnType2(42)[0].x.x != 42) throw AssertionError() if (testGenericTypeArgumentInReturnType3(42)[0].x.y != 42) throw AssertionError() return "OK" }