Basic inline class mapping to the underlying representation

This commit is contained in:
Mikhail Zarechenskiy
2018-01-24 14:33:30 +03:00
parent 4b4525ec17
commit d5400f11a3
7 changed files with 106 additions and 27 deletions
@@ -0,0 +1,26 @@
// !LANGUAGE: +InlineClasses
inline class Foo(val x: Int)
object Test {
fun asParam(a: Foo) {}
fun asReturn(): Foo = TODO()
fun Foo.asExtension() {}
fun Foo.asAll(x: Any?, a: Foo, b: Int): Foo = TODO()
}
// method: Test::asParam
// jvm signature: (I)V
// generic signature: null
// method: Test::asReturn
// jvm signature: ()I
// generic signature: null
// method: Test::asExtension
// jvm signature: (I)V
// generic signature: null
// method: Test::asAll
// jvm signature: (ILjava/lang/Object;II)I
// generic signature: null
@@ -0,0 +1,19 @@
// !LANGUAGE: +InlineClasses
inline class Foo(val x: Int?)
class SimpleClass
inline class Bar(val x: SimpleClass)
object Test {
fun asParam(a: Foo) {}
fun asReturn(): Bar = TODO()
}
// method: Test::asParam
// jvm signature: (Ljava/lang/Integer;)V
// generic signature: null
// method: Test::asReturn
// jvm signature: ()LSimpleClass;
// generic signature: null