-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Description
See initial PR #45993
- draft spec on dotnet/csharplang
- language version errors for
T?andwhere T : default - nullability of
default(T)anddefault(T?) - nullability of
var:var t = new T();Local of unconstrained type parameter type is reported as NotAnnotated when using var #46236 - nullability of
(T?)t - nullability of
(T)default(T) - interop with
Tfrom outside nullable context: seeUnconstrainedTypeParameter_45,_46 -
T?outside nullable context -
T?with no constraints, withclass?constraint, withnotnullconstraint -
T?as type argument -
T?as constraint -
T?substituted withUorU?where U : { T, T?, class, class?, struct, notnull } -
T?in variance -
T?in method type inference -
T?in lambda return type inference -
T?andTin best common type -
T?inreftypes -
T?inoutparameters: seeUnconstrainedTypeParameter_47, No warning when overriding method without T?rather thanout T#49131 -
T?inrefparameters -
T?in type argument constraint checks -
T?with[AllowNull],[MaybeNull]: seeUnconstrainedTypeParameter_16 -
T?with[DisallowNull],[NotNull]: seeUnconstrainedTypeParameter_41,_42 -
non-safety warnings for assignment or explicit cast ofNo warning reported for assignment or explicit cast of possibly null value of unconstrained type parameter type #46044T?toT - conversions from
UorU?toTorT?where U : { T, T? }No warning reported returning nullable version of unconstrained type parameter #46150 -
defaultconstraint on method overrides and explicit implementations -
defaultconstraint on other methods -
defaultconstraint combined with other constraints -
defaultconstraint required to treatT?as unconstrained - overrides that differ by
defaultandstructconstraints - overrides that differ by
defaultand other constraints {class,class?,notnull,I,I?} - overrides that differ by
TandT?: seeUnconstrainedTypeParameter_09,_10 -
T?consumed in C#8 -
T?consumed in C#8 with[AllowNull],[MaybeNull] - overrides and implementations with
T?and[MaybeNull]T, etc. - symbol display of
T?andIEnumerable<T?> - symbol display of method with
where T : defaultconstraint - unassigned fields of type
TandT? - annotations from
GetDeclaredSymbol() - flow state from
GetSymbolInfo()on a method re-inferred withT? - flow state from
IOperationon a method re-inferred withT?
Productivity:
- check publicAPI analyzer on
T? - recommend
defaultkeyword - UseExplicitType
Reactions are currently unavailable