We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
See initial PR #45993
T?
where T : default
default(T)
default(T?)
var
var t = new T();
(T?)t
(T)default(T)
T
UnconstrainedTypeParameter_45
_46
class?
notnull
U
U?
where U : { T, T?, class, class?, struct, notnull }
ref
out
UnconstrainedTypeParameter_47
out T?
out T
[AllowNull]
[MaybeNull]
UnconstrainedTypeParameter_16
[DisallowNull]
[NotNull]
UnconstrainedTypeParameter_41
_42
where U : { T, T? }
default
struct
class
I
I?
UnconstrainedTypeParameter_09
_10
[MaybeNull]T
IEnumerable<T?>
GetDeclaredSymbol()
GetSymbolInfo()
IOperation
Productivity:
The text was updated successfully, but these errors were encountered:
T??
cston
No branches or pull requests
See initial PR #45993
T?
andwhere T : default
default(T)
anddefault(T?)
var
:var t = new T();
Local of unconstrained type parameter type is reported as NotAnnotated when using var #46236(T?)t
(T)default(T)
T
from outside nullable context: seeUnconstrainedTypeParameter_45
,_46
T?
outside nullable contextT?
with no constraints, withclass?
constraint, withnotnull
constraintT?
as type argumentT?
as constraintT?
substituted withU
orU?
where U : { T, T?, class, class?, struct, notnull }
T?
in varianceT?
in method type inferenceT?
in lambda return type inferenceT?
andT
in best common typeT?
inref
typesT?
inout
parameters: seeUnconstrainedTypeParameter_47
, No warning when overriding method without T?
rather thanout T
#49131T?
inref
parametersT?
in type argument constraint checksT?
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
U
orU?
toT
orT?
where U : { T, T? }
No warning reported returning nullable version of unconstrained type parameter #46150default
constraint on method overrides and explicit implementationsdefault
constraint on other methodsdefault
constraint combined with other constraintsdefault
constraint required to treatT?
as unconstraineddefault
andstruct
constraintsdefault
and other constraints {class
,class?
,notnull
,I
,I?
}T
andT?
: seeUnconstrainedTypeParameter_09
,_10
T?
consumed in C#8T?
consumed in C#8 with[AllowNull]
,[MaybeNull]
T?
and[MaybeNull]T
, etc.T?
andIEnumerable<T?>
where T : default
constraintT
andT?
GetDeclaredSymbol()
GetSymbolInfo()
on a method re-inferred withT?
IOperation
on a method re-inferred withT?
Productivity:
T?
default
keywordThe text was updated successfully, but these errors were encountered: