What I am mentioning would probably sound a bit si...
# intellij
n
What I am mentioning would probably sound a bit silly so here it is. In a Kotlin Native code base I have the following code:
Copy code
// ...
internal fun CPointer<FILE>.readLine(): String = memScoped {
    val buffer = alloc<CPointerVar<ByteVar>>()
    val len = alloc<ULongVar>()
    val bytesRead = getline(__lineptr = buffer.ptr, __n = len.ptr, __stream = this@readLine)
    if (bytesRead != -1L) buffer.value?.toKString() ?: "" else ""
}
In the code there is a minor issue where a C pointer has been allocated (via the KotlinX C Interop library), but isn't being used by anything (outside of the getline function). It would be nice if the Kotlin IntelliJ plugin could detect some issues with C interop, and show them as warnings (yellow squigglies), or even better provide some quick fixes for the ones that can be easily fixed.
a
@Artyom Degtyarev [JB] can you please take a look?
a
I’m not sure what to tell. There is no such functionality in the plugin, and I’m not informed on any community initiatives in this area. Probably worth a feature request, at least to create a place for the public discussion.
🙏 1