Nullness issue – Invalid type constraint resolution on ILookup
#18334
Labels
Area-Nullness
Issues related to handling of Nullable Reference Types
Bug
Impact-Medium
(Internal MS Team use only) Describes an issue with moderate impact on existing code.
displays:
error FS0957: One or more of the declared type parameters for this type extension have a missing or wrong type constraint not matching the original type constraints on 'ILookup<_,_>'
error FS0340: The signature and implementation are not compatible because the declaration of the type parameter 'Key' requires a constraint of the form 'Key: not null
while the required type constraint is present
Repro steps
use the uploaded class library project
WrongNonNullConditionRepro.zip
Expected behavior
No error
Actual behavior
error FS0957: One or more of the declared type parameters for this type extension have a missing or wrong type constraint not matching the original type constraints on 'ILookup<_,_>'
error FS0340: The signature and implementation are not compatible because the declaration of the type parameter 'Key' requires a constraint of the form 'Key: not null
Known workarounds
No
Related information
Provide any related information (optional):
The text was updated successfully, but these errors were encountered: