25 overrides of TypeKind
Microsoft.CodeAnalysis.CSharp (25)
Lowering\AsyncRewriter\AsyncStateMachine.cs (1)
64public override TypeKind TypeKind
Lowering\ClosureConversion\SynthesizedClosureEnvironment.cs (1)
39public override TypeKind TypeKind { get; }
Lowering\IteratorRewriter\IteratorStateMachine.cs (1)
46public override TypeKind TypeKind
Lowering\LocalRewriter\DelegateCacheContainer.cs (1)
50public override TypeKind TypeKind => TypeKind.Class;
Lowering\LocalRewriter\DynamicSiteContainer.cs (1)
40public override TypeKind TypeKind
Symbols\AnonymousTypes\PublicSymbols\AnonymousManager.TypeOrDelegatePublicSymbol.cs (1)
179public abstract override TypeKind TypeKind { get; }
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.DelegateTemplateSymbol.cs (1)
227public override TypeKind TypeKind => TypeKind.Delegate;
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TemplateSymbol.cs (1)
101public override TypeKind TypeKind
Symbols\ArrayTypeSymbol.cs (1)
295public override TypeKind TypeKind
Symbols\DynamicTypeSymbol.cs (1)
63public override TypeKind TypeKind
Symbols\ErrorTypeSymbol.cs (1)
236public sealed override TypeKind TypeKind
Symbols\FunctionPointers\FunctionPointerTypeSymbol.cs (1)
76public override TypeKind TypeKind => TypeKind.FunctionPointer;
Symbols\FunctionTypeSymbol.cs (1)
102public override TypeKind TypeKind => TypeKindInternal.FunctionType;
Symbols\Metadata\PE\PENamedTypeSymbol.cs (1)
2232public override TypeKind TypeKind
Symbols\PointerTypeSymbol.cs (1)
166public override TypeKind TypeKind
Symbols\Source\SourceFixedFieldSymbol.cs (1)
169public override TypeKind TypeKind
Symbols\Source\SourceMemberContainerSymbol.cs (1)
829public override TypeKind TypeKind
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListEnumeratorTypeSymbol.cs (1)
147public override TypeKind TypeKind => TypeKind.Class;
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListTypeSymbol.cs (1)
860public override TypeKind TypeKind => TypeKind.Class;
Symbols\Synthesized\SynthesizedEmbeddedAttributeSymbol.cs (1)
79public override TypeKind TypeKind => TypeKind.Class;
Symbols\Synthesized\SynthesizedHotReloadExceptionSymbol.cs (1)
106public override TypeKind TypeKind => TypeKind.Class;
Symbols\Synthesized\SynthesizedInlineArrayTypeSymbol.cs (1)
64public override TypeKind TypeKind => TypeKind.Struct;
Symbols\Synthesized\SynthesizedPrivateImplementationDetailsType.cs (1)
57public override TypeKind TypeKind => TypeKind.Class;
Symbols\TypeParameterSymbol.cs (1)
196public sealed override TypeKind TypeKind
Symbols\Wrapped\WrappedNamedTypeSymbol.cs (1)
113public override TypeKind TypeKind
310 references to TypeKind
Microsoft.CodeAnalysis.CSharp (310)
Binder\Binder_Attributes.cs (2)
58if (boundTypeSymbol.TypeKind != TypeKind.Error) 736parameter.Type.TypeKind == TypeKind.Array &&
Binder\Binder_Constraints.cs (2)
583switch (type.TypeKind) 628throw ExceptionUtilities.UnexpectedValue(type.TypeKind);
Binder\Binder_Conversions.cs (9)
856switch (type.TypeKind) 3526Debug.Assert(delegateType is NamedTypeSymbol { TypeKind: TypeKind.Delegate, DelegateInvokeMethod: { HasUseSiteError: false } } 3527|| delegateType.TypeKind == TypeKind.FunctionPointer, 3573delegateType.TypeKind, 3583Error(diagnostics, getMethodMismatchErrorCode(delegateType.TypeKind), errorLocation, method, delegateType); 3591Error(diagnostics, getRefMismatchErrorCode(delegateType.TypeKind), errorLocation, method, delegateType); 3602delegateType.TypeKind, 3717Debug.Assert(Conversions.IsAssignableFromMulticastDelegate(delegateOrFuncPtrType, ref discardedUseSiteInfo) || delegateOrFuncPtrType.TypeKind == TypeKind.Delegate || delegateOrFuncPtrType.TypeKind == TypeKind.FunctionPointer);
Binder\Binder_Crefs.cs (3)
753switch (type.TypeKind) 800throw ExceptionUtilities.UnexpectedValue(type.TypeKind); 1195Debug.Assert(type.TypeKind != TypeKind.Error || typeSyntax.ContainsDiagnostics || !typeSyntax.SyntaxTree.ReportDocumentationCommentDiagnostics(), "Why wasn't there a diagnostic?");
Binder\Binder_Expressions.cs (18)
2444if (this.ContainingType.TypeKind == TypeKind.Submission 2448if (memberDeclaringType.TypeKind == TypeKind.Submission) 2899if (targetType.TypeKind != TypeKind.Delegate || 2950var errorCode = targetType.TypeKind switch 4919if ((containingType.TypeKind == TypeKind.Enum || containingType.TypeKind == TypeKind.Struct) && initializerArgumentListOpt == null) 4970else if (initializerArgumentListOpt != null && containingType.TypeKind == TypeKind.Struct) 5294switch (type.TypeKind) 5328throw ExceptionUtilities.UnexpectedValue(type.TypeKind); 5462if (arg.Type is { TypeKind: TypeKind.Dynamic }) 5623else if (argument.Type.TypeKind == TypeKind.Delegate) 5723Debug.Assert(type.TypeKind is TypeKind.Class or TypeKind.Struct); 7116Debug.Assert(coClassType.TypeKind == TypeKind.Class || coClassType.TypeKind == TypeKind.Error); 7497if (type.TypeKind == TypeKind.Enum) 8114if (leftType.TypeKind == TypeKind.TypeParameter) 9337if (receiverOpt is not BoundTypeExpression { Type: { TypeKind: TypeKind.TypeParameter } }) 9933switch (exprType.TypeKind)
Binder\Binder_InterpolatedString.cs (2)
397if (value.Type?.TypeKind == TypeKind.Dynamic) 433&& unconvertedInterpolatedString.Parts.All(p => p is not BoundStringInsert { Value.Type.TypeKind: TypeKind.Dynamic });
Binder\Binder_Lookup.cs (4)
226switch (type.TypeKind) 258throw ExceptionUtilities.UnexpectedValue(type.TypeKind); 852Debug.Assert(!type.IsInterfaceType() && type.TypeKind != TypeKind.TypeParameter); 1915switch (type.TypeKind)
Binder\Binder_Operators.cs (10)
1041leftType?.TypeKind == TypeKind.FunctionPointer && rightType?.TypeKind == TypeKind.FunctionPointer) 1309(object?)left.Type != null && left.Type.TypeKind == TypeKind.Delegate) 4839return targetType.TypeKind == TypeKind.Error; 4948var targetTypeKind = targetType.TypeKind; 5001if (inputType.TypeKind == TypeKind.Dynamic) 5375var targetTypeKind = targetType.TypeKind; 5479var operandTypeKind = operandType.TypeKind; 5493operandTypeKind = operandType.TypeKind; 5500targetTypeKind = targetType.TypeKind;
Binder\Binder_Patterns.cs (1)
1865if (iTupleType.TypeKind != TypeKind.Interface)
Binder\Binder_Query.cs (1)
968if (ultimateReceiver.Type.TypeKind == TypeKind.TypeParameter)
Binder\Binder_QueryErrors.cs (1)
82if (instanceType.TypeKind == TypeKind.Array || name == "Cast" && HasCastToQueryProvider(instanceType, ref useSiteInfo))
Binder\Binder_Statements.cs (3)
2355if (targetType.TypeKind == TypeKind.Error) 2415if (targetType.TypeKind == TypeKind.TypeParameter) 2512switch (targetType.TypeKind)
Binder\ForEachLoopBinder.cs (3)
1648switch (enumeratorType.TypeKind) 1659throw ExceptionUtilities.UnexpectedValue(enumeratorType.TypeKind); 1844if (type.TypeKind == TypeKind.TypeParameter)
Binder\PatternExplainer.cs (1)
788if (type is NamedTypeSymbol { TypeKind: TypeKind.Enum } e)
Binder\Semantics\AccessCheck.cs (3)
368if (containingType.TypeKind == TypeKind.Submission) 430if (originalContainingType.TypeKind == TypeKind.Submission) 700: containingType.TypeKind == TypeKind.Struct ? ErrorCode.ERR_ProtectedInStruct
Binder\Semantics\Conversions\Conversions.cs (1)
537if (spanType.TypeKind == TypeKind.Struct && spanType.IsRefLikeType)
Binder\Semantics\Conversions\ConversionsBase.cs (3)
2195if (otherType.TypeKind == TypeKind.Enum) 2670switch (source.TypeKind) 3330if ((source.TypeKind == TypeKind.TypeParameter) &&
Binder\Semantics\Conversions\UserDefinedExplicitConversions.cs (1)
266if (op.ReturnsVoid || op.ParameterCount != 1 || op.ReturnType.TypeKind == TypeKind.Error)
Binder\Semantics\Operators\OperatorFacts.cs (1)
19switch (type.TypeKind)
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (7)
2263if (target.TypeKind != TypeKind.Class) 2282if (source.TypeKind == TypeKind.Class) 2286else if (source.TypeKind == TypeKind.TypeParameter) 2322switch (source.TypeKind) 2660if (source.TypeKind != TypeKind.Class || target.TypeKind != TypeKind.Class) 2699switch (target.TypeKind)
Binder\Semantics\OverloadResolution\OverloadResolution.cs (3)
2505if (m1.Member.ContainingType.TypeKind == TypeKind.Submission && m2.Member.ContainingType.TypeKind == TypeKind.Submission) 2825if (t1.TypeKind == TypeKind.Pointer)
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (2)
1261else if (argument.Kind == BoundKind.MethodGroup && parameterType.TypeKind == TypeKind.Delegate && 1266else if (argument.Kind == BoundKind.MethodGroup && parameterType.TypeKind == TypeKind.FunctionPointer)
BoundTree\BoundDagTest.cs (1)
113var typeName = b.Type.TypeKind == TypeKind.Error ? "<error type>" : b.Type.ToString();
CodeGen\EmitAddress.cs (3)
420Debug.Assert(arrayAccess.Type.TypeKind == TypeKind.TypeParameter, "constrained call should only be used with type parameter types"); 530Debug.Assert(receiverType.TypeKind == TypeKind.TypeParameter || receiverType.IsValueType); 537return receiverType.TypeKind == TypeKind.TypeParameter && addressKind != AddressKind.Constrained;
CodeGen\EmitConversion.cs (1)
362if (receiver is not BoundTypeExpression { Type: { TypeKind: TypeKind.TypeParameter } })
CodeGen\EmitExpression.cs (7)
443(receiverType.IsReferenceType && receiverType.TypeKind == TypeKind.TypeParameter) || 820Debug.Assert(thisType.TypeKind != TypeKind.TypeParameter); 1097if (elementType.TypeKind == TypeKind.TypeParameter) 2691if (left.Kind == BoundKind.ArrayAccess && left.Type.TypeKind == TypeKind.TypeParameter && !left.Type.IsValueType) 3528if (type is { TypeKind: TypeKind.TypeParameter } && constantValue.IsNull) 4150Debug.Assert(load.Type is { TypeKind: TypeKind.FunctionPointer }); 4156if (load.ConstrainedToTypeOpt is not { TypeKind: TypeKind.TypeParameter })
CodeGen\EmitStackAllocInitializer.cs (1)
27var elementType = (type.TypeKind == TypeKind.Pointer
CodeGen\EmitStatement.cs (1)
180if (exprType?.TypeKind == TypeKind.TypeParameter)
Compilation\CSharpCompilation.cs (8)
2032if (mainType is null || mainType.IsGenericType || (mainType.TypeKind != TypeKind.Class && mainType.TypeKind != TypeKind.Struct && !mainType.IsInterface)) 4467if (csharpReturnType.TypeKind is TypeKind.Dynamic || 4468csharpLeftType.TypeKind is TypeKind.Dynamic || 4469csharpRightType.TypeKind is TypeKind.Dynamic) 4511if (csharpLeftType.TypeKind is TypeKind.Delegate && 4693if (csharpReturnType.TypeKind is TypeKind.Dynamic || 4694csharpOperandType.TypeKind is TypeKind.Dynamic)
Compilation\CSharpSemanticModel.cs (3)
550if (varTypeInfo.Type is { TypeKind: not TypeKind.Error }) 992if (varTypeInfo.Type is { TypeKind: not TypeKind.Error }) 2253else if (boundExpr is BoundConversion { ConversionKind: ConversionKind.MethodGroup, Conversion: var exprConversion, Type: { TypeKind: TypeKind.FunctionPointer }, SymbolOpt: var symbol })
Compiler\ClsComplianceChecker.cs (8)
254if (symbol.TypeKind == TypeKind.Delegate) 474if (type.TypeKind == TypeKind.Delegate) 738System.Diagnostics.Debug.Assert(method.ContainingType.TypeKind == TypeKind.Delegate); 983switch (type.TypeKind) 1008throw ExceptionUtilities.UnexpectedValue(type.TypeKind); 1032if (type.TypeKind == TypeKind.Error) 1372TypeKind typeKind = xType.TypeKind; 1373if (yType.TypeKind != typeKind)
Compiler\MethodCompiler.cs (1)
643containingType is { IsImplicitlyDeclared: false, TypeKind: TypeKind.Class or TypeKind.Struct or TypeKind.Interface } &&
Emitter\Model\MethodSymbolAdapter.cs (1)
635return this.IsExtern || (object)ContainingType != null && ContainingType.TypeKind == TypeKind.Delegate;
Emitter\Model\NamedTypeSymbolAdapter.cs (2)
45get { return AdaptedNamedTypeSymbol.TypeKind == TypeKind.Enum; } 521switch (AdaptedNamedTypeSymbol.TypeKind)
Emitter\NoPia\EmbeddedType.cs (1)
156switch (UnderlyingNamedType.AdaptedNamedTypeSymbol.TypeKind)
Emitter\NoPia\EmbeddedTypesManager.cs (8)
319switch (namedType.TypeKind) 453Debug.Assert(namedType.TypeKind == TypeKind.Struct || namedType.TypeKind == TypeKind.Enum || namedType.TypeKind == TypeKind.Delegate); 456if (namedType.TypeKind == TypeKind.Struct || namedType.TypeKind == TypeKind.Enum) 506var containerKind = field.AdaptedFieldSymbol.ContainingType.TypeKind; 543switch (type.UnderlyingNamedType.AdaptedNamedTypeSymbol.TypeKind)
FlowAnalysis\AbstractFlowPass.cs (1)
2244fieldSymbol.ContainingType.TypeKind == TypeKind.Struct &&
FlowAnalysis\DefiniteAssignment.cs (5)
103&& CurrentSymbol is MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }; 1084(_trackClassFields || type.TypeKind == TypeKind.Struct); 1211Debug.Assert(CurrentSymbol is MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }); 1264if (CurrentSymbol is not MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }) 2591switch (type.TypeKind)
FlowAnalysis\EmptyStructTypeCache.cs (1)
233switch (type.TypeKind)
FlowAnalysis\NullableWalker.cs (7)
2515return valueType.Type?.TypeKind == TypeKind.TypeParameter && 4969if (type.TypeKind != TypeKind.Struct) 5122_ => throw ExceptionUtilities.UnexpectedValue(type.TypeKind) 5199_ => throw ExceptionUtilities.UnexpectedValue(type.TypeKind) 6121{ TypeKind: TypeKind.Interface } => type.AllInterfacesNoUseSiteDiagnostics, 9889NamedTypeSymbol { TypeKind: TypeKind.Delegate, DelegateInvokeMethod: { Parameters: { } parameters } signature } => (signature, parameters), 10875case BoundExpression arg when arg.Type is { TypeKind: TypeKind.Delegate }:
Lowering\AsyncRewriter\AsyncMethodToStateMachineRewriter.cs (2)
582LocalSymbol thisTemp = (F.CurrentType.TypeKind == TypeKind.Class) ? F.SynthesizedLocal(F.CurrentType) : null; 643LocalSymbol thisTemp = (F.CurrentType.TypeKind == TypeKind.Class) ? F.SynthesizedLocal(F.CurrentType) : null;
Lowering\AsyncRewriter\AsyncRewriter.cs (3)
172if (F.CurrentType.TypeKind == TypeKind.Class) 195if (stateMachineType.TypeKind == TypeKind.Class) 204if (frameType.TypeKind == TypeKind.Class)
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (2)
610if (e.StrippedType().TypeKind == TypeKind.Enum) 819if ((object)d != null && d.TypeKind == TypeKind.Delegate)
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (1)
241_ when variableType.TypeKind is TypeKind.Struct
Lowering\LocalRewriter\LocalRewriter.cs (1)
852Debug.Assert(node.Expression.Type is { TypeKind: TypeKind.Array });
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (4)
2279Debug.Assert(loweredLeft.Type is { TypeKind: TypeKind.Pointer }); 2284Debug.Assert(loweredRight.Type is { TypeKind: TypeKind.Pointer }); 2471Debug.Assert(loweredLeft.Type is { TypeKind: TypeKind.Pointer }); 2472Debug.Assert(loweredRight.Type is { TypeKind: TypeKind.Pointer });
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (1)
556case ConversionKind.MethodGroup when oldNodeOpt is { Type: { TypeKind: TypeKind.FunctionPointer } funcPtrType }:
Lowering\LocalRewriter\LocalRewriter_FixedStatement.cs (2)
213else if (fixedCollectionInitializer.Expression.Type is { TypeKind: TypeKind.Array }) 241Debug.Assert(initializerExpr.Type is { TypeKind: TypeKind.Pointer });
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (4)
876Debug.Assert(collectionExpression.Type is { TypeKind: TypeKind.Array }); 904Debug.Assert(collectionExpression.Type is { TypeKind: TypeKind.Array }); 1025Debug.Assert(collectionExpression.Type is { TypeKind: TypeKind.Array }); 1053Debug.Assert(collectionExpression.Type is { TypeKind: TypeKind.Array });
Lowering\LocalRewriter\LocalRewriter_PropertyAccess.cs (1)
37if (rewrittenReceiverOpt is { Type: { TypeKind: TypeKind.Array } } && !isLeftOfAssignment)
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (1)
931Debug.Assert(binaryOperand.Type is { TypeKind: TypeKind.Pointer });
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (1)
71if (!method.IsStatic && method.ContainingType.TypeKind == TypeKind.Struct && !isRuntimeAsync)
Lowering\SyntheticBoundNodeFactory.cs (3)
1199Debug.Assert(array.Type is { TypeKind: TypeKind.Array }); 1205Debug.Assert(array.Type is { TypeKind: TypeKind.Array }); 1218Debug.Assert(array.Type is { TypeKind: TypeKind.Array });
Symbols\ArrayTypeSymbol.cs (1)
377while (current.TypeKind == TypeKind.Array)
Symbols\AssemblySymbol.cs (4)
521=> GetSpecialType(InternalSpecialType.System_Runtime_CompilerServices_AsyncHelpers) is { TypeKind: TypeKind.Class, IsStatic: true }; 528return GetSpecialType(SpecialType.System_Runtime_CompilerServices_RuntimeFeature) is { TypeKind: TypeKind.Class, IsStatic: true } && 551GetSpecialType(SpecialType.System_Runtime_CompilerServices_PreserveBaseOverridesAttribute) is { TypeKind: TypeKind.Class }; 1061if (result is null || result.TypeKind == TypeKind.Error)
Symbols\BaseTypeAnalysis.cs (1)
118if (fieldType is null || fieldType.TypeKind != TypeKind.Struct || field.IsStatic)
Symbols\Compilation_WellKnownMembers.cs (2)
227if (type.Kind != SymbolKind.NamedType || type.TypeKind != TypeKind.Class) 982switch (type.TypeKind)
Symbols\ConstantValueUtils.cs (1)
89if (typeSymbol.TypeKind == TypeKind.TypeParameter)
Symbols\ConstraintsHelper.cs (5)
242if (underlyingType.TypeKind == TypeKind.TypeParameter) 1481switch (typeArgument.TypeKind) 1506throw ExceptionUtilities.UnexpectedValue(typeArgument.TypeKind); 1515Debug.Assert(type.TypeKind is TypeKind.Class or TypeKind.Struct); 1563switch (type.TypeKind)
Symbols\DynamicTypeSymbol.cs (1)
203if (ReferenceEquals(this, t2) || t2.TypeKind == TypeKind.Dynamic)
Symbols\ExtendedErrorTypeSymbol.cs (6)
224if ((object?)oldSymbol == null || oldSymbol.TypeKind != TypeKind.Error) 252if (oldSymbol.TypeKind != TypeKind.Error) 254return oldSymbol.TypeKind; 273if ((object?)type != null && type.TypeKind != TypeKind.Error) 276commonTypeKind = type.TypeKind; 277else if (commonTypeKind != type.TypeKind)
Symbols\Metadata\PE\MetadataDecoder.cs (1)
395switch (candidate.TypeKind)
Symbols\Metadata\PE\NativeIntegerTypeDecoder.cs (2)
84switch (type.TypeKind) 102Debug.Assert(type.TypeKind == TypeKind.Error);
Symbols\Metadata\PE\PEMethodSymbol.cs (1)
1342if ((this.ContainingType.TypeKind == TypeKind.Class && this.IsRuntimeFinalizer(skipFirstMethodKindCheck: true)) ||
Symbols\Metadata\PE\PENamedTypeSymbol.cs (1)
2991var coClassType = ((object)type != null && (type.TypeKind == TypeKind.Class || type.IsErrorType())) ? (NamedTypeSymbol)type : null;
Symbols\Metadata\PE\TupleTypeDecoder.cs (1)
200throw ExceptionUtilities.UnexpectedValue(type.TypeKind);
Symbols\MissingMetadataTypeSymbol.cs (1)
376t2.TypeKind == TypeKind.Dynamic &&
Symbols\NamedTypeSymbol.cs (9)
179if (TypeKind != TypeKind.Delegate) 537var kind = TypeKind; 551var kind = TypeKind; 585return TypeKind == TypeKind.Submission; 604var name = (TypeKind == TypeKind.Submission) ? SynthesizedEntryPointSymbol.FactoryName : SynthesizedEntryPointSymbol.MainName; 652=> TypeKind == TypeKind.Extension; 1034if (t2.TypeKind == TypeKind.Dynamic) 1860/// Requires less computation than <see cref="TypeSymbol.TypeKind"/> == <see cref="TypeKind.Interface"/>. 1873return TypeKind is TypeKind.Class or TypeKind.Struct &&
Symbols\PointerTypeSymbol.cs (1)
220while (current.TypeKind == TypeKind.Pointer)
Symbols\PublicModel\TypeSymbol.cs (1)
151return UnderlyingTypeSymbol.TypeKind;
Symbols\Retargeting\RetargetingSymbolTranslator.cs (2)
842Debug.Assert(nts.TypeKind == TypeKind.Error || nts.PrimitiveTypeCode == Cci.PrimitiveTypeCode.NotPrimitive); 854Debug.Assert(ts.TypeKind == TypeKind.Error || ts.PrimitiveTypeCode == Cci.PrimitiveTypeCode.NotPrimitive);
Symbols\Source\ExplicitInterfaceHelpers.cs (1)
195switch (containingType.TypeKind)
Symbols\Source\SourceAssemblySymbol.cs (1)
2226Debug.Assert(forwardedType.TypeKind != TypeKind.Error);
Symbols\Source\SourceDelegateMethodSymbol.cs (2)
80if (binder.Compilation.GetSpecialType(SpecialType.System_IAsyncResult).TypeKind != TypeKind.Error && 81binder.Compilation.GetSpecialType(SpecialType.System_AsyncCallback).TypeKind != TypeKind.Error &&
Symbols\Source\SourceEventSymbol.cs (4)
669else if (IsAbstract && ContainingType.TypeKind == TypeKind.Struct) 674else if (IsVirtual && ContainingType.TypeKind == TypeKind.Struct) 715else if (IsAbstract && !ContainingType.IsAbstract && (ContainingType.TypeKind == TypeKind.Class || ContainingType.TypeKind == TypeKind.Submission))
Symbols\Source\SourceMemberContainerSymbol.cs (4)
2801(type.TypeKind == TypeKind.Struct) && 3132if (f is null || !f.IsStatic || f.Type.TypeKind != TypeKind.Struct) continue; 3161if (f is null || !f.IsStatic || f.Type.TypeKind != TypeKind.Struct) continue; 4011if (type.TypeKind == TypeKind.Extension)
Symbols\Source\SourceMemberFieldSymbol.cs (1)
609if (ContainingType.TypeKind != TypeKind.Struct)
Symbols\Source\SourceMethodSymbolWithAttributes.cs (1)
1487if (ContainingSymbol is NamedTypeSymbol { IsComImport: true, TypeKind: TypeKind.Class or TypeKind.Interface })
Symbols\Source\SourceNamedTypeSymbol.cs (2)
1257return builderType is NamedTypeSymbol { TypeKind: TypeKind.Class or TypeKind.Struct, IsGenericType: false }; 1364if ((object)coClassType != null && coClassType.TypeKind == TypeKind.Class)
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (9)
312else if (baseType.TypeKind == TypeKind.Error && (object)partBase != null) 319else if ((object)partBase != null && !TypeSymbol.Equals(partBase, baseType, TypeCompareKind.ConsiderEverything) && partBase.TypeKind != TypeKind.Error) 563if (baseType.TypeKind == TypeKind.Error) 575if ((baseType.TypeKind == TypeKind.Class || 576baseType.TypeKind == TypeKind.Delegate || 577baseType.TypeKind == TypeKind.Struct || 603switch (baseType.TypeKind) 669throw ExceptionUtilities.UnexpectedValue(baseType.TypeKind); 689if (TypeKind != TypeKind.Class || baseType.TypeKind == TypeKind.Interface)
Symbols\Source\SourceOrdinaryMethodSymbol.cs (5)
908else if (IsSealed && ContainingType.TypeKind == TypeKind.Struct) 930else if (IsAbstract && ContainingType.TypeKind == TypeKind.Struct) 935else if (IsVirtual && ContainingType.TypeKind == TypeKind.Struct) 945else if (IsAbstract && !ContainingType.IsAbstract && (ContainingType.TypeKind == TypeKind.Class || ContainingType.TypeKind == TypeKind.Submission))
Symbols\Source\SourcePropertyAccessorSymbol.cs (3)
569if (IsAbstract && !ContainingType.IsAbstract && (ContainingType.TypeKind == TypeKind.Class || ContainingType.TypeKind == TypeKind.Submission)) 574else if (IsVirtual && ContainingType.IsSealed && ContainingType.TypeKind != TypeKind.Struct) // error CS0106 on struct already
Symbols\Source\SourcePropertySymbolBase.cs (2)
1143else if (IsAbstract && ContainingType.TypeKind == TypeKind.Struct) 1148else if (IsVirtual && ContainingType.TypeKind == TypeKind.Struct)
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (1)
422case { TypeKind: TypeKind.TypeParameter, IsReferenceType: false }:
Symbols\Source\ThisParameterSymbol.cs (1)
157if (ContainingType?.TypeKind != TypeKind.Struct)
Symbols\Symbol.cs (3)
256if (ContainingType?.TypeKind == TypeKind.Submission) 278if (ContainingType.TypeKind == TypeKind.Submission) 289Debug.Assert(ContainingType.TypeKind != TypeKind.Submission);
Symbols\Symbol_Attributes.cs (2)
68switch (namedType.TypeKind) 90throw ExceptionUtilities.UnexpectedValue(namedType.TypeKind);
Symbols\SymbolExtensions.cs (3)
85return superType.TypeKind == TypeKind.Submission && subType.TypeKind == TypeKind.Submission; 239if (type.TypeKind == TypeKind.TypeParameter)
Symbols\Synthesized\SynthesizedContainer.cs (3)
48internal sealed override bool IsInterface => this.TypeKind == TypeKind.Interface; 94public override bool IsAbstract => (object)Constructor == null && this.TypeKind != TypeKind.Struct; 168internal override NamedTypeSymbol BaseTypeNoUseSiteDiagnostics => ContainingAssembly.GetSpecialType(this.TypeKind == TypeKind.Struct ? SpecialType.System_ValueType : SpecialType.System_Object);
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (2)
84Debug.Assert(_containingType.TypeKind == TypeKind.Class); 88if (_containingType.TypeKind == TypeKind.Delegate)
Symbols\Synthesized\SynthesizedSubmissionConstructor.cs (1)
19Debug.Assert(containingType.TypeKind == TypeKind.Submission);
Symbols\TypeParameterSymbol.cs (3)
394if (constraint.TypeKind == TypeKind.TypeParameter) 404Debug.Assert(constraint.TypeKind != TypeKind.TypeParameter); 412switch (constraint.TypeKind)
Symbols\TypeSymbol.cs (5)
110var interfaces = (baseType.TypeKind == TypeKind.TypeParameter) ? ((TypeParameterSymbol)baseType).EffectiveInterfacesNoUseSiteDiagnostics : baseType.InterfacesNoUseSiteDiagnostics(); 346var interfaces = (baseType.TypeKind == TypeKind.TypeParameter) ? ((TypeParameterSymbol)baseType).EffectiveInterfacesNoUseSiteDiagnostics : baseType.InterfacesNoUseSiteDiagnostics(); 509=> TypeKind switch 2528TypeKind ITypeSymbolInternal.TypeKind => this.TypeKind; 2556if (this.TypeKind == TypeKind.Struct)
Symbols\TypeSymbolExtensions.cs (32)
72if (type.TypeKind != TypeKind.TypeParameter) 118if (type.TypeKind == TypeKind.TypeParameter) 240return type.TypeKind == TypeKind.Enum; 333switch (type.TypeKind) 346return type is { IsValueType: true, TypeKind: not TypeKind.TypeParameter }; 358return type.TypeKind == TypeKind.Class; 364return type.TypeKind == TypeKind.Struct; 380return type.TypeKind == TypeKind.Dynamic; 386return type.TypeKind == TypeKind.TypeParameter; 392return type.TypeKind == TypeKind.Array; 398return type.TypeKind == TypeKind.Array && ((ArrayTypeSymbol)type).IsSZArray; 441return type.TypeKind == TypeKind.FunctionPointer; 446switch (type.TypeKind) 459switch (type.TypeKind) 611return type.TypeKind == TypeKind.Delegate; 745switch (type.TypeKind) 820switch (current.TypeKind) 878switch (current.TypeKind) 988throw ExceptionUtilities.UnexpectedValue(current.TypeKind); 1211if (ReferenceEquals(parent2.OriginalDefinition, parent1OriginalDefinition) || parent1OriginalDefinition.TypeKind == TypeKind.Submission && parent2.TypeKind == TypeKind.Submission) 1251(type, parameter, unused) => type.TypeKind == TypeKind.TypeParameter && (parameter is null || TypeSymbol.Equals(type, parameter, TypeCompareKind.ConsiderEverything2)); 1262(type, typeParameterContainer, unused) => type.TypeKind == TypeKind.TypeParameter && (object)type.ContainingSymbol == (object)typeParameterContainer; 1271(type, parameters, unused) => type.TypeKind == TypeKind.TypeParameter && parameters.Contains((TypeParameterSymbol)type); 1318(type, _, _) => type.TypeKind == TypeKind.TypeParameter && type.ContainingSymbol is MethodSymbol; 1329private static readonly Func<TypeSymbol, object?, bool, bool> s_containsDynamicPredicate = (type, unused1, unused2) => type.TypeKind == TypeKind.Dynamic; 1367type.VisitType((TypeSymbol t, object? _, bool _) => t.TypeKind is TypeKind.Pointer or TypeKind.FunctionPointer, null) is object; 1592switch (type.TypeKind) 1614throw ExceptionUtilities.UnexpectedValue(type.TypeKind); 1754return type.IsReferenceType && type.TypeKind != TypeKind.TypeParameter; 1762return type.IsValueType && type.TypeKind != TypeKind.TypeParameter; 2087if (taskType.TypeKind == TypeKind.Error)
Symbols\TypeWithAnnotations.cs (3)
200if (typeSymbol.TypeKind != TypeKind.TypeParameter) 271public TypeKind TypeKind => Type.TypeKind; 650if (type.TypeKind != TypeKind.Array)
Symbols\VarianceSafety.cs (3)
73switch (member.TypeKind) 86throw ExceptionUtilities.UnexpectedValue(member.TypeKind); 371switch (namedType.TypeKind)
Symbols\Wrapped\WrappedNamedTypeSymbol.cs (1)
117return _underlyingType.TypeKind;
Utilities\TypeSymbolExtensions.cs (4)
181switch (type.TypeKind) 206throw ExceptionUtilities.UnexpectedValue(type.TypeKind); 276switch (type.TypeKind) 286throw ExceptionUtilities.UnexpectedValue(type.TypeKind);