Files
Ilya Chernikov b821009617 K2: add missing checks for integral parameter type on implicit coercion
#KT-61418 fixed
#KT-61442 fixed
#KT-61441 fixed
2023-08-25 08:55:58 +00:00

25 lines
747 B
Kotlin

/*
* Copyright 2010-2023 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.
*/
@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
import kotlinx.cinterop.*
import platform.Foundation.*
import kotlin.test.*
private fun readString(path: String): String? {
// we don't want actually read anything, just testing for compilability
if (path != "") {
return memScoped {
val error = alloc<ObjCObjectVar<NSError?>>()
NSString.stringWithContentsOfFile(path, NSUTF8StringEncoding, error.ptr)
}
} else {
return null
}
}
fun main() {
readString("")
}