-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
untriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
Description
Description
Using string interpolation with DateOnly causes the runtime to crash with invalid string formats, such as below:
var dateOnly = new DateOnly(2020, 05, 03);
var dateOnlyString = $"{dateOnly:yyyy:MM:dd}"; // We never proceed beyond this line
See an example: https://dotnetfiddle.net/jLN3uv
Reproduction Steps
var dateOnly = new DateOnly(2020, 05, 03);
var dateOnlyString = $"{dateOnly:yyyy:MM:dd}"; // We never proceed beyond this line
See an example: https://dotnetfiddle.net/jLN3uv
Expected behavior
Not have the runtime crash/stick/run out of memory.
Whether this should throw an exception like it does when .ToString() is used or whether it should behave like DateTime where it works correctly is a decision I'll leave to the .NET team.
Actual behavior
Out of memory failure or stuck with high GC when debugging.
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
Metadata
Metadata
Assignees
Labels
untriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner