https://kotlinlang.org logo
#kotlin-native
Title
# kotlin-native
k

Krystian

01/28/2023, 11:37 PM
Is there a way to get current line number in Kotlin/Native? I found few info about using Throwable Stack Trace, but that doesn't seem to be in K/N?
a

Adam S

01/29/2023, 10:07 PM
with some parsing, this hack might work
Copy code
fun main() {
    println("got stacktrace ${Exception("").stackTraceToString()}")
}
(I think this is gross and I wouldn’t use it myself :) )
8 Views