Join Slack
Powered by
Isn't it exotic that this code compiles without an...
# announcements
b
buremba
05/23/2019, 11:45 AM
Isn't it exotic that this code compiles without any issue on Kotlin? 🧐
Untitled.kt
👀 3
🤣 3
😁 15
👌 4
🐈 1
buremba
05/23/2019, 11:47 AM
here is why:
https://stackoverflow.com/questions/48310136/why-can-return-return-a-return-in-kotlin
reminds me javascript unfortunately 😞
e
elizarov
05/23/2019, 11:53 AM
Also, if you want to
really
throw:
Copy code
throw throw throw Exception("!!!")
😄 20
elizarov
05/23/2019, 11:55 AM
However, IDEA
does
highlight extra stuff as unreachable code.
elizarov
05/23/2019, 11:56 AM
(returns, tho, not throws)
elizarov
05/23/2019, 11:57 AM
The latter is a bug:
https://youtrack.jetbrains.com/issue/KT-22621
5
Views
Open in Slack
Previous
Next