Open dogac00 opened 3 years ago
Hi @dogac00, this is not really a bug, more like a limitation of what can be achieved with the overall architecture of Stryker, let me explain:
Full support for build time mutations, such as mutating const
values, requires building multiple versions of the assembly, which would result in a far slower process overall. There is no such evolution planned yet.
Alternatively, const
values could be made mutable, by 'demoting' them to plain static
fields, but this would often result in build errors, due to the fact that some constructions require const
values, such as default value for a parameter or usage in some attribute.
Describe the bug I don't know if this behavior is a bug or not. String mutation applies when a string literal is used within a method. But it doesn't apply when a constant is used instead of string literal. Knowing
const
fields being a compile-time constant and replaced with the string literal in the compilation, we should apply string mutation to constant fields in the methods too.Here's an example:
When query is written inline, string mutation works, but when it is retrieved from a field, string mutation does not apply.
Desktop (please complete the following information):
dotnet tool install --global dotnet-stryker