K2: add missing checks for integral parameter type on implicit coercion

#KT-61418 fixed
#KT-61442 fixed
#KT-61441 fixed
This commit is contained in:
Ilya Chernikov
2023-08-23 17:31:43 +02:00
committed by Space Team
parent 84c6333b23
commit b821009617
22 changed files with 150 additions and 10 deletions
@@ -0,0 +1,25 @@
/*
* 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("")
}