Support treat warnings as errors while compiling
See original GitHub issueNull coalescing mutation is not killed when nullability is enforced.
public class Model
{
public static Model Create(string? nullable)
{
return new Model()
{
NotNullable = nullable ?? string.Empty // The actual code
NotNullable = nullable // the survived mutation which does not actually compile if left like this in the code
};
}
public string NotNullable { get; init; } = string.Empty;
}
edit:// Updated text, because I made some mistake during initial testing which made me think that it was caused by warnings as errors, after further retesting I found out this was not the case.
Issue Analytics
- State:
- Created 3 months ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
How can I compile without warnings being treated as errors?
You can make all warnings being treated as such using -Wno-error. You can make specific warnings being treated as such by using ...
Read more >C# Compiler Options to report errors and warnings
C# Compiler Options for errors and warnings. These options suppress or enable warnings, and control warnings as errors.
Read more >Treat Warnings As Errors. I Mean It. You Need to Do This
In today's post, we cover why you should treat warnings as errors so that your compiler will become a powerful ally in the...
Read more >support treating warnings as errors (-Werror) · Issue #3980
Compiler warnings from protoc can get lost, especially when part of a large build system, and there's no flag—at least, not one that...
Read more >How to suppress all warnings being treated as errors for ...
2 Answers 2 ... The default Makefile rules, and most well-written Makefiles, should see CFLAGS for option arguments to the C compiler being...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I see, sorry for the confusion. I considered them separately because one is done through
.editorconfig
and the other one is project configuration. So it was possible these were 2 separate cases and one could be more general than the other, or maybe they don’t overlap at all. I am not sure exactly how this is handled internally.And yes, without any configuration changes the project will compile just fine in which case, mutant is absolutely valid.
I think Stryker should adhere to this option (warning as errors): it would mark more mutants as CompileError, but it makes sense.