diff --git a/kotlin-native/backend.native/tests/interop/forwardDeclarations/forwardDeclarations.kt b/kotlin-native/backend.native/tests/interop/forwardDeclarations/forwardDeclarations.kt index e359f015fb3..312ae42befe 100644 --- a/kotlin-native/backend.native/tests/interop/forwardDeclarations/forwardDeclarations.kt +++ b/kotlin-native/backend.native/tests/interop/forwardDeclarations/forwardDeclarations.kt @@ -1,9 +1,7 @@ // This test mostly checks frontend behaviour. import cForwardDeclarations.* - -// Note: there are no practical cases for this type, but it works in K1 so better to have a test for this. -import cnames.structs.StructUndeclared +import cnames.structs.StructDeclared import kotlin.test.assertEquals import kotlinx.cinterop.COpaque @@ -11,32 +9,22 @@ import kotlinx.cinterop.CStructVar import kotlinx.cinterop.ptr // The test should also check that these references can't be resolved, but the test infra doesn't support this yet: // import cForwardDeclarations.StructUndeclared +// import cnames.structs.StructUndeclared // Supported in K1 though. fun checkSubtype2() {} -fun checkSubtype3() {} -fun checkSubtype4() {} // Here we rely on frontend reporting conflicting overloads if some of these types turn out to be the same. -fun checkDifferentTypes(s: StructUndeclared?) = 0 fun checkDifferentTypes(s: StructDeclared?) = 1 fun checkDifferentTypes(s: StructDefined?) = 2 fun main() { - // Checking it is the same type: - checkSubtype3() - checkSubtype2() - - checkSubtype4() checkSubtype2() - checkSubtype4() checkSubtype2() - val undeclared: StructUndeclared? = null val declared: StructDeclared? = null val defined: StructDefined? = null - assertEquals(0, checkDifferentTypes(undeclared)) assertEquals(1, checkDifferentTypes(declared)) assertEquals(2, checkDifferentTypes(defined))