Add -fno-warn-type-defaults to supress unwanted warnings.#144
Add -fno-warn-type-defaults to supress unwanted warnings.#144rbasso merged 1 commit intoexercism:masterfrom rbasso:fno-warn-type-defaults
Conversation
|
Just to make it clear, the list of affected problems is probably not complete, as it would demand inspection of all exercises individually. These are the ones I identified running my last iteration of each exercise, but not all of my solutions are polymorphic as to force exhibition of the warning. Anyway, the solution for any new appearing warning of that type would be exactly the same.
|
Supress "Defaulting the following constraints to type Integer"
warning when compiling the test modules with polymorphic solutions.
Affected problems:
grains
hamming
leap
pascals-triangle
scrabble-score
sieve
sum-of-multiples
|
I noted in #143 that this is desirable (for the reasons listed in that issue and in this PR description). I would even support merging this as-is before I get a chance to investigate. I say this because I honestly think we may be in a "your guess is as good as mine" situation so if you couldn't find anything it's possible I wouldn't either. If I do find a better solution it's always possible for me to make another PR, so not really necessary to hold this one up! |
|
The thing I didn't check thoroughly would be "is there any exercise you missed", but I'm sure we can fix that up easily if that is the case. Seems to require going through the entire list of exercises, not an easy way to grep for something that would be indicative... |
In some problems, like
leap, the test module doesn't declare explicitly some numeric types, allowing solutions with multiple types:This is desirable, but has the unintended effect of displaying the warning...
... when compiling
leap_test.hswith polymorphic solutions:It's important to suppress this warning so we don't misguide newcomers in thinking that there is something wrong with their code, when the problem is in the test module. Also, using the most general type is actually encouraged in Haskell.
It's desirable to have test modules that compile silently. This would benefit users and automated tests, that could be compiled with
-Wall -Werror.Affected problems:
Proposed solution: Add
{-# OPTIONS_GHC -fno-warn-type-defaults #-}to the affected modules.Closes #143