Re:Embedded Swift on the Raspberry Pi Pico
by refulgentis on Tuesday March 05, 2024 @11:09PM
(#39612199)
Correct, Dart has enum exhaustiveness checks, associated types, and expressions as of 11-13 months ago: https://cfdevelop.medium.com/dart-switch-expressions-33145c3... (keeping it short and simple because I'm at -2 on the original post, don't want to look like I'm argumentative)
To clarify, in the above scenario in dart I can have an input with type MyEnum and do this?
switch myEnum {
case let one:
}Last I checked Dart required a nested if/else tree and didn't have compiler-guarantees of switch completeness like the above.