Opened 14 years ago

Closed 11 years ago

#1545 closed defect (invalid)

The bootstrapped compiler should warn about overlapping patterns in match!

Reported by: Adrian Pop Owned by: Adrian Pop
Priority: critical Milestone:
Component: MetaModelica Version:
Keywords: Cc: Adrian Pop, Martin Sjölund

Description

If you have a match (not matchcontinue) and you add two cases with overlapping
patterns to it and the first one fails the entire function fails.
We got bitten by this several times.

Change History (5)

comment:1 by Martin Sjölund, 14 years ago

That is the semantics of match - it is supposed to fail if the first one matches...

comment:2 by Adrian Pop, 14 years ago

Agreed, but it should tell the user at compile time that this might happen because it has
overlapping patterns. I really think we should not allow overlapping patterns in match.
If there are overlapping patterns the match should be changed to matchcontinue.

comment:3 by Martin Sjölund, 14 years ago

Enable the notifications for dead code elimination. If a case cannot be reached, it is not even part of the code. And I do print such a notification if asked for :D

comment:4 by Martin Sjölund, 11 years ago

Cc: adrpo, adrpo, sjoelund.se → adrpo, sjoelund.se

Should this be fixed as invalid? I think we know how to handle match by now.

comment:5 by Martin Sjölund, 11 years ago

Resolution: invalid
Status: acceptedclosed
Note: See TracTickets for help on using tickets.