ID:2026629
 
Not Feasible
Applies to:DM Language
Status: Not Feasible

Implementing this feature is not possible now or in the foreseeable future
See: Title.

It would make some of our if -> else if -> blah trees a bit nicer.
Lummox JR resolved issue (Not Feasible)
The switch() statement isn't meant to be used for types; at least not for general istype() checks where it could match every subtype too. switch() only works with specific values, or for numbers it allows ranges, but that's it.

But if you're doing something where you're just trying to collapse a bunch of if/else trees with istype() checks, then it seems like what you really want is polymorphism anyway.
in our case, we use if/else if trees of istype() checks, where speed matters (proc call overhead), or because src type matters too, (like item interaction)
That may be all you can do, then. This definitely isn't something switch() could take on, becuase it does specific-value comparisons.

Internally our switch() is actually just an if/else anyway.