58 references to IsUnionType
Microsoft.CodeAnalysis.CSharp (31)
Binder\Binder_Patterns.cs (5)
38
Debug.Assert(inputUnionType.
IsUnionType
);
165
Debug.Assert(inputUnionType.
IsUnionType
);
225
Debug.Assert(inputUnionType.
IsUnionType
);
377
Debug.Assert(unionType.
IsUnionType
);
1274
Debug.Assert(unionType is null || unionType.
IsUnionType
);
Binder\DecisionDagBuilder.cs (4)
479
propertyInput.Type is NamedTypeSymbol {
IsUnionType
: true } match &&
672
tryGetValueInput.Type is NamedTypeSymbol {
IsUnionType
: true } match)
731
propertyInput.Type is NamedTypeSymbol {
IsUnionType
: true } match &&
1000
input.Type is NamedTypeSymbol {
IsUnionType
: true } unionType &&
Binder\PatternExplainer.cs (1)
706
e.Input.Type is NamedTypeSymbol {
IsUnionType
: true } unionType &&
Binder\Semantics\Conversions\UserDefinedImplicitConversions.cs (1)
994
if (target.StrippedType() is not NamedTypeSymbol namedTarget || !namedTarget.
IsUnionType
)
Binder\SwitchBinder.cs (1)
271
if (!conversion.IsUnion && !(caseExpression.IsLiteralNull() && SwitchGoverningType.StrippedType() is NamedTypeSymbol {
IsUnionType
: true }))
CodeGen\EmitExpression.cs (1)
1685
if (receiver is not BoundTypeExpression { Type: TypeParameterSymbol or NamedTypeSymbol {
IsUnionType
: true } })
CodeGen\Optimizer.cs (2)
1181
if ((method.IsAbstract || method.IsVirtual) && receiver is BoundTypeExpression { Type: TypeParameterSymbol or NamedTypeSymbol {
IsUnionType
: true } } typeExpression)
2322
if (receiverOpt is BoundTypeExpression { AliasOpt: null, BoundContainingTypeOpt: null, BoundDimensionsOpt: { IsEmpty: true }, Type: TypeParameterSymbol or NamedTypeSymbol {
IsUnionType
: true } } typeExpression)
FlowAnalysis\AbstractFlowPass.cs (1)
949
InputType: NamedTypeSymbol { TypeKind: TypeKind.Struct,
IsUnionType
: true } inputType,
FlowAnalysis\NullableWalker.cs (7)
2069
_variables[containingSlot].Symbol.GetTypeOrReturnType().Type is NamedTypeSymbol {
IsUnionType
: true, UnionCaseTypes: not [] } unionType &&
4465
type is NamedTypeSymbol {
IsUnionType
: true } unionType &&
7999
receiverType is NamedTypeSymbol {
IsUnionType
: true } unionType &&
8489
receiverType is NamedTypeSymbol {
IsUnionType
: true } unionType &&
9590
Debug.Assert(targetField.TypeWithAnnotations.Type.StrippedType() is NamedTypeSymbol {
IsUnionType
: true });
10695
targetTypeWithNullability.Type.StrippedType() is NamedTypeSymbol {
IsUnionType
: true } unionType &&
12258
receiverType.Type is NamedTypeSymbol {
IsUnionType
: true } unionType &&
Symbols\NamedTypeSymbol.cs (4)
1818
if (!
IsUnionType
)
1847
Debug.Assert(
IsUnionType
);
1888
Debug.Assert(unionType.
IsUnionType
);
1908
Debug.Assert(
IsUnionType
);
Symbols\PublicModel\TypeSymbol.cs (1)
203
bool ITypeSymbol.IsUnion => UnderlyingTypeSymbol is Symbols.NamedTypeSymbol {
IsUnionType
: true };
Symbols\TypeSymbolExtensions.cs (2)
187
public bool IsSubjectForUnionMatching => patternInputType.StrippedType() is NamedTypeSymbol {
IsUnionType
: true };
191
if (patternInputType.StrippedType() is NamedTypeSymbol {
IsUnionType
: true } named)
Utilities\ValueSetFactory.UnionTypeTypeUnionValueSetFactory.cs (1)
19
Debug.Assert(unionType is NamedTypeSymbol {
IsUnionType
: true });
Microsoft.CodeAnalysis.CSharp.CSharp15.UnitTests (27)
UnionsTests.cs (27)
71
Assert.True(s1.
IsUnionType
);
73
Assert.True(comp.GetTypeByMetadataName("C1").
IsUnionType
);
74
Assert.True(comp.GetTypeByMetadataName("C2").
IsUnionType
);
75
Assert.False(comp.GetTypeByMetadataName("C4").
IsUnionType
);
78
Assert.False(i1.
IsUnionType
);
80
Assert.False(comp.GetTypeByMetadataName("S2").
IsUnionType
);
81
Assert.False(comp.GetTypeByMetadataName("C3").
IsUnionType
);
104
Assert.True(comp.GetTypeByMetadataName("S1").
IsUnionType
);
119
Assert.True(comp1.GetTypeByMetadataName("S1").
IsUnionType
);
131
Assert.True(comp2.GetTypeByMetadataName("S1").
IsUnionType
);
132
Assert.True(comp2.GetTypeByMetadataName("S2").
IsUnionType
);
202
Assert.True(type.
IsUnionType
);
251
Assert.False(type.
IsUnionType
);
298
Assert.False(c5.
IsUnionType
);
39561
Assert.True(s1.
IsUnionType
);
39714
Assert.True(s12.
IsUnionType
);
39797
Assert.True(comp.GetTypeByMetadataName("S1").
IsUnionType
);
39816
Assert.True(comp.GetTypeByMetadataName("S1").
IsUnionType
);
39835
Assert.True(comp.GetTypeByMetadataName("S1").
IsUnionType
);
39946
Assert.True(comp.GetTypeByMetadataName("S1").
IsUnionType
);
39966
Assert.True(comp.GetTypeByMetadataName("S1").
IsUnionType
);
39987
Assert.True(comp.GetTypeByMetadataName("S1").
IsUnionType
);
40002
Assert.True(comp.GetTypeByMetadataName("S1").
IsUnionType
);
40021
Assert.True(comp.GetTypeByMetadataName("S1`1").
IsUnionType
);
40035
Assert.True(comp.GetTypeByMetadataName("S1").
IsUnionType
);
40124
Assert.True(comp.GetTypeByMetadataName("S1").
IsUnionType
);
40223
Assert.True(comp.GetTypeByMetadataName("S1").
IsUnionType
);