-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Milestone
Description
Version Used: d5931e0
Steps to Reproduce:
#nullable enable
public abstract class C
{
public abstract void M1(string s = null);
}
public delegate void Del1(string s = null);Expected Behavior: Warnings on the parameter default values for M1 and Del1.
Actual Behavior: No warnings.
Basically, it seems that when the method has no body, we entirely fail to analyze its parameter default values. It suggests that the approach to synthesize the parameter default values and pretend to assign them in NullableWalker is not quite right. When a parameter default value is included in syntax, it may be associated directly with a varying number of method bodies:
- 0 for delegates and abstract methods
- 1 for ordinary methods
- 2 for indexers with get and set accessors
edit: Expected behavior of this scenario has changed based on the proposal nullable-parameter-default-value-analysis.md
Reactions are currently unavailable