You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the upgrade to 1.2.20, the library has enabled nullable reference types (in #620 I believe), but IDynamicLinqCustomTypeProvider wasn't updated to specify that ResolveType and ResolveTypeBySimpleName may return null (as stated in the documentation for the methods). This leads to compile error CS8766 if my implementation of the interface specifies a nullable return type (so that we can return null), or CS8603 if our code doesn't specify nullable return type but returns null anyway. The workaround is to return null!, which defeats the purpose of enabling nullability checks. Our code is currently returning null from GetExtensionMethods as well, so that may need a nullable reference return type.
Additionally, the DynamicExpressionParser.ParseLambda method specifies params object[] values, but my code was previously passing an object?[] to be able to substitute in null values. This results in error CS8620.
I'm not sure if there are more APIs that are missing nullable reference annotations, but these were the ones our code has seen when trying to upgrade. Also, these are technically compiler warnings, though we treat them as errors.
1. Description
With the upgrade to 1.2.20, the library has enabled nullable reference types (in #620 I believe), but
IDynamicLinqCustomTypeProvider
wasn't updated to specify thatResolveType
andResolveTypeBySimpleName
may return null (as stated in the documentation for the methods). This leads to compile error CS8766 if my implementation of the interface specifies a nullable return type (so that we can return null), or CS8603 if our code doesn't specify nullable return type but returns null anyway. The workaround is to returnnull!
, which defeats the purpose of enabling nullability checks. Our code is currently returning null fromGetExtensionMethods
as well, so that may need a nullable reference return type.Additionally, the
DynamicExpressionParser.ParseLambda
method specifiesparams object[] values
, but my code was previously passing anobject?[]
to be able to substitute in null values. This results in error CS8620.I'm not sure if there are more APIs that are missing nullable reference annotations, but these were the ones our code has seen when trying to upgrade. Also, these are technically compiler warnings, though we treat them as errors.
2. Exception
N/A
3. Fiddle or Project
https://dotnetfiddle.net/ULrkpy
4. Any further technical details
Add any relevant detail that can help us.
The text was updated successfully, but these errors were encountered: