-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Milestone
Description
private bool? GetDefaultState(ref LocalState state, int slot)
{
...
switch (symbol.Kind)
{
...
case SymbolKind.Field:
case SymbolKind.Property:
case SymbolKind.Event:
{
// PROTOTYPE(NullableReferenceTypes): State of containing struct should not be important.
// And if it is important, what about fields of structs that are fields of other structs, etc.?
int containingSlot = variable.ContainingSlot;
if (containingSlot > 0 &&
variableBySlot[containingSlot].Symbol.GetTypeOrReturnType().TypeKind == TypeKind.Struct &&
state[containingSlot] == null)
{
return null;
}
return !symbol.GetTypeOrReturnType().IsNullable;
}
default:
throw ExceptionUtilities.UnexpectedValue(symbol.Kind);
}
}Reactions are currently unavailable