Beluga
Beluga copied to clipboard
Dune environment variables suppressing compiler warnings
The following dune environment variables are set in the core
, harpoon
and optparser
packages.
These globally disable compilation warnings such as unused variables.
However, what I find alarming is that warnings about not exhaustive pattern-matching are also suppressed.
This explains why there are not easily reproducible pattern-matching errors thrown in Harpoon sessions.
https://github.com/Beluga-lang/Beluga/blob/3db1ffd08d4c3bde7ad2ceb924bfb95488eef2b2/src/core/dune#L7-L9
https://github.com/Beluga-lang/Beluga/blob/3db1ffd08d4c3bde7ad2ceb924bfb95488eef2b2/src/harpoon/dune#L6-L8
https://github.com/Beluga-lang/Beluga/blob/3db1ffd08d4c3bde7ad2ceb924bfb95488eef2b2/src/optparser/dune#L3-L5
Where not exhaustive pattern-matching is intended as in the following, then warnings should be explicitly suppressed with macros like [@warning "-8"]
instead of being toggled off globally.
https://github.com/Beluga-lang/Beluga/blob/3db1ffd08d4c3bde7ad2ceb924bfb95488eef2b2/src/core/error.ml#L116-L122
Fixing this issue won't be easy as it affects most files.
There's really a lot of non-exhaustive pattern matches, so it's hard to enable the warning. An affordable solution would be handling them one-by-one (though it will still take long time)