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