https://kotlinlang.org logo
#random
Title
k

kevinmost

04/29/2016, 3:49 PM
I might be missing something, but is there any way to bail out of an
init{}
block early, similar to how you'd
return
out of a method that returns
Unit
? My guess is no, because you can't do that in a Java constructor.
return
and
return@init
didn't work. Just curious if there is a way. Would be useful, for example, to be able to guard against a constructor param being
null
and leave the init block