You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From discussion with Neal, we think the suppression expression should have matching Type and ConvertedType, which would be the converted type of the underlying expression.
In (Delegate)(() = {}!) and Delegate x = () => {}!;, the suppressed expressions would have type and converted type Delegate.
Other interesting scenarios involving conversions from expressions: null, default, lambdas, method groups, interpolated strings.
Look for uses of BoundNode.Kind and BoundKind.MethodGroup (for instance, GetTypeInfoForNode)
The text was updated successfully, but these errors were encountered:
After further discussions with @AlekseyTs, @jcouv, and @gafter, we've decided that the existing Type and ConvertedType fields are correct for suppressed expressions. These examples as written are correct:
Actiona=()=>{}!;// Type of null, ConvertedType of Action when called on both the inner lambda syntax and when called on the ! syntaxstring?s=null;objecto=s!;// Type of string, ConvertedType of object when called on both the inner local reference and when called on the ! syntax.
Currently, the Nullability and ConvertedNullability on these syntax nodes are the same. As a future feature, we would like to have the underlying syntax have the original null state before suppression, but we think that such a feature will be ok to add in the future. This work is tracked by #35412.
From discussion with Neal, we think the suppression expression should have matching
Type
andConvertedType
, which would be the converted type of the underlying expression.In
(Delegate)(() = {}!)
andDelegate x = () => {}!;
, the suppressed expressions would have type and converted typeDelegate
.Other interesting scenarios involving conversions from expressions:
null
,default
, lambdas, method groups, interpolated strings.Look for uses of
BoundNode.Kind
andBoundKind.MethodGroup
(for instance,GetTypeInfoForNode
)The text was updated successfully, but these errors were encountered: