https://kotlinlang.org logo
a

Alowaniak

03/08/2019, 7:54 AM
Or use it in init (or assignment for fields):
Copy code
Person(age: Int) {
  init {
    if (age < 0) throw Error()
  }
 val birthYearish = 2019 - age
}
Or in calls to primary ctor etc