Is it too harsh to reject the whole class if the assumptions on class hierarchy which were necessary to compile the switch statements used in the class are not valid at runtime?

That is one of the questions!  And the other question is: is this too expensive to do this check at runtime, given that it will fail so infrequently.

If we can detect it cheaply enough, though, we can also repair the situation and fall back to linear testing of patterns.  This seems better (we can execute the statement the user wrote) than failing. My real question is can I punt on trying to detect it, and still optimize the common cases  down to O(1) dispatch....

Reply via email to