[MPP] Apply @UnsafeNumber to functions and properties

KT-51224
KT-51215
This commit is contained in:
Pavel Kirpichenkov
2022-02-14 10:41:03 +03:00
committed by teamcity
parent f8a1395a03
commit 6674c3f482
14 changed files with 216 additions and 75 deletions
@@ -28,9 +28,13 @@ expect fun function6(): Planet
expect fun function7(): C
// Optimistic Number Commonization: KT-48455, KT-48568
@kotlinx.cinterop.UnsafeNumber(["js: kotlin.Int", "jvm: kotlin.Long"])
expect val propertyWithMismatchedType1: Int
@kotlinx.cinterop.UnsafeNumber(["js: kotlin.Int", "jvm: kotlin.Short"])
expect val propertyWithMismatchedType2: Short
@kotlinx.cinterop.UnsafeNumber(["js: kotlin.Int", "jvm: kotlin.Long"])
expect fun functionWithMismatchedType1(): Int
@kotlinx.cinterop.UnsafeNumber(["js: kotlin.Int", "jvm: kotlin.Short"])
expect fun functionWithMismatchedType2(): Short
expect class Box<T>(value: T) {
@@ -0,0 +1,4 @@
package kotlinx.cinterop
@Target(AnnotationTarget.TYPEALIAS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY)
@Retention(AnnotationRetention.BINARY)
annotation class UnsafeNumber(val actualPlatformTypes: Array<String>)