11 references to SwitchGoverningType
Microsoft.CodeAnalysis.CSharp (11)
Binder\SwitchBinder.cs (7)
228matchLabel.Pattern, ref unionType, SwitchGoverningType, permitDesignations: true, labelSyntax.HasErrors, tempDiagnosticBag, hasUnionMatching: out _); 258Conversion conversion = Conversions.ClassifyConversionFromExpression(caseExpression, SwitchGoverningType, isChecked: CheckOverflowAtRuntime, ref useSiteInfo); 262GenerateImplicitConversionError(diagnostics, node, conversion, caseExpression, SwitchGoverningType); 267diagnostics.Add(ErrorCode.WRN_GotoCaseShouldConvert, node.Location, SwitchGoverningType); 271if (!conversion.IsUnion && !(caseExpression.IsLiteralNull() && SwitchGoverningType.StrippedType() is NamedTypeSymbol { IsUnionType: true })) 273caseExpression = CreateConversion(caseExpression, conversion, SwitchGoverningType, diagnostics); 277var inputType = SwitchGoverningType;
Binder\SwitchBinder_Patterns.cs (4)
252caseLabelSyntax.Value, caseLabelSyntax.Value, ref unionType, SwitchGoverningType, hasErrors, diagnostics, out bool hasUnionMatching); 261var pattern = new BoundDiscardPattern(node, inputType: SwitchGoverningType, narrowedType: SwitchGoverningType); 285matchLabelSyntax.Pattern, ref unionType, SwitchGoverningType, permitDesignations: true, node.HasErrors, diagnostics, out bool hasUnionMatching);