elect
08/26/2019, 12:20 PMinit
without body, eg: init = bar()
Fudge
08/26/2019, 12:23 PMSiebelsTim
08/26/2019, 2:29 PMDominaezzz
08/26/2019, 3:23 PMDominaezzz
08/26/2019, 3:23 PMDominaezzz
08/26/2019, 3:23 PMelect
08/26/2019, 3:54 PMmain
, bar
shall return Unit
elect
08/26/2019, 3:55 PMinit {
bar()
}
Dominaezzz
08/26/2019, 4:12 PMkz
08/26/2019, 4:43 PMinit
is currently the only place you’re allowed to “assign” (initialize) `val`s (outside of initializing inline in the property declaration). If you extract that to a method, people can call it outside of init
so those statements will be illegal.josephivie
08/26/2019, 10:54 PM