gsala
11/21/2018, 1:35 PMenum class Potato(val a : Int) {
Potato(3);
}
This is possible in Java but it seems like it's not allowed in Kotlin?Paul Woitaschek
11/21/2018, 1:43 PMdiego-gomez-olvera
11/21/2018, 1:43 PMval
, I found that it is unrelated to the questionPaul Woitaschek
11/21/2018, 1:44 PMPOTATO
gsala
11/21/2018, 1:45 PMsindrenm
11/21/2018, 1:48 PMUse of enum entry names as types is not allowedWhy it's not allowed I can't say for sure.
gsala
11/21/2018, 1:49 PMenum class Potato{
Potato;
}
this is allowedPaul Woitaschek
11/21/2018, 1:52 PMPaul Woitaschek
11/21/2018, 1:53 PMPaul Woitaschek
11/21/2018, 1:53 PMenum class Vegetable { POTATO }
fun sth(t: Vegetable.POTATO) {}
Paul Woitaschek
11/21/2018, 1:53 PMgsala
11/21/2018, 1:54 PMPaul Woitaschek
11/21/2018, 1:54 PM