This is a place to collect test ideas.
Proposal: dotnet/csharplang#2145
Specification
Infrastructure
Parsing
Generics
Iterators
Null checking should always happen in initial call, not lowered methods
Constructors
Null checking should be the first thing in a constructor
Nested functions
Warnings and errors
Misc.
Misc (from discussion in LDM)
From test plan review
Productivity
This is a place to collect test ideas.
Proposal: dotnet/csharplang#2145
Specification
csharplanglinkif/throw)Infrastructure
Parsing
string s !!= nullparsed asstring s!! = nullGenerics
void M<T>(T value!) { }is OKvoid M<T>(T value!) where T : struct { }is an errorvoid M<T>(T value!) where T : unmanaged { }is an errorvoid M<T>(T value!) where T : notnull { }is OKvoid M<T>(T value!) where T : class { }is OKvoid M<T>(T value!) where T : SomeStruct { }is an errorvoid M<T>(T value!) where T : SomeClass { }is OKIterators
Null checking should always happen in initial call, not lowered methods
Constructors
Null checking should be the first thing in a constructor
thiscallbasecallNested functions
delegate (object o!!) { }x!! => x,(x, y!!) => y_!! => { }Warnings and errors
nullvaluestring? x!(null-check doesn't make sense on those)int x!parametersout string x!(null-check doesn't make sense onoutparameter)interfacemembers,abstract,extern, declaration portion of apartialmethod)Misc.
S? s!!forstructtypeSMisc (from discussion in LDM)
paramsparameter (allowed, checks the array, not the elements)void M<T>(T t!) where T : notnull { ... }(ok)__arglist!!From test plan review
asynciterator methodsreforinparameters? resolution: Allow. Allow 'ref' and 'in' parameters to be null-checked #58938Tdoes not box whenTis a nullable value type (include aThrowIfNull<T>(T value, string parameterName)helper method?) (delaying till after feature merge)Nullable<T>parameters.delegatedeclarationoverrideandinterfaceimplementation with/without!!is allowedSymbolDisplayis not affectedSyntaxNormalizer, quick info, typing, completionProductivity