Re:The Swift compiler is slow due to how types are inferred
by mike_hearn on Friday June 14, 2024 @04:49AM
(#40678927)
Bear in mind that in both Java and Kotlin you can statically import enum entries:
In practice, you write out ThreatLevel.MIDNIGHT, let the IDE import it for you, and then use an IDE hotkey to do the static import and eliminate the prefix.
[ Parent
| on HN ]
Re:The Swift compiler is slow due to how types are inferred
by jwells89 on Friday June 14, 2024 @09:54AM
(#40680929)
This is true, with the caveat that your imports don’t share member names in common (e.g. you can’t static import two “medium” members, one from SpiceLevel and the other from PizzaSize). Swift doesn’t have this restriction, at least as far as enums are concerned.