49 references to IsUnionType
Microsoft.CodeAnalysis.CSharp (22)
Binder\Binder_Patterns.cs (4)
49Debug.Assert(inputUnionType.IsUnionType); 106Debug.Assert(inputUnionType.IsUnionType); 156Debug.Assert(inputUnionType.IsUnionType); 1033Debug.Assert(unionType is null || unionType.IsUnionType);
Binder\DecisionDagBuilder.cs (4)
479propertyInput.Type is NamedTypeSymbol { IsUnionType: true } match && 678tryGetValueInput.Type is NamedTypeSymbol { IsUnionType: true } match) 737propertyInput.Type is NamedTypeSymbol { IsUnionType: true } match && 997input.Type is NamedTypeSymbol { IsUnionType: true } unionType &&
Binder\PatternExplainer.cs (1)
700e.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 }))
FlowAnalysis\AbstractFlowPass.cs (1)
949InputType: NamedTypeSymbol { TypeKind: TypeKind.Struct, IsUnionType: true } inputType,
FlowAnalysis\NullableWalker.cs (6)
4427type is NamedTypeSymbol { IsUnionType: true } unionType && 7956ContainingType: { IsUnionType: true } unionType 8451ContainingType: { IsUnionType: true } unionType 9553Debug.Assert(targetField.TypeWithAnnotations.Type.StrippedType() is NamedTypeSymbol { IsUnionType: true }); 10645targetTypeWithNullability.Type.StrippedType() is NamedTypeSymbol { IsUnionType: true } unionType && 12203receiverType.Type is NamedTypeSymbol { IsUnionType: true } unionType &&
Symbols\NamedTypeSymbol.cs (1)
1816if (!IsUnionType)
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)
20Debug.Assert(unionType is NamedTypeSymbol { IsUnionType: true });
Microsoft.CodeAnalysis.CSharp.CSharp15.UnitTests (27)
UnionsTests.cs (27)
70Assert.True(comp.GetTypeByMetadataName("S1").IsUnionType); 71Assert.True(comp.GetTypeByMetadataName("C1").IsUnionType); 72Assert.True(comp.GetTypeByMetadataName("C2").IsUnionType); 73Assert.False(comp.GetTypeByMetadataName("C4").IsUnionType); 75Assert.False(comp.GetTypeByMetadataName("I1").IsUnionType); 76Assert.False(comp.GetTypeByMetadataName("S2").IsUnionType); 77Assert.False(comp.GetTypeByMetadataName("C3").IsUnionType); 100Assert.True(comp.GetTypeByMetadataName("S1").IsUnionType); 115Assert.True(comp1.GetTypeByMetadataName("S1").IsUnionType); 127Assert.True(comp2.GetTypeByMetadataName("S1").IsUnionType); 128Assert.True(comp2.GetTypeByMetadataName("S2").IsUnionType); 186Assert.True(type.IsUnionType); 230Assert.False(type.IsUnionType); 277Assert.False(c5.IsUnionType); 23661Assert.True(s1.IsUnionType); 23814Assert.True(s12.IsUnionType); 23897Assert.True(comp.GetTypeByMetadataName("S1").IsUnionType); 23916Assert.True(comp.GetTypeByMetadataName("S1").IsUnionType); 23935Assert.True(comp.GetTypeByMetadataName("S1").IsUnionType); 24046Assert.True(comp.GetTypeByMetadataName("S1").IsUnionType); 24066Assert.True(comp.GetTypeByMetadataName("S1").IsUnionType); 24087Assert.True(comp.GetTypeByMetadataName("S1").IsUnionType); 24102Assert.True(comp.GetTypeByMetadataName("S1").IsUnionType); 24121Assert.True(comp.GetTypeByMetadataName("S1`1").IsUnionType); 24135Assert.True(comp.GetTypeByMetadataName("S1").IsUnionType); 24224Assert.True(comp.GetTypeByMetadataName("S1").IsUnionType); 24323Assert.True(comp.GetTypeByMetadataName("S1").IsUnionType);