This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reflection: Fix DefaultValue for optional DateTime (#17877)
Querying the default value of an optional `DateTime` parameter using `ParameterInfo.DefaultValue` can throw a `FormatException` if that default value is a null constant in metadata, which is how the C# compiler encodes a default value of `default(DateTime)`. This commit fixes that error by adding the proper handling for null metadata constants with `DateTime` parameters.
- Loading branch information