question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support treat warnings as errors while compiling

See original GitHub issue

Null 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:open
  • Created 3 months ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
adamnovacommented, Jul 7, 2023

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.

2reactions
dupdobcommented, Jul 4, 2023

I think Stryker should adhere to this option (warning as errors): it would mark more mutants as CompileError, but it makes sense.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found