[K/N] Adjust moved special backend checks tests
^KT-61564
This commit is contained in:
committed by
Space Team
parent
8f12bf6cc8
commit
08bc0a6bd0
@@ -1,10 +1,10 @@
|
||||
This testsuit fir specialBackendChecks on Mac hosts relies on platform libs are installed.
|
||||
To run testsuit locally, make sure the above is executed first:
|
||||
- `./gradlew :kotlin-native:platformLibs:macos_arm64Install` or
|
||||
- `./gradlew :kotlin-native:platformLibs:macos_arm64Install` or
|
||||
- `./gradlew :kotlin-native:platformLibs:macos_x64Install`
|
||||
|
||||
This testsuit is run differently for K1 and K2 frontends:
|
||||
- K1/N manual: run `compiler/testData/diagnostics/nativeTests/specialBackendChecks/runtests.sh -language-version 1.9`,
|
||||
- K1/N manual: run `compiler/testData/diagnostics/nativeTests/specialBackendChecks/runtests.sh -language-version 1.9`,
|
||||
- K2/N manual: run `compiler/testData/diagnostics/nativeTests/specialBackendChecks/runtests.sh`,
|
||||
- K2/N tests are also run in scope of `FirLightTreeOldFrontendNativeDiagnosticsTestGenerated` and `FirPsiOldFrontendNativeDiagnosticsTestGenerated`.
|
||||
|
||||
@@ -57,4 +57,100 @@ compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t64.kt
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t8.kt
|
||||
/tmp/t8.kt:8:5: error: type kotlin.Function0<*> of callback parameter 1 is not supported here: * as return type
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t9.kt
|
||||
/tmp/t41.kt:9:5: error: kotlinx.cinterop.staticCFunction must take an unbound, non-capturing function or lambda, but captures at:
|
||||
/tmp/t41.kt:7:17: x
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t48.kt
|
||||
/tmp/t48.kt:11:12: error: kotlin.native.concurrent.Worker.execute must take an unbound, non-capturing function or lambda, but captures at:
|
||||
/tmp/t48.kt:11:50
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t49.kt
|
||||
/tmp/t49.kt:7:12: error: kotlin.native.concurrent.Worker.execute must take an unbound, non-capturing function or lambda, but captures at:
|
||||
/tmp/t49.kt:7:61: x
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t50.kt
|
||||
/tmp/t50.kt:12:16: error: kotlin.native.concurrent.Worker.execute must take an unbound, non-capturing function or lambda, but captures at:
|
||||
/tmp/t50.kt:12:54
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t51.kt
|
||||
/tmp/t51.kt:10:28: error: kotlin.native.concurrent.Worker.execute must take an unbound, non-capturing function or lambda, but captures at:
|
||||
/tmp/t51.kt:10:66
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t54.kt
|
||||
/tmp/t54.kt:2:44: error: no spread elements allowed here
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t55.kt
|
||||
/tmp/t55.kt:2:37: error: all elements of binary blob must be constants
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t56.kt
|
||||
/tmp/t56.kt:2:29: error: incorrect value for binary data: 1000
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t57.kt
|
||||
/tmp/t57.kt:2:13: error: expected at least one element
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/nativeRef/t52.kt
|
||||
/tmp/t52.kt:6:5: error: kotlin.native.ref.createCleaner must take an unbound, non-capturing function or lambda, but captures at:
|
||||
/tmp/t52.kt:6:33: x
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/nativeRef/t53.kt
|
||||
/tmp/t53.kt:10:5: error: kotlin.native.ref.createCleaner must take an unbound, non-capturing function or lambda, but captures at:
|
||||
/tmp/t53.kt:10:23
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t15.kt
|
||||
/tmp/t15.kt:6:26: error: type kotlin.Function0<kotlin.Unit> is not supported here: not supported as variadic argument
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t16.kt
|
||||
/tmp/t16.kt:8:26: error: type <root>.Z is not supported here: doesn't correspond to any C type
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t17.kt
|
||||
/tmp/t17.kt:8:15: error: super calls to Objective-C protocols are not allowed
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t18.kt
|
||||
/tmp/t18.kt:8:19: error: super calls to Objective-C meta classes are not supported yet
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t2.kt
|
||||
/tmp/t2.kt:6:5: error: 'handleFailureInFunction' overrides nothing.
|
||||
override fun handleFailureInFunction(functionName: String, file: String, lineNumber: NSInteger /* = Long */, description: String?, vararg args: Any?) { }
|
||||
^
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t20.kt
|
||||
/tmp/t20.kt:6:1: error: only classes are supported as subtypes of Objective-C types
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t21.kt
|
||||
/tmp/t21.kt:6:1: error: non-final Kotlin subclasses of Objective-C classes are not yet supported
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t22.kt
|
||||
/tmp/t22.kt:6:1: error: fields are not supported for Companion of subclass of ObjC type
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t23.kt
|
||||
/tmp/t23.kt:8:1: error: mixing Kotlin and Objective-C supertypes is not supported
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t24.kt
|
||||
/tmp/t24.kt:6:1: error: only companion objects of subclasses of Objective-C classes can inherit from Objective-C metaclasses
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t25.kt
|
||||
/tmp/t25.kt:7:5: error: can't override 'toString', override 'description' instead
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t26.kt
|
||||
/tmp/t26.kt:11:9: error: @kotlinx.cinterop.ObjCAction method must not have extension receiver
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t27.kt
|
||||
/tmp/t27.kt:11:13: error: unexpected @kotlinx.cinterop.ObjCAction method parameter type: kotlin.String
|
||||
Only Objective-C object types are supported here
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t28.kt
|
||||
/tmp/t28.kt:8:5: error: unexpected @kotlinx.cinterop.ObjCAction method return type: kotlin.Int
|
||||
Only 'Unit' is supported here
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t29.kt
|
||||
/tmp/t29.kt:9:5: error: @kotlinx.cinterop.ObjCOutlet property must be var
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t30.kt
|
||||
/tmp/t30.kt:10:9: error: @kotlinx.cinterop.ObjCOutlet must not have extension receiver
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t31.kt
|
||||
/tmp/t31.kt:8:5: error: unexpected @kotlinx.cinterop.ObjCOutlet type: kotlin.String
|
||||
Only Objective-C object types are supported here
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t32.kt
|
||||
/tmp/t32.kt:8:5: error: constructor with @kotlinx.cinterop.ObjCObjectBase.OverrideInit doesn't override any super class constructor.
|
||||
It must completely match by parameter names and types.
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t33.kt
|
||||
/tmp/t33.kt:8:5: error: constructor with @kotlinx.cinterop.ObjCObjectBase.OverrideInit overrides initializer that is already overridden explicitly
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t34.kt
|
||||
/tmp/t34.kt:8:5: error: only 0, 1 or 2 parameters are supported here
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t35.kt
|
||||
/tmp/t35.kt:7:13: error: unable to call non-designated initializer as super constructor
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t4.kt
|
||||
/tmp/t4.kt:6:21: error: callable references to variadic Objective-C methods are not supported
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t5.kt
|
||||
/tmp/t5.kt:6:82: error: passing String as variadic Objective-C argument is ambiguous; cast it to NSString or pass with '.cstr' as C string
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t6.kt
|
||||
/tmp/t6.kt:6:96: error: when calling variadic Objective-C methods spread operator is supported only for *arrayOf(...)
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t61.kt
|
||||
/tmp/t61.kt:4:5: error: only companion objects of subclasses of Objective-C classes can inherit from Objective-C metaclasses
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t62.kt
|
||||
/tmp/t62.kt:3:1: error: only companion objects of subclasses of Objective-C classes can inherit from Objective-C metaclasses
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t7.kt
|
||||
/tmp/t7.kt:6:40: error: when calling variadic C functions spread operator is supported only for *arrayOf(...)
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/posix/t3.kt
|
||||
/tmp/t3.kt:6:13: error: callable references to variadic C functions are not supported
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/posix/t36.kt
|
||||
/tmp/t36.kt:6:13: error: native interop types constructors must not be called directly
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/reflect/t58.kt
|
||||
/tmp/t58.kt:6:5: error: non-reified type parameters with recursive bounds are not supported yet: TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Comparable<T of <root>.foo>] reified:false
|
||||
compiler/testData/diagnostics/nativeTests/specialBackendChecks/reflect/t59.kt
|
||||
/tmp/t59.kt:6:5: error: non-reified type parameters with recursive bounds are not supported yet: TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Comparable<T of <root>.foo>] reified:false
|
||||
```
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
import kotlinx.cinterop.*
|
||||
|
||||
fun foo(x: Int, vararg s: String): Int {
|
||||
@@ -6,6 +7,7 @@ fun foo(x: Int, vararg s: String): Int {
|
||||
return sum
|
||||
}
|
||||
|
||||
@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
|
||||
fun bar() {
|
||||
staticCFunction(::foo)
|
||||
}
|
||||
|
||||
+2
@@ -1,7 +1,9 @@
|
||||
// FIR_IDENTICAL
|
||||
import kotlinx.cinterop.*
|
||||
|
||||
fun foo(f: Function1<*, Int>) = f
|
||||
|
||||
@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
|
||||
fun bar() {
|
||||
staticCFunction(::foo)
|
||||
}
|
||||
|
||||
+2
@@ -1,7 +1,9 @@
|
||||
// FIR_IDENTICAL
|
||||
import kotlinx.cinterop.*
|
||||
|
||||
fun foo(f: Function1<in Int, Int>) = f
|
||||
|
||||
@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
|
||||
fun bar() {
|
||||
staticCFunction(::foo)
|
||||
}
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
|
||||
import kotlinx.cinterop.*
|
||||
|
||||
fun foo(x: CValue<*>?) = x
|
||||
|
||||
+2
@@ -1,5 +1,7 @@
|
||||
// FIR_IDENTICAL
|
||||
import kotlinx.cinterop.*
|
||||
|
||||
@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
|
||||
fun <T: CVariable> bar() {
|
||||
|
||||
fun foo(x: CValue<T>) = x
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
|
||||
import kotlinx.cinterop.*
|
||||
|
||||
class Z(rawPtr: NativePtr): CStructVar(rawPtr)
|
||||
|
||||
+3
@@ -1,6 +1,9 @@
|
||||
// FIR_IDENTICAL
|
||||
// OPT_IN: kotlin.native.internal.InternalForKotlinNative
|
||||
import kotlinx.cinterop.*
|
||||
import kotlinx.cinterop.internal.*
|
||||
|
||||
@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
|
||||
@CStruct(spelling = "struct { }") class Z constructor(rawPtr: NativePtr) : CStructVar(rawPtr) {
|
||||
val x: Pair<Int, Int>? = null
|
||||
@CStruct.MemberAt(offset = 0L) get
|
||||
|
||||
+3
@@ -1,6 +1,9 @@
|
||||
// FIR_IDENTICAL
|
||||
// OPT_IN: kotlin.native.internal.InternalForKotlinNative
|
||||
import kotlinx.cinterop.*
|
||||
import kotlinx.cinterop.internal.*
|
||||
|
||||
@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
|
||||
@CStruct(spelling = "struct { }") class Z constructor(rawPtr: NativePtr) : CStructVar(rawPtr) {
|
||||
var x: Pair<Int, Int>? = null
|
||||
@CStruct.MemberAt(offset = 0L) get
|
||||
|
||||
+2
@@ -1,9 +1,11 @@
|
||||
// FIR_IDENTICAL
|
||||
import kotlinx.cinterop.*
|
||||
|
||||
class Z {
|
||||
fun foo(x: Int) = x
|
||||
}
|
||||
|
||||
@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
|
||||
fun bar() {
|
||||
staticCFunction(Z()::foo)
|
||||
}
|
||||
|
||||
+2
@@ -1,5 +1,7 @@
|
||||
// FIR_IDENTICAL
|
||||
import kotlinx.cinterop.*
|
||||
|
||||
@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
|
||||
fun bar(x: Int) {
|
||||
|
||||
fun foo() = x
|
||||
|
||||
+2
@@ -1,7 +1,9 @@
|
||||
// FIR_IDENTICAL
|
||||
import kotlinx.cinterop.*
|
||||
|
||||
fun foo(x: Any) = x
|
||||
|
||||
@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
|
||||
fun bar() {
|
||||
staticCFunction<String, Any>(::foo)
|
||||
}
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
import kotlinx.cinterop.*
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
fun bar(x: Float) = x.signExtend<Int>()
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
import kotlinx.cinterop.*
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
fun bar(x: Int) = x.signExtend<Float>()
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
import kotlinx.cinterop.*
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
fun bar(x: Int) = x.signExtend<Short>()
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
import kotlinx.cinterop.*
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
fun bar(x: Int) = x.narrow<Long>()
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
|
||||
import kotlinx.cinterop.*
|
||||
|
||||
fun bar(x: Int) = x.convert<String>()
|
||||
|
||||
+3
@@ -1,3 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
|
||||
import kotlinx.cinterop.*
|
||||
|
||||
class Vertex constructor(rawPtr: NativePtr) : CStructVar(rawPtr) {
|
||||
@@ -6,5 +8,6 @@ class Vertex constructor(rawPtr: NativePtr) : CStructVar(rawPtr) {
|
||||
var r: Float = 0f
|
||||
var g: Float = 0f
|
||||
var b: Float = 0f
|
||||
@Suppress("DEPRECATION")
|
||||
companion object : CStructVar.Type(40, 8)
|
||||
}
|
||||
|
||||
+2
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
import kotlinx.cinterop.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
@@ -17,6 +18,7 @@ fun startCoroutine(block: suspend () -> Unit) {
|
||||
block.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
@OptIn(kotlinx.cinterop.BetaInteropApi::class)
|
||||
fun main() {
|
||||
autoreleasepool {
|
||||
startCoroutine {
|
||||
|
||||
+3
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
import kotlinx.cinterop.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
@@ -17,8 +18,10 @@ fun startCoroutine(block: suspend () -> Unit) {
|
||||
block.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
@OptIn(kotlinx.cinterop.BetaInteropApi::class)
|
||||
inline fun <T> myAutoreleasepool(block: () -> T) = autoreleasepool(block)
|
||||
|
||||
@OptIn(kotlinx.cinterop.BetaInteropApi::class)
|
||||
fun main() {
|
||||
autoreleasepool {
|
||||
startCoroutine {
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
// FIR_IDENTICAL
|
||||
import kotlinx.cinterop.*
|
||||
|
||||
fun foo(f: Function0<*>) = f
|
||||
|
||||
@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
|
||||
fun bar() {
|
||||
staticCFunction(::foo)
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
// FIR_IDENTICAL
|
||||
import kotlinx.cinterop.*
|
||||
|
||||
fun foo(f: Function0<out Int>) = f
|
||||
|
||||
@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
|
||||
fun bar() {
|
||||
staticCFunction(::foo)
|
||||
}
|
||||
|
||||
+2
@@ -1,9 +1,11 @@
|
||||
// FIR_IDENTICAL
|
||||
import kotlin.native.concurrent.*
|
||||
|
||||
class Z(val x: Int) {
|
||||
fun bar(s: String) = s + x.toString()
|
||||
}
|
||||
|
||||
@OptIn(ObsoleteWorkersApi::class)
|
||||
fun foo(x: Int) {
|
||||
val worker = Worker.start()
|
||||
worker.execute(TransferMode.SAFE, { "zzz" }, Z(x)::bar)
|
||||
|
||||
+2
@@ -1,5 +1,7 @@
|
||||
// FIR_IDENTICAL
|
||||
import kotlin.native.concurrent.*
|
||||
|
||||
@OptIn(ObsoleteWorkersApi::class)
|
||||
fun foo(x: Int) {
|
||||
val worker = Worker.start()
|
||||
worker.execute(TransferMode.SAFE, { "zzz" }) { s -> s + x.toString() }
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
@file:OptIn(ObsoleteWorkersApi::class)
|
||||
import kotlin.native.concurrent.*
|
||||
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
@file:OptIn(ObsoleteWorkersApi::class)
|
||||
import kotlin.native.concurrent.*
|
||||
|
||||
|
||||
+1
@@ -1 +1,2 @@
|
||||
// FIR_IDENTICAL
|
||||
fun foo(arr: ShortArray) = immutableBlobOf(*arr)
|
||||
|
||||
+1
@@ -1 +1,2 @@
|
||||
// FIR_IDENTICAL
|
||||
fun foo(x: Short) = immutableBlobOf(x)
|
||||
|
||||
+1
@@ -1 +1,2 @@
|
||||
// FIR_IDENTICAL
|
||||
fun foo() = immutableBlobOf(1000)
|
||||
|
||||
+1
@@ -1 +1,2 @@
|
||||
// FIR_IDENTICAL
|
||||
fun foo() = immutableBlobOf()
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
import kotlin.native.ref.*
|
||||
|
||||
@OptIn(kotlin.experimental.ExperimentalNativeApi::class)
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
import kotlin.native.ref.*
|
||||
|
||||
class C(val x: Int) {
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_PLATFORM_LIBS
|
||||
import platform.darwin.*
|
||||
import platform.Foundation.*
|
||||
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_PLATFORM_LIBS
|
||||
import platform.darwin.*
|
||||
import platform.Foundation.*
|
||||
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_PLATFORM_LIBS
|
||||
import platform.darwin.*
|
||||
import platform.Foundation.*
|
||||
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_PLATFORM_LIBS
|
||||
import platform.darwin.*
|
||||
|
||||
class Foo : NSObject() {
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
import platform.darwin.*
|
||||
import platform.Foundation.*
|
||||
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_PLATFORM_LIBS
|
||||
import platform.darwin.*
|
||||
import platform.Foundation.*
|
||||
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_PLATFORM_LIBS
|
||||
import platform.darwin.*
|
||||
import platform.Foundation.*
|
||||
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_PLATFORM_LIBS
|
||||
import platform.darwin.*
|
||||
import platform.Foundation.*
|
||||
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_PLATFORM_LIBS
|
||||
import platform.darwin.*
|
||||
import platform.Foundation.*
|
||||
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_PLATFORM_LIBS
|
||||
import platform.darwin.*
|
||||
import platform.Foundation.*
|
||||
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_PLATFORM_LIBS
|
||||
import platform.darwin.*
|
||||
import platform.Foundation.*
|
||||
|
||||
|
||||
+4
@@ -1,8 +1,12 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_PLATFORM_LIBS
|
||||
import kotlinx.cinterop.*
|
||||
import platform.darwin.*
|
||||
import platform.Foundation.*
|
||||
|
||||
@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
|
||||
class Zzz : NSAssertionHandler() {
|
||||
@OptIn(kotlinx.cinterop.BetaInteropApi::class)
|
||||
@ObjCAction
|
||||
fun String.foo() = println(this)
|
||||
}
|
||||
|
||||
+4
@@ -1,8 +1,12 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_PLATFORM_LIBS
|
||||
import kotlinx.cinterop.*
|
||||
import platform.darwin.*
|
||||
import platform.Foundation.*
|
||||
|
||||
@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
|
||||
class Zzz : NSAssertionHandler() {
|
||||
@OptIn(kotlinx.cinterop.BetaInteropApi::class)
|
||||
@ObjCAction
|
||||
fun foo(x: String) = println(x)
|
||||
}
|
||||
|
||||
+3
@@ -1,8 +1,11 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_PLATFORM_LIBS
|
||||
import kotlinx.cinterop.*
|
||||
import platform.darwin.*
|
||||
import platform.Foundation.*
|
||||
|
||||
class Zzz : NSAssertionHandler() {
|
||||
@OptIn(kotlinx.cinterop.BetaInteropApi::class)
|
||||
@ObjCAction
|
||||
fun foo() = 42
|
||||
}
|
||||
|
||||
+4
@@ -1,8 +1,12 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_PLATFORM_LIBS
|
||||
import kotlinx.cinterop.*
|
||||
import platform.darwin.*
|
||||
import platform.Foundation.*
|
||||
|
||||
@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
|
||||
class Zzz : NSAssertionHandler() {
|
||||
@OptIn(kotlinx.cinterop.BetaInteropApi::class)
|
||||
@ObjCOutlet
|
||||
val x: NSObject get() = this
|
||||
}
|
||||
|
||||
+3
@@ -1,8 +1,11 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_PLATFORM_LIBS
|
||||
import kotlinx.cinterop.*
|
||||
import platform.darwin.*
|
||||
import platform.Foundation.*
|
||||
|
||||
class Zzz : NSAssertionHandler() {
|
||||
@OptIn(kotlinx.cinterop.BetaInteropApi::class)
|
||||
@ObjCOutlet
|
||||
var NSObject.x: NSObject
|
||||
get() = this
|
||||
|
||||
+3
@@ -1,8 +1,11 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_PLATFORM_LIBS
|
||||
import kotlinx.cinterop.*
|
||||
import platform.darwin.*
|
||||
import platform.Foundation.*
|
||||
|
||||
class Zzz : NSAssertionHandler() {
|
||||
@OptIn(kotlinx.cinterop.BetaInteropApi::class)
|
||||
@ObjCOutlet
|
||||
var x: String
|
||||
get() = "zzz"
|
||||
|
||||
+3
@@ -1,8 +1,11 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_PLATFORM_LIBS
|
||||
import kotlinx.cinterop.*
|
||||
import platform.darwin.*
|
||||
import platform.Foundation.*
|
||||
|
||||
class Zzz : NSAssertionHandler {
|
||||
@OptIn(kotlinx.cinterop.BetaInteropApi::class)
|
||||
@OverrideInit
|
||||
constructor(x: Int) { }
|
||||
}
|
||||
|
||||
+4
@@ -1,10 +1,14 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_PLATFORM_LIBS
|
||||
import kotlinx.cinterop.*
|
||||
import platform.darwin.*
|
||||
import platform.Foundation.*
|
||||
|
||||
class Zzz : NSString {
|
||||
@OptIn(kotlinx.cinterop.BetaInteropApi::class)
|
||||
@OverrideInit
|
||||
constructor(coder: NSCoder) { }
|
||||
|
||||
@Suppress("OVERRIDE_DEPRECATION")
|
||||
override fun initWithCoder(coder: NSCoder): String? = "zzz"
|
||||
}
|
||||
|
||||
+3
@@ -1,8 +1,11 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_PLATFORM_LIBS
|
||||
import kotlinx.cinterop.*
|
||||
import platform.darwin.*
|
||||
import platform.Foundation.*
|
||||
|
||||
class Zzz : NSAssertionHandler() {
|
||||
@OptIn(kotlinx.cinterop.BetaInteropApi::class)
|
||||
@ObjCAction
|
||||
fun foo(x: NSObject, y: NSObject, z: NSObject) { }
|
||||
}
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_PLATFORM_LIBS
|
||||
import kotlinx.cinterop.*
|
||||
import platform.darwin.*
|
||||
import platform.Foundation.*
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_PLATFORM_LIBS
|
||||
import platform.darwin.*
|
||||
import platform.Foundation.*
|
||||
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_PLATFORM_LIBS
|
||||
import platform.darwin.*
|
||||
import platform.Foundation.*
|
||||
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_PLATFORM_LIBS
|
||||
import platform.darwin.*
|
||||
import platform.Foundation.*
|
||||
|
||||
|
||||
+1
-5
@@ -1,8 +1,4 @@
|
||||
/*
|
||||
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
// FIR_IDENTICAL
|
||||
// KT-50109
|
||||
class Foo {
|
||||
companion object : platform.darwin.NSObjectMeta()
|
||||
|
||||
+1
-5
@@ -1,7 +1,3 @@
|
||||
/*
|
||||
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
// FIR_IDENTICAL
|
||||
// KT-50109
|
||||
class Foo : platform.darwin.NSObjectMeta()
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_PLATFORM_LIBS
|
||||
import platform.darwin.*
|
||||
import platform.Foundation.*
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_PLATFORM_LIBS
|
||||
import platform.posix.*
|
||||
|
||||
fun main() {
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
// FIR_IDENTICAL
|
||||
import kotlinx.cinterop.*
|
||||
import platform.posix.*
|
||||
|
||||
@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
|
||||
fun foo() = stat(malloc(42u)!!.rawValue)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
import kotlin.reflect.*
|
||||
|
||||
@OptIn(kotlin.ExperimentalStdlibApi::class)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
import kotlin.reflect.*
|
||||
|
||||
@OptIn(kotlin.ExperimentalStdlibApi::class)
|
||||
|
||||
Reference in New Issue
Block a user