haskell / happy

The Happy parser generator for Haskell
Other
291 stars 84 forks source link

Get rid of an incomplete pattern match #247

Closed josephcsible closed 4 months ago

sgraf812 commented 4 months ago

Fixed the incomplete match warnings in #281.

josephcsible commented 4 months ago

I'd argue that #281 didn't fix anything, but merely hid the warnings.

andreasabel commented 4 months ago

Well, the problem with these warnings is that you cannot switch them on a case-by-case basis. The workflow would be:

  1. The partiality warning is raised.
  2. The case is investigated.
  3. a. If the partiality can definitively not occur at runtime, the warning is switched off for this case. b. If the situation is unclear, the case should be fixed to catch a possible partiality.

For this issue, we are in case 3a, but unfortunately GHC only allows us to switch off the warning globally.