JVM IR: Avoid parameter null-checks in inline class impl methods
This commit is contained in:
committed by
Alexander Udalov
parent
cdd3f82396
commit
475079611d
Vendored
+7
-2
@@ -1,9 +1,9 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
|
||||
inline class AsNonNullPrimitive(val i: Int)
|
||||
inline class AsNonNullReference(val s: String)
|
||||
// ^ 5 assertions (constructor, box method, erased constructor, 2 assertions in equals--impl)
|
||||
// ^ JVM: 5 assertions (constructor, box method, erased constructor, 2 assertions in equals--impl)
|
||||
// JVM IR: 1 assertion (erased constructor)
|
||||
|
||||
fun nonNullPrimitive(a: AsNonNullPrimitive) {}
|
||||
|
||||
@@ -13,5 +13,10 @@ fun AsNonNullReference.nonNullReferenceExtension(b1: AsNonNullReference) {} // 2
|
||||
fun asNullablePrimitive(c: AsNonNullPrimitive?) {}
|
||||
fun asNullableReference(c: AsNonNullReference?) {}
|
||||
|
||||
// JVM_TEMPLATES
|
||||
// 8 checkParameterIsNotNull
|
||||
// 0 checkNotNullParameter
|
||||
|
||||
// JVM_IR_TEMPLATES
|
||||
// 4 checkParameterIsNotNull
|
||||
// 0 checkNotNullParameter
|
||||
|
||||
Reference in New Issue
Block a user