stryker-mutator / stryker-net

Mutation testing for .NET core and .NET framework!
https://stryker-mutator.io
Apache License 2.0
1.75k stars 176 forks source link

Unexpected Stryker Warnings Occuring with Nullable DateTime #2801

Closed jameswiseman76rlg closed 1 month ago

jameswiseman76rlg commented 7 months ago

Describe the bug

Getting a bunch of warnings on our .NET4.6 project:

[15:48:34 WRN] Stryker.NET encountered a compile error in \Defect\InvestmentControl.Api\Features\AccountInstructionHistory\AccountInstructionsHistory.cs (at 140:85) with message: 'DateTime?' does not contain a definition for 'Date' and no accessible extension method 'Date' accepting a first argument of type 'DateTime?' could be found (are you missing a using directive or an assembly reference?) (Source code: Date)

[15:48:34 WRN] Safe Mode! Stryker will try to continue by rolling back all mutations in method. This should not happen, please report this as an issue on github with the previous error message.

[15:48:34 WRN] Stryker.NET encountered a compile error in \Defect\InvestmentControl.Api\Features\AccountInstructionHistory\AccountInstructionsHistory.cs (at 144:71) with message: Argument 2: cannot convert from 'System.DateTime?' to 'System.DateTime' (Source code: effectiveDate)

[15:48:34 WRN] Safe Mode! Stryker will try to continue by rolling back all mutations in method. This should not happen, please report this as an issue on github with the previous error message.

[15:48:34 WRN] Stryker.NET encountered a compile error in \Defect\InvestmentControl.Api\Features\AccountInstructionHistory\AccountInstructionsHistory.cs (at 145:61) with message: Argument 2: cannot convert from 'System.DateTime?' to 'System.DateTime' (Source code: effectiveDate)

[15:48:34 WRN] Safe Mode! Stryker will try to continue by rolling back all mutations in method. This should not happen, please report this as an issue on github with the previous error message.

[15:48:34 WRN] Stryker.NET encountered a compile error in \Defect\InvestmentControl.Api\Features\AccountInstructionHistory\AccountInstructionsHistory.cs (at 146:94) with message: Argument 3: cannot co nvert from 'System.DateTime?' to 'System.DateTime' (Source code: effectiveDate)

[15:48:34 WRN] Safe Mode! Stryker will try to continue by rolling back all mutations in method. This should not happen, please report this as an issue on github with the previous error message.

[15:48:34 WRN] Stryker.NET encountered a compile error in \Defect\InvestmentControl.Api\Features\AccountInstructionHistory\AccountInstructionsHistory.cs (at 147:81) with message: Argument 3: cannot convert from 'System.DateTime?' to 'System.DateTime' (Source code: effectiveDate)

[15:48:34 WRN] Safe Mode! Stryker will try to continue by rolling back all mutations in method. This should not happen, please report this as an issue on github with the previous error message.

The following repo exposes this issue: jameswiseman76/StrykerNullWarning (github.com)

Desktop (please complete the following information):