-
Notifications
You must be signed in to change notification settings - Fork 119
feat: 'inconsistent types' warnings as errors by default #5718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: 'inconsistent types' warnings as errors by default #5718
Conversation
| "M0237", None, "Suggest redundant explicit arguments"; | ||
| "M0239", None, "Avoid binding a unit `()` result"; | ||
| "M0005", None, "Case mismatch between import and filename", Warn; | ||
| "M0061", None, "Comparing abstract type to itself at supertype", Error; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is the list of warnings that I'd treat as errors by default
"M0061", "Comparing abstract type to itself at supertype";
"M0062", "Comparing incompatible type at common supertype";
"M0074", "Array elements have inconsistent types";
"M0081", "If branches have inconsistent types";
"M0101", "Switch with inconsistent branch types";
"M0166", "Type intersection results in abstract type";
"M0167", "Type union results in bottom type";
"M0190", "Types inconsistent for alternative pattern variables, losing information";|
I dunno, seems a bit odd to rule out something that doesn't actually go wrong. Doesn't caffeine compile with warnings as errors anyway? |
Not every warning, no. They would need to switch all these flags.
|
What?
Makes 'inconsistent type' warnings as errors by default (minor breaking change, fixable by
-Wmoc flag):Why?
Caffeine needs to treat these as errors. However, it makes sense now (since we have a way to modify the lint level) to actually treat them as errors by default. IMO all of the above messages are type errors that signal a bug in the code
To avoid breaking change without modifying the code pass the following flag to
moc-W M0061,M0062,M0074,M0081,M0101,M0166,M0167,M0190