-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Description
This issue relates to the implementation of the LDM resolution for dotnet/csharplang#2450 as discussed in the 2019-04-22 LDM and documented at https://github.com/dotnet/csharplang/blob/master/meetings/2019/LDM-2019-04-22.md#implied-constraint-for-a-type-parameter-of-a-partial
For a partial type, the constraints (implied or explicit) for the various parts of a partial must agree. This is an existing rule. We extend this rule for nullability to say that they must agree in nullability annotations as well (or we produce an error for an annotated/unannotated disagreement). We use the invariant merging rules to merge the constraints from the various parts. The resulting merged constraints are used by the compiler in users of the type and within the body of the partial type.
For a partial method, callers of the method are analyzed against the declaration. The body of the implementation is analyzed against the implementation's declared or implied constraints. We produce a warning at the implementation if there is a mismatch of type parameter constraints of nullable annotations annotated vs unannotated (though a mismatch with oblivious is ignored).