why can't Intellij see native kotlin assert ?
# announcements
j
why can't Intellij see native kotlin assert ?
d
assertNonNull(input)
I'm pretty sure the braces are the issue.
You need
assert(input != null) { "input must not be null" }
Although for your use case consider using
require
instead of
assert
.
l
I believe assert is JVM only, tho, isn't it?
d
It's multiplatform. Although it's different from the JVM (Java) asserts.
l
Perhaps the documentation is wrong, then? https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/assert.html
It's native too, but it's not mpp
d
It's mpp but just not on JS, Or does it require all three to be labelled as mpp?
l
Idk hahaha
I'd say its mpp if it's implemented in common
but idk what could be the right term.
require
is common, for example
d
Hmm, I guess if the
kotlin-multipaltform
plugin was used? Technically Native itself is multiplatform.
l
that's true