Hi guys, I tried getting started on kotlin native ...
# getting-started
j
Hi guys, I tried getting started on kotlin native and dont understand whether or not we can use exceptions. What ever I do cannot import IllegalArgumentException in native code. Why is that? Tried searching but didn;t find anywhere stating that this shoudn;t work
a
You certainly can use exceptions in native — you shouldn’t need to import IllegalArgumentException, though, as kotlin.* classes are imported by default. You will need to use the kotlin.IllegalArgumentException name, though; in JVM it’s typealiased, but in Native it’s significant. https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-illegal-argument-exception/#kotlin.IllegalArgumentException
❤️ 1
j
Thanks a lot!