22 overrides of TypeKind
Microsoft.CodeAnalysis.CSharp (20)
Lowering\AsyncRewriter\AsyncStateMachine.cs (1)
64public override TypeKind TypeKind
Lowering\ClosureConversion\SynthesizedClosureEnvironment.cs (1)
38public override TypeKind TypeKind { get; }
Lowering\IteratorRewriter\IteratorStateMachine.cs (1)
46public override TypeKind TypeKind
Lowering\LocalRewriter\DelegateCacheContainer.cs (1)
44public override TypeKind TypeKind => TypeKind.Class;
Lowering\LocalRewriter\DynamicSiteContainer.cs (1)
29public override TypeKind TypeKind
Symbols\AnonymousTypes\PublicSymbols\AnonymousManager.TypeOrDelegatePublicSymbol.cs (1)
162public abstract override TypeKind TypeKind { get; }
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.DelegateTemplateSymbol.cs (1)
213public override TypeKind TypeKind => TypeKind.Delegate;
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TemplateSymbol.cs (1)
101public override TypeKind TypeKind
Symbols\ArrayTypeSymbol.cs (1)
293public override TypeKind TypeKind
Symbols\DynamicTypeSymbol.cs (1)
62public override TypeKind TypeKind
Symbols\ErrorTypeSymbol.cs (1)
223public sealed override TypeKind TypeKind
Symbols\FunctionPointers\FunctionPointerTypeSymbol.cs (1)
75public override TypeKind TypeKind => TypeKind.FunctionPointer;
Symbols\FunctionTypeSymbol.cs (1)
102public override TypeKind TypeKind => TypeKindInternal.FunctionType;
Symbols\Metadata\PE\PENamedTypeSymbol.cs (1)
1743public override TypeKind TypeKind
Symbols\PointerTypeSymbol.cs (1)
165public override TypeKind TypeKind
Symbols\Source\SourceFixedFieldSymbol.cs (1)
168public override TypeKind TypeKind
Symbols\Source\SourceMemberContainerSymbol.cs (1)
762public override TypeKind TypeKind
Symbols\Synthesized\SynthesizedEmbeddedAttributeSymbol.cs (1)
74public override TypeKind TypeKind => TypeKind.Class;
Symbols\TypeParameterSymbol.cs (1)
195public sealed override TypeKind TypeKind
Symbols\Wrapped\WrappedNamedTypeSymbol.cs (1)
111public override TypeKind TypeKind
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler (1)
Symbols\EENamedTypeSymbol.cs (1)
289public override TypeKind TypeKind
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Symbols\MockNamedTypeSymbol.cs (1)
144public override TypeKind TypeKind
655 references to TypeKind
Microsoft.CodeAnalysis.CSharp (310)
Binder\Binder.ValueChecks.cs (1)
2639if (parameters[paramIndex] is not { IsParams: true, Type.TypeKind: TypeKind.Array })
Binder\Binder_Attributes.cs (2)
58if (boundTypeSymbol.TypeKind != TypeKind.Error) 730parameter.Type.TypeKind == TypeKind.Array &&
Binder\Binder_Constraints.cs (2)
541switch (type.TypeKind) 586throw ExceptionUtilities.UnexpectedValue(type.TypeKind);
Binder\Binder_Conversions.cs (10)
378switch (type.TypeKind) 1276Debug.Assert(delegateType is NamedTypeSymbol { TypeKind: TypeKind.Delegate, DelegateInvokeMethod: { HasUseSiteError: false } } 1277|| delegateType.TypeKind == TypeKind.FunctionPointer, 1298Error(diagnostics, getMethodMismatchErrorCode(delegateType.TypeKind), errorLocation, method, delegateType); 1328if (!hasConversion(delegateType.TypeKind, Conversions, delegateParameter.Type, methodParameter.Type, delegateParameter.RefKind, methodParameter.RefKind, ref useSiteInfo)) 1331Error(diagnostics, getMethodMismatchErrorCode(delegateType.TypeKind), errorLocation, method, delegateType); 1339Error(diagnostics, getRefMismatchErrorCode(delegateType.TypeKind), errorLocation, method, delegateType); 1349{ RefKind: var destinationRefKind } => hasConversion(delegateType.TypeKind, Conversions, methodReturnType, delegateReturnType, method.RefKind, destinationRefKind, ref useSiteInfo), 1443Debug.Assert(Conversions.IsAssignableFromMulticastDelegate(delegateOrFuncPtrType, ref discardedUseSiteInfo) || delegateOrFuncPtrType.TypeKind == TypeKind.Delegate || delegateOrFuncPtrType.TypeKind == TypeKind.FunctionPointer);
Binder\Binder_Crefs.cs (3)
554switch (type.TypeKind) 601throw ExceptionUtilities.UnexpectedValue(type.TypeKind); 989Debug.Assert(type.TypeKind != TypeKind.Error || typeSyntax.ContainsDiagnostics || !typeSyntax.SyntaxTree.ReportDocumentationCommentDiagnostics(), "Why wasn't there a diagnostic?");
Binder\Binder_Expressions.cs (18)
2125if (this.ContainingType.TypeKind == TypeKind.Submission 2129if (memberDeclaringType.TypeKind == TypeKind.Submission) 2565if (targetType.TypeKind != TypeKind.Delegate || 2611var errorCode = targetType.TypeKind switch 4122if ((containingType.TypeKind == TypeKind.Enum || containingType.TypeKind == TypeKind.Struct) && initializerArgumentListOpt == null) 4174else if (initializerArgumentListOpt != null && containingType.TypeKind == TypeKind.Struct) 4440switch (type.TypeKind) 4459throw ExceptionUtilities.UnexpectedValue(type.TypeKind); 4476throw ExceptionUtilities.UnexpectedValue(type.TypeKind); 4600else if (argument.Type.TypeKind == TypeKind.Delegate) 4700Debug.Assert(type.TypeKind is TypeKind.Class or TypeKind.Struct); 5844Debug.Assert(coClassType.TypeKind == TypeKind.Class || coClassType.TypeKind == TypeKind.Error); 6191if (type.TypeKind == TypeKind.Enum) 6770if (leftType.TypeKind == TypeKind.TypeParameter) 7622if (receiverOpt is not BoundTypeExpression { Type: { TypeKind: TypeKind.TypeParameter } }) 7944switch (exprType.TypeKind)
Binder\Binder_InterpolatedString.cs (1)
295&& unconvertedInterpolatedString.Parts.All(p => p is not BoundStringInsert { Value.Type.TypeKind: TypeKind.Dynamic });
Binder\Binder_Lookup.cs (4)
182switch (type.TypeKind) 213throw ExceptionUtilities.UnexpectedValue(type.TypeKind); 806Debug.Assert(!type.IsInterfaceType() && type.TypeKind != TypeKind.TypeParameter); 1865switch (type.TypeKind)
Binder\Binder_Operators.cs (10)
606leftType?.TypeKind == TypeKind.FunctionPointer && rightType?.TypeKind == TypeKind.FunctionPointer) 785(object)left.Type != null && left.Type.TypeKind == TypeKind.Delegate) 3168return targetType.TypeKind == TypeKind.Error; 3225var targetTypeKind = targetType.TypeKind; 3279if (operandType.TypeKind == TypeKind.Dynamic) 3623var targetTypeKind = targetType.TypeKind; 3727var operandTypeKind = operandType.TypeKind; 3741operandTypeKind = operandType.TypeKind; 3748targetTypeKind = targetType.TypeKind;
Binder\Binder_Patterns.cs (1)
1243if (iTupleType.TypeKind != TypeKind.Interface)
Binder\Binder_Query.cs (1)
978if (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)
2273if (targetType.TypeKind == TypeKind.Error) 2333if (targetType.TypeKind == TypeKind.TypeParameter) 2426switch (targetType.TypeKind)
Binder\ForEachLoopBinder.cs (3)
1390switch (enumeratorType.TypeKind) 1401throw ExceptionUtilities.UnexpectedValue(enumeratorType.TypeKind); 1580if (type.TypeKind == TypeKind.TypeParameter)
Binder\PatternExplainer.cs (1)
649if (type is NamedTypeSymbol { TypeKind: TypeKind.Enum } e)
Binder\Semantics\AccessCheck.cs (3)
367if (containingType.TypeKind == TypeKind.Submission) 429if (originalContainingType.TypeKind == TypeKind.Submission) 698return containingType.TypeKind == TypeKind.Struct ? ErrorCode.ERR_ProtectedInStruct : ErrorCode.WRN_ProtectedInSealed;
Binder\Semantics\Conversions\Conversions.cs (1)
402if (spanType.TypeKind == TypeKind.Struct && spanType.IsRefLikeType)
Binder\Semantics\Conversions\ConversionsBase.cs (6)
2032if (otherType.TypeKind == TypeKind.Enum) 2501switch (source.TypeKind) 2714if ((destination.TypeKind == TypeKind.TypeParameter) && 2751if ((destination.TypeKind == TypeKind.TypeParameter) && 3054if ((destination.TypeKind == TypeKind.TypeParameter) && 3081if ((source.TypeKind == TypeKind.TypeParameter) &&
Binder\Semantics\Conversions\UserDefinedExplicitConversions.cs (1)
257if (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)
2039if (target.TypeKind != TypeKind.Class) 2058if (source.TypeKind == TypeKind.Class) 2062else if (source.TypeKind == TypeKind.TypeParameter) 2098switch (source.TypeKind) 2436if (source.TypeKind != TypeKind.Class || target.TypeKind != TypeKind.Class) 2475switch (target.TypeKind)
Binder\Semantics\OverloadResolution\OverloadResolution.cs (3)
2083if (m1.Member.ContainingType.TypeKind == TypeKind.Submission && m2.Member.ContainingType.TypeKind == TypeKind.Submission) 2307if (t1.TypeKind == TypeKind.Pointer)
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (2)
1185else if (argument.Kind == BoundKind.MethodGroup && parameterType.TypeKind == TypeKind.Delegate && 1190else if (argument.Kind == BoundKind.MethodGroup && parameterType.TypeKind == TypeKind.FunctionPointer)
BoundTree\BoundDagTest.cs (1)
83var typeName = b.Type.TypeKind == TypeKind.Error ? "<error type>" : b.Type.ToString();
CodeGen\EmitAddress.cs (2)
417Debug.Assert(arrayAccess.Type.TypeKind == TypeKind.TypeParameter, "constrained call should only be used with type parameter types"); 508if (receiverType.TypeKind == TypeKind.TypeParameter)
CodeGen\EmitConversion.cs (1)
330if (receiver is not BoundTypeExpression { Type: { TypeKind: TypeKind.TypeParameter } })
CodeGen\EmitExpression.cs (8)
428(receiverType.IsReferenceType && receiverType.TypeKind == TypeKind.TypeParameter) || 795Debug.Assert(thisType.TypeKind != TypeKind.TypeParameter); 1057if (elementType.TypeKind == TypeKind.TypeParameter) 1628if (receiver is not BoundTypeExpression { Type: { TypeKind: TypeKind.TypeParameter } }) 2437if (left.Kind == BoundKind.ArrayAccess && left.Type.TypeKind == TypeKind.TypeParameter && !left.Type.IsValueType) 3258if (((object)type != null) && (type.TypeKind == TypeKind.TypeParameter) && constantValue.IsNull) 3826Debug.Assert(load.Type is { TypeKind: TypeKind.FunctionPointer }); 3832if (load.ConstrainedToTypeOpt is not { TypeKind: TypeKind.TypeParameter })
CodeGen\EmitStackAllocInitializer.cs (1)
23var elementType = (type.TypeKind == TypeKind.Pointer
CodeGen\EmitStatement.cs (1)
180if (exprType?.TypeKind == TypeKind.TypeParameter)
CodeGen\Optimizer.cs (2)
1125if ((method.IsAbstract || method.IsVirtual) && receiver is BoundTypeExpression { Type: { TypeKind: TypeKind.TypeParameter } } typeExpression) 2146if (receiverOpt is BoundTypeExpression { AliasOpt: null, BoundContainingTypeOpt: null, BoundDimensionsOpt: { IsEmpty: true }, Type: { TypeKind: TypeKind.TypeParameter } } typeExpression)
Compilation\CSharpCompilation.cs (8)
1773if (mainType is null || mainType.IsGenericType || (mainType.TypeKind != TypeKind.Class && mainType.TypeKind != TypeKind.Struct && !mainType.IsInterface)) 3941if (csharpReturnType.TypeKind is TypeKind.Dynamic || 3942csharpLeftType.TypeKind is TypeKind.Dynamic || 3943csharpReturnType.TypeKind is TypeKind.Dynamic) 3985if (csharpLeftType.TypeKind is TypeKind.Delegate && 4167if (csharpReturnType.TypeKind is TypeKind.Dynamic || 4168csharpOperandType.TypeKind is TypeKind.Dynamic)
Compilation\CSharpSemanticModel.cs (3)
546if (varTypeInfo.Type is { TypeKind: not TypeKind.Error }) 976if (varTypeInfo.Type is { TypeKind: not TypeKind.Error }) 2240else if (boundExpr is BoundConversion { ConversionKind: ConversionKind.MethodGroup, Conversion: var exprConversion, Type: { TypeKind: TypeKind.FunctionPointer }, SymbolOpt: var symbol })
Compiler\ClsComplianceChecker.cs (8)
247if (symbol.TypeKind == TypeKind.Delegate) 467if (type.TypeKind == TypeKind.Delegate) 731System.Diagnostics.Debug.Assert(method.ContainingType.TypeKind == TypeKind.Delegate); 976switch (type.TypeKind) 1001throw ExceptionUtilities.UnexpectedValue(type.TypeKind); 1025if (type.TypeKind == TypeKind.Error) 1365TypeKind typeKind = xType.TypeKind; 1366if (yType.TypeKind != typeKind)
Compiler\MethodCompiler.cs (1)
617containingType is { IsImplicitlyDeclared: false, TypeKind: TypeKind.Class or TypeKind.Struct or TypeKind.Interface } &&
Emitter\Model\MethodSymbolAdapter.cs (1)
612return this.IsExtern || (object)ContainingType != null && ContainingType.TypeKind == TypeKind.Delegate;
Emitter\Model\NamedTypeSymbolAdapter.cs (2)
41get { return AdaptedNamedTypeSymbol.TypeKind == TypeKind.Enum; } 506switch (AdaptedNamedTypeSymbol.TypeKind)
Emitter\Model\PEModuleBuilder.cs (3)
1208if (symbol.ContainingType?.TypeKind == TypeKind.Submission) 1230if (symbol.ContainingType.TypeKind == TypeKind.Submission) 1241Debug.Assert(symbol.ContainingType.TypeKind != TypeKind.Submission);
Emitter\NoPia\EmbeddedType.cs (1)
157switch (UnderlyingNamedType.AdaptedNamedTypeSymbol.TypeKind)
Emitter\NoPia\EmbeddedTypesManager.cs (8)
251switch (namedType.TypeKind) 385Debug.Assert(namedType.TypeKind == TypeKind.Struct || namedType.TypeKind == TypeKind.Enum || namedType.TypeKind == TypeKind.Delegate); 388if (namedType.TypeKind == TypeKind.Struct || namedType.TypeKind == TypeKind.Enum) 438var containerKind = field.AdaptedFieldSymbol.ContainingType.TypeKind; 475switch (type.UnderlyingNamedType.AdaptedNamedTypeSymbol.TypeKind)
FlowAnalysis\AbstractFlowPass.cs (1)
2063fieldSymbol.ContainingType.TypeKind == TypeKind.Struct &&
FlowAnalysis\DefiniteAssignment.cs (5)
103&& CurrentSymbol is MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }; 1087(_trackClassFields || type.TypeKind == TypeKind.Struct); 1214Debug.Assert(CurrentSymbol is MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }); 1261if (CurrentSymbol is not MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }) 2464switch (type.TypeKind)
FlowAnalysis\EmptyStructTypeCache.cs (1)
238switch (type.TypeKind)
FlowAnalysis\NullableWalker.cs (7)
2289return valueType.Type?.TypeKind == TypeKind.TypeParameter && 4018if (type.TypeKind != TypeKind.Struct) 4171_ => throw ExceptionUtilities.UnexpectedValue(type.TypeKind) 4259_ => throw ExceptionUtilities.UnexpectedValue(type.TypeKind) 5073{ TypeKind: TypeKind.Interface } => type.AllInterfacesNoUseSiteDiagnostics, 7997NamedTypeSymbol { TypeKind: TypeKind.Delegate, DelegateInvokeMethod: { Parameters: { } parameters } signature } => (signature, parameters), 8717case BoundExpression arg when arg.Type is { TypeKind: TypeKind.Delegate }:
Lowering\AsyncRewriter\AsyncMethodToStateMachineRewriter.cs (2)
539LocalSymbol thisTemp = (F.CurrentType.TypeKind == TypeKind.Class) ? F.SynthesizedLocal(F.CurrentType) : null; 600LocalSymbol 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)
533if (e.StrippedType().TypeKind == TypeKind.Enum) 720if ((object)d != null && d.TypeKind == TypeKind.Delegate)
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (1)
239_ when variableType.TypeKind is TypeKind.Struct
Lowering\LocalRewriter\LocalRewriter.cs (1)
720Debug.Assert(node.Expression.Type is { TypeKind: TypeKind.Array });
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (4)
2180Debug.Assert(loweredLeft.Type is { TypeKind: TypeKind.Pointer }); 2185Debug.Assert(loweredRight.Type is { TypeKind: TypeKind.Pointer }); 2372Debug.Assert(loweredLeft.Type is { TypeKind: TypeKind.Pointer }); 2373Debug.Assert(loweredRight.Type is { TypeKind: TypeKind.Pointer });
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (1)
541case 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 (2)
703Debug.Assert(collectionExpression.Type is { TypeKind: TypeKind.Array }); 828Debug.Assert(collectionExpression.Type is { TypeKind: TypeKind.Array });
Lowering\LocalRewriter\LocalRewriter_PropertyAccess.cs (1)
37if (rewrittenReceiverOpt is { Type: { TypeKind: TypeKind.Array } } && !isLeftOfAssignment)
Lowering\LocalRewriter\LocalRewriter_StringInterpolation.cs (1)
235if (value.Type?.TypeKind == TypeKind.Dynamic)
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (1)
755Debug.Assert(binaryOperand.Type is { TypeKind: TypeKind.Pointer });
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (1)
64if (!method.IsStatic && method.ContainingType.TypeKind == TypeKind.Struct)
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (2)
439if (type.IsReferenceType || type.TypeKind == TypeKind.TypeParameter) return true; // type parameter or reference type 440if (type.TypeKind != TypeKind.Struct) return false; // enums, etc
Lowering\SyntheticBoundNodeFactory.cs (3)
1097Debug.Assert(array.Type is { TypeKind: TypeKind.Array }); 1103Debug.Assert(array.Type is { TypeKind: TypeKind.Array }); 1116Debug.Assert(array.Type is { TypeKind: TypeKind.Array });
Symbols\ArrayTypeSymbol.cs (1)
375while (current.TypeKind == TypeKind.Array)
Symbols\AssemblySymbol.cs (3)
473return GetSpecialType(SpecialType.System_Runtime_CompilerServices_RuntimeFeature) is { TypeKind: TypeKind.Class, IsStatic: true } && 496GetSpecialType(SpecialType.System_Runtime_CompilerServices_PreserveBaseOverridesAttribute) is { TypeKind: TypeKind.Class }; 992if (result is null || result.TypeKind == TypeKind.Error)
Symbols\BaseTypeAnalysis.cs (2)
97if (fieldType is null || fieldType.TypeKind != TypeKind.Struct || field.IsStatic) 283switch (type.TypeKind)
Symbols\Compilation_WellKnownMembers.cs (2)
218if (type.Kind != SymbolKind.NamedType || type.TypeKind != TypeKind.Class) 912switch (type.TypeKind)
Symbols\ConstantValueUtils.cs (1)
90if (typeSymbol.TypeKind == TypeKind.TypeParameter)
Symbols\ConstraintsHelper.cs (5)
213if (underlyingType.TypeKind == TypeKind.TypeParameter) 1368switch (typeArgument.TypeKind) 1393throw ExceptionUtilities.UnexpectedValue(typeArgument.TypeKind); 1402Debug.Assert(type.TypeKind is TypeKind.Class or TypeKind.Struct); 1450switch (type.TypeKind)
Symbols\DynamicTypeSymbol.cs (1)
202if (ReferenceEquals(this, t2) || t2.TypeKind == TypeKind.Dynamic)
Symbols\ExtendedErrorTypeSymbol.cs (6)
223if ((object?)oldSymbol == null || oldSymbol.TypeKind != TypeKind.Error) 251if (oldSymbol.TypeKind != TypeKind.Error) 253return oldSymbol.TypeKind; 272if ((object?)type != null && type.TypeKind != TypeKind.Error) 275commonTypeKind = type.TypeKind; 276else if (commonTypeKind != type.TypeKind)
Symbols\Metadata\PE\MetadataDecoder.cs (1)
395switch (candidate.TypeKind)
Symbols\Metadata\PE\NativeIntegerTypeDecoder.cs (2)
85switch (type.TypeKind) 103Debug.Assert(type.TypeKind == TypeKind.Error);
Symbols\Metadata\PE\PEMethodSymbol.cs (1)
1219if ((this.ContainingType.TypeKind == TypeKind.Class && this.IsRuntimeFinalizer(skipFirstMethodKindCheck: true)) ||
Symbols\Metadata\PE\PENamedTypeSymbol.cs (1)
2320var 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)
375t2.TypeKind == TypeKind.Dynamic &&
Symbols\NamedTypeSymbol.cs (8)
182if (TypeKind != TypeKind.Delegate) 367(thisParam.RefKind == RefKind.In && thisParam.Type.TypeKind != TypeKind.Struct)) 392var kind = TypeKind; 406var kind = TypeKind; 440return TypeKind == TypeKind.Submission; 459var name = (TypeKind == TypeKind.Submission) ? SynthesizedEntryPointSymbol.FactoryName : SynthesizedEntryPointSymbol.MainName; 804if (t2.TypeKind == TypeKind.Dynamic) 1622/// Requires less computation than <see cref="TypeSymbol.TypeKind"/> == <see cref="TypeKind.Interface"/>.
Symbols\PointerTypeSymbol.cs (1)
219while (current.TypeKind == TypeKind.Pointer)
Symbols\PublicModel\TypeSymbol.cs (1)
139return UnderlyingTypeSymbol.TypeKind;
Symbols\Retargeting\RetargetingSymbolTranslator.cs (2)
848Debug.Assert(nts.TypeKind == TypeKind.Error || nts.PrimitiveTypeCode == Cci.PrimitiveTypeCode.NotPrimitive); 862Debug.Assert(ts.TypeKind == TypeKind.Error || ts.PrimitiveTypeCode == Cci.PrimitiveTypeCode.NotPrimitive);
Symbols\Source\ExplicitInterfaceHelpers.cs (1)
191switch (containingType.TypeKind)
Symbols\Source\SourceAssemblySymbol.cs (1)
2198Debug.Assert(forwardedType.TypeKind != TypeKind.Error);
Symbols\Source\SourceDelegateMethodSymbol.cs (2)
76if (binder.Compilation.GetSpecialType(SpecialType.System_IAsyncResult).TypeKind != TypeKind.Error && 77binder.Compilation.GetSpecialType(SpecialType.System_AsyncCallback).TypeKind != TypeKind.Error &&
Symbols\Source\SourceEventSymbol.cs (4)
549else if (IsAbstract && ContainingType.TypeKind == TypeKind.Struct) 554else if (IsVirtual && ContainingType.TypeKind == TypeKind.Struct) 595else if (IsAbstract && !ContainingType.IsAbstract && (ContainingType.TypeKind == TypeKind.Class || ContainingType.TypeKind == TypeKind.Submission))
Symbols\Source\SourceMemberContainerSymbol.cs (3)
2294(type.TypeKind == TypeKind.Struct) && 2573if (f is null || !f.IsStatic || f.Type.TypeKind != TypeKind.Struct) continue; 2602if (f is null || !f.IsStatic || f.Type.TypeKind != TypeKind.Struct) continue;
Symbols\Source\SourceMemberFieldSymbol.cs (1)
559if (ContainingType.TypeKind != TypeKind.Struct)
Symbols\Source\SourceMethodSymbolWithAttributes.cs (1)
1030if (ContainingSymbol is NamedTypeSymbol { IsComImport: true, TypeKind: TypeKind.Class or TypeKind.Interface })
Symbols\Source\SourceNamedTypeSymbol.cs (1)
1261if ((object)coClassType != null && coClassType.TypeKind == TypeKind.Class)
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (9)
311else if (baseType.TypeKind == TypeKind.Error && (object)partBase != null) 318else if ((object)partBase != null && !TypeSymbol.Equals(partBase, baseType, TypeCompareKind.ConsiderEverything) && partBase.TypeKind != TypeKind.Error) 507if (baseType.TypeKind == TypeKind.Error) 519if ((baseType.TypeKind == TypeKind.Class || 520baseType.TypeKind == TypeKind.Delegate || 521baseType.TypeKind == TypeKind.Struct || 547switch (baseType.TypeKind) 614throw ExceptionUtilities.UnexpectedValue(baseType.TypeKind); 633(TypeKind != TypeKind.Class || baseType.TypeKind == TypeKind.Interface || ((TypeDeclarationSyntax)decl.SyntaxReference.GetSyntax()).ParameterList is null))
Symbols\Source\SourceOrdinaryMethodSymbolBase.cs (5)
361else if (IsSealed && ContainingType.TypeKind == TypeKind.Struct) 383else if (IsAbstract && ContainingType.TypeKind == TypeKind.Struct) 388else if (IsVirtual && ContainingType.TypeKind == TypeKind.Struct) 398else if (IsAbstract && !ContainingType.IsAbstract && (ContainingType.TypeKind == TypeKind.Class || ContainingType.TypeKind == TypeKind.Submission))
Symbols\Source\SourcePropertyAccessorSymbol.cs (3)
528if (IsAbstract && !ContainingType.IsAbstract && (ContainingType.TypeKind == TypeKind.Class || ContainingType.TypeKind == TypeKind.Submission)) 533else if (IsVirtual && ContainingType.IsSealed && ContainingType.TypeKind != TypeKind.Struct) // error CS0106 on struct already
Symbols\Source\SourcePropertySymbolBase.cs (2)
870else if (IsAbstract && ContainingType.TypeKind == TypeKind.Struct) 875else if (IsVirtual && ContainingType.TypeKind == TypeKind.Struct)
Symbols\Source\ThisParameterSymbol.cs (1)
39if (ContainingType?.TypeKind != TypeKind.Struct)
Symbols\Symbol_Attributes.cs (2)
68switch (namedType.TypeKind) 90throw ExceptionUtilities.UnexpectedValue(namedType.TypeKind);
Symbols\SymbolExtensions.cs (3)
84return superType.TypeKind == TypeKind.Submission && subType.TypeKind == TypeKind.Submission; 250if (type.TypeKind == TypeKind.TypeParameter)
Symbols\Synthesized\SynthesizedContainer.cs (3)
56internal sealed override bool IsInterface => this.TypeKind == TypeKind.Interface; 96public override bool IsAbstract => (object)Constructor == null && this.TypeKind != TypeKind.Struct; 156internal 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)
393if (constraint.TypeKind == TypeKind.TypeParameter) 403Debug.Assert(constraint.TypeKind != TypeKind.TypeParameter); 411switch (constraint.TypeKind)
Symbols\TypeSymbol.cs (4)
108var interfaces = (baseType.TypeKind == TypeKind.TypeParameter) ? ((TypeParameterSymbol)baseType).EffectiveInterfacesNoUseSiteDiagnostics : baseType.InterfacesNoUseSiteDiagnostics(); 344var interfaces = (baseType.TypeKind == TypeKind.TypeParameter) ? ((TypeParameterSymbol)baseType).EffectiveInterfacesNoUseSiteDiagnostics : baseType.InterfacesNoUseSiteDiagnostics(); 505=> TypeKind switch 2453TypeKind ITypeSymbolInternal.TypeKind => this.TypeKind;
Symbols\TypeSymbolExtensions.cs (31)
63if (type.TypeKind != TypeKind.TypeParameter) 109if (type.TypeKind == TypeKind.TypeParameter) 201return type.TypeKind == TypeKind.Enum; 294switch (type.TypeKind) 314return type.TypeKind == TypeKind.Class; 320return type.TypeKind == TypeKind.Struct; 336return type.TypeKind == TypeKind.Dynamic; 342return type.TypeKind == TypeKind.TypeParameter; 348return type.TypeKind == TypeKind.Array; 354return type.TypeKind == TypeKind.Array && ((ArrayTypeSymbol)type).IsSZArray; 359return type.TypeKind == TypeKind.FunctionPointer; 364switch (type.TypeKind) 506return type.TypeKind == TypeKind.Delegate; 620switch (type.TypeKind) 695switch (current.TypeKind) 753switch (current.TypeKind) 853throw ExceptionUtilities.UnexpectedValue(current.TypeKind); 1076if (ReferenceEquals(parent2.OriginalDefinition, parent1OriginalDefinition) || parent1OriginalDefinition.TypeKind == TypeKind.Submission && parent2.TypeKind == TypeKind.Submission) 1116(type, parameter, unused) => type.TypeKind == TypeKind.TypeParameter && (parameter is null || TypeSymbol.Equals(type, parameter, TypeCompareKind.ConsiderEverything2)); 1127(type, parameterContainer, unused) => type.TypeKind == TypeKind.TypeParameter && (object)type.ContainingSymbol == (object)parameterContainer; 1136(type, parameters, unused) => type.TypeKind == TypeKind.TypeParameter && parameters.Contains((TypeParameterSymbol)type); 1145(type, _, _) => type.TypeKind == TypeKind.TypeParameter && type.ContainingSymbol is MethodSymbol; 1156private static readonly Func<TypeSymbol, object?, bool, bool> s_containsDynamicPredicate = (type, unused1, unused2) => type.TypeKind == TypeKind.Dynamic; 1194type.VisitType((TypeSymbol t, object? _, bool _) => t.TypeKind is TypeKind.Pointer or TypeKind.FunctionPointer, null) is object; 1395switch (type.TypeKind) 1417throw ExceptionUtilities.UnexpectedValue(type.TypeKind); 1441switch (type.TypeKind) 1578return type.IsReferenceType && type.TypeKind != TypeKind.TypeParameter; 1586return type.IsValueType && type.TypeKind != TypeKind.TypeParameter; 1912if (taskType.TypeKind == TypeKind.Error)
Symbols\TypeWithAnnotations.cs (3)
192if (typeSymbol.TypeKind != TypeKind.TypeParameter) 262public TypeKind TypeKind => Type.TypeKind; 622if (type.TypeKind != TypeKind.Array)
Symbols\VarianceSafety.cs (3)
73switch (member.TypeKind) 83throw ExceptionUtilities.UnexpectedValue(member.TypeKind); 368switch (namedType.TypeKind)
Symbols\Wrapped\WrappedNamedTypeSymbol.cs (1)
115return _underlyingType.TypeKind;
Utilities\TypeSymbolExtensions.cs (3)
181switch (type.TypeKind) 266switch (type.TypeKind) 276throw ExceptionUtilities.UnexpectedValue(type.TypeKind);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (27)
CodeGen\CodeGenAsyncTests.cs (3)
67Assert.Equal(TypeKind.Struct, stateMachine.TypeKind); 76Assert.Equal(TypeKind.Struct, stateMachine.TypeKind); 85Assert.Equal(TypeKind.Class, stateMachine.TypeKind);
CodeGen\CodeGenAwaitUsingTests.cs (1)
2402Assert.Equal(TypeKind.Error, comp.GetWellKnownType(WellKnownType.System_IAsyncDisposable).TypeKind);
CodeGen\CodeGenFunctionPointersTests.cs (2)
302Assert.Equal(TypeKind.FunctionPointer, field.Type.TypeKind); 378Assert.Equal(TypeKind.FunctionPointer, field.Type.TypeKind);
CodeGen\CodeGenTupleTest.cs (6)
3344Assert.Equal(TypeKind.Error, mTuple.TupleUnderlyingType.TypeKind); 3347Assert.Equal(TypeKind.Error, mTuple.TypeKind); 11160Assert.Equal(TypeKind.Struct, m1Tuple.TypeKind); 11424Assert.Equal(TypeKind.Struct, m1Tuple.TypeKind); 12742Assert.Equal(TypeKind.Struct, m1Tuple.TypeKind); 23961Assert.Equal(TypeKind.Class, compilation.GetWellKnownType(WellKnownType.System_ValueTuple_T2).TypeKind);
Emit\EmitMetadataTests.cs (6)
317Assert.Equal(TypeKind.Interface, i1.TypeKind); 318Assert.Equal(TypeKind.Interface, i2.TypeKind); 319Assert.Equal(TypeKind.Interface, i3.TypeKind); 320Assert.Equal(TypeKind.Class, classA.TypeKind); 321Assert.Equal(TypeKind.Class, classB.TypeKind); 2074Assert.Equal(TypeKind.Interface, beginInvoke.ReturnType.TypeKind);
Emit\NoPiaEmbedTypes.cs (9)
1218Assert.Equal(TypeKind.Interface, itest3.TypeKind); 1231Assert.Equal(TypeKind.Struct, test5.TypeKind); 1249Assert.Equal(TypeKind.Interface, itest6.TypeKind); 1252Assert.Equal(TypeKind.Interface, itest7.TypeKind); 1255Assert.Equal(TypeKind.Interface, itest8.TypeKind); 1314Assert.Equal(TypeKind.Struct, test10.TypeKind); 1417Assert.Equal(TypeKind.Interface, itest13.TypeKind); 1438Assert.Equal(TypeKind.Interface, itest14.TypeKind); 1448Assert.Equal(TypeKind.Interface, itest16.TypeKind);
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler.UnitTests (12)
DynamicTests.cs (10)
57Assert.Equal(TypeKind.Dynamic, method.ReturnType.TypeKind); 98Assert.Equal(TypeKind.Dynamic, ((ArrayTypeSymbol)method.ReturnType).ElementType.TypeKind); 139Assert.Equal(TypeKind.Dynamic, ((NamedTypeSymbol)method.ReturnType).TypeArguments().Single().TypeKind); 180Assert.Equal(TypeKind.Dynamic, method.ReturnType.TypeKind); 220Assert.Equal(TypeKind.Dynamic, ((ArrayTypeSymbol)method.ReturnType).ElementType.TypeKind); 265Assert.Equal(TypeKind.Dynamic, ((NamedTypeSymbol)method.ReturnType).TypeArguments().Single().TypeKind); 656Assert.Equal(TypeKind.Dynamic, method.ReturnType.TypeKind); 695Assert.Equal(TypeKind.Dynamic, ((ArrayTypeSymbol)method.ReturnType).ElementType.TypeKind); 734Assert.Equal(TypeKind.Dynamic, ((NamedTypeSymbol)method.ReturnType).TypeArguments().Single().TypeKind); 984Assert.Equal(TypeKind.Dynamic, ((MethodSymbol)methodData.Method).ReturnType.TypeKind);
ManagedAddressOfTests.cs (1)
307Assert.Equal(TypeKind.Pointer, returnType.TypeKind);
WinMdTests.cs (1)
235Assert.Equal(TypeKind.Class, actualReturnType.TypeKind); // not error
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (89)
Semantics\ForEachTests.cs (2)
1681Assert.Equal(TypeKind.Dynamic, ((BoundConversion)boundNode.Expression).Operand.Type.TypeKind); 1701Assert.Equal(TypeKind.Dynamic, info.ElementType.TypeKind); //NB: differs from explicit case
Semantics\NativeIntegerTests.cs (2)
224Assert.Equal(TypeKind.Struct, type.TypeKind); 727Assert.Equal(TypeKind.Error, type.TypeKind);
Semantics\NullableReferenceTypesTests.cs (30)
112891Assert.Equal(TypeKind.Struct, compilation1.GetTypeByMetadataName("A").TypeKind); 112892Assert.Equal(TypeKind.Enum, compilation1.GetTypeByMetadataName("B").TypeKind); 112893Assert.Equal(TypeKind.Class, compilation1.GetTypeByMetadataName("C").TypeKind); 112894Assert.Equal(TypeKind.Delegate, compilation1.GetTypeByMetadataName("D").TypeKind); 112895Assert.Equal(TypeKind.Interface, compilation1.GetTypeByMetadataName("I1").TypeKind); 112911Assert.Equal(TypeKind.Struct, compilation2.GetTypeByMetadataName("A").TypeKind); 112912Assert.Equal(TypeKind.Enum, compilation2.GetTypeByMetadataName("B").TypeKind); 112913Assert.Equal(TypeKind.Class, compilation2.GetTypeByMetadataName("C").TypeKind); 112914Assert.Equal(TypeKind.Delegate, compilation2.GetTypeByMetadataName("D").TypeKind); 112915Assert.Equal(TypeKind.Interface, compilation2.GetTypeByMetadataName("I1").TypeKind); 112922Assert.Equal(TypeKind.Struct, compilation3.GetTypeByMetadataName("A").TypeKind); 112923Assert.Equal(TypeKind.Enum, compilation3.GetTypeByMetadataName("B").TypeKind); 112924Assert.Equal(TypeKind.Class, compilation3.GetTypeByMetadataName("C").TypeKind); 112925Assert.Equal(TypeKind.Delegate, compilation3.GetTypeByMetadataName("D").TypeKind); 112926Assert.Equal(TypeKind.Interface, compilation3.GetTypeByMetadataName("I1").TypeKind); 112947Assert.Equal(TypeKind.Class, a.TypeKind); 112949Assert.Equal(TypeKind.Class, b.TypeKind); 112951Assert.Equal(TypeKind.Class, c.TypeKind); 112953Assert.Equal(TypeKind.Class, d.TypeKind); 112955Assert.Equal(TypeKind.Interface, i1.TypeKind); 113015Assert.Equal(TypeKind.Class, a.TypeKind); 113017Assert.Equal(TypeKind.Class, b.TypeKind); 113019Assert.Equal(TypeKind.Class, c.TypeKind); 113021Assert.Equal(TypeKind.Class, d.TypeKind); 113023Assert.Equal(TypeKind.Interface, i1.TypeKind); 113031Assert.Equal(TypeKind.Struct, compilation7.GetTypeByMetadataName("A").TypeKind); 113032Assert.Equal(TypeKind.Enum, compilation7.GetTypeByMetadataName("B").TypeKind); 113033Assert.Equal(TypeKind.Class, compilation7.GetTypeByMetadataName("C").TypeKind); 113034Assert.Equal(TypeKind.Delegate, compilation7.GetTypeByMetadataName("D").TypeKind); 113035Assert.Equal(TypeKind.Interface, compilation7.GetTypeByMetadataName("I1").TypeKind);
Semantics\OverloadResolutionTests.cs (2)
978Assert.Equal(TypeKind.Error, type.TypeKind); 984Assert.Equal(TypeKind.Error, ((NamedTypeSymbol)type).TypeArguments()[0].TypeKind);
Semantics\PrimaryConstructorTests.cs (7)
402if (c.TypeKind == TypeKind.Struct) 488Assert.Equal(c.TypeKind != TypeKind.Struct ? 1 : 2, c.InstanceConstructors.Length); 497if (c.TypeKind == TypeKind.Struct) 716switch (c.TypeKind) 755switch (c.TypeKind) 791switch (c.TypeKind) 823switch (c.TypeKind)
Semantics\RecordStructTests.cs (2)
394Assert.Equal(TypeKind.Struct, point.TypeKind); 484Assert.Equal(TypeKind.Struct, point.TypeKind);
Semantics\RecordTests.cs (1)
119Assert.Equal(TypeKind.Class, point.TypeKind);
Semantics\ScriptSemanticsTests.cs (7)
454Assert.Equal(TypeKind.Class, members[0].TypeKind); 459Assert.Equal(TypeKind.Class, members[0].TypeKind); 463Assert.Equal(TypeKind.Interface, members[0].TypeKind); 467Assert.Equal(TypeKind.Struct, members[0].TypeKind); 471Assert.Equal(TypeKind.Enum, members[0].TypeKind); 475Assert.Equal(TypeKind.Delegate, members[0].TypeKind); 602Assert.NotEqual(TypeKind.Submission, type.TypeKind);
Semantics\UnsafeTests.cs (1)
6021Assert.Equal(TypeKind.Pointer, pointerType.TypeKind);
Semantics\UseSiteErrorTests.cs (35)
2299Assert.Equal(TypeKind.Struct, compilation1.GetTypeByMetadataName("A").TypeKind); 2300Assert.Equal(TypeKind.Enum, compilation1.GetTypeByMetadataName("B").TypeKind); 2301Assert.Equal(TypeKind.Class, compilation1.GetTypeByMetadataName("C").TypeKind); 2302Assert.Equal(TypeKind.Delegate, compilation1.GetTypeByMetadataName("D").TypeKind); 2303Assert.Equal(TypeKind.Interface, compilation1.GetTypeByMetadataName("I1").TypeKind); 2317Assert.Equal(TypeKind.Struct, compilation2.GetTypeByMetadataName("A").TypeKind); 2318Assert.Equal(TypeKind.Enum, compilation2.GetTypeByMetadataName("B").TypeKind); 2319Assert.Equal(TypeKind.Class, compilation2.GetTypeByMetadataName("C").TypeKind); 2320Assert.Equal(TypeKind.Delegate, compilation2.GetTypeByMetadataName("D").TypeKind); 2321Assert.Equal(TypeKind.Interface, compilation2.GetTypeByMetadataName("I1").TypeKind); 2328Assert.Equal(TypeKind.Struct, compilation3.GetTypeByMetadataName("A").TypeKind); 2329Assert.Equal(TypeKind.Enum, compilation3.GetTypeByMetadataName("B").TypeKind); 2330Assert.Equal(TypeKind.Class, compilation3.GetTypeByMetadataName("C").TypeKind); 2331Assert.Equal(TypeKind.Delegate, compilation3.GetTypeByMetadataName("D").TypeKind); 2332Assert.Equal(TypeKind.Interface, compilation3.GetTypeByMetadataName("I1").TypeKind); 2353Assert.Equal(TypeKind.Class, a.TypeKind); 2355Assert.Equal(TypeKind.Class, b.TypeKind); 2357Assert.Equal(TypeKind.Class, c.TypeKind); 2359Assert.Equal(TypeKind.Class, d.TypeKind); 2361Assert.Equal(TypeKind.Interface, i1.TypeKind); 2373Assert.Equal(TypeKind.Struct, compilation5.GetTypeByMetadataName("A").TypeKind); 2374Assert.Equal(TypeKind.Enum, compilation5.GetTypeByMetadataName("B").TypeKind); 2375Assert.Equal(TypeKind.Class, compilation5.GetTypeByMetadataName("C").TypeKind); 2376Assert.Equal(TypeKind.Delegate, compilation5.GetTypeByMetadataName("D").TypeKind); 2377Assert.Equal(TypeKind.Interface, compilation5.GetTypeByMetadataName("I1").TypeKind); 2398Assert.Equal(TypeKind.Class, a.TypeKind); 2400Assert.Equal(TypeKind.Class, b.TypeKind); 2402Assert.Equal(TypeKind.Class, c.TypeKind); 2404Assert.Equal(TypeKind.Class, d.TypeKind); 2406Assert.Equal(TypeKind.Interface, i1.TypeKind); 2414Assert.Equal(TypeKind.Struct, compilation7.GetTypeByMetadataName("A").TypeKind); 2415Assert.Equal(TypeKind.Enum, compilation7.GetTypeByMetadataName("B").TypeKind); 2416Assert.Equal(TypeKind.Class, compilation7.GetTypeByMetadataName("C").TypeKind); 2417Assert.Equal(TypeKind.Delegate, compilation7.GetTypeByMetadataName("D").TypeKind); 2418Assert.Equal(TypeKind.Interface, compilation7.GetTypeByMetadataName("I1").TypeKind);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (200)
DocumentationComments\CrefTests.cs (5)
1602.Single(method => method.Parameters.Single().Type.TypeKind == TypeKind.TypeParameter); 1735Single(method => method.Parameters.Single().Type.TypeKind == TypeKind.TypeParameter); 1739Assert.Equal(TypeKind.TypeParameter, actualSymbol.GetParameterTypes().Single().Type.TypeKind); 1761Single(method => method.Parameters.Single().Type.TypeKind == TypeKind.TypeParameter); 1765Assert.Equal(TypeKind.TypeParameter, actualSymbol.GetParameterTypes().Single().Type.TypeKind);
Symbols\AssemblyAndNamespaceTests.cs (2)
382Assert.Equal(TypeKind.Class, objectType.TypeKind); 434Assert.Equal(TypeKind.Class, taskType.TypeKind);
Symbols\CompilationCreationTests.cs (3)
2459Assert.Equal(TypeKind.Class, type3.TypeKind); 2460Assert.Equal(TypeKind.Interface, asm5[1].GlobalNamespace.GetTypeMembers("I1").Single().TypeKind); 2607return current is TypeSymbol type && type.TypeKind == kind;
Symbols\CorLibrary\CorTypes.cs (7)
37Assert.Equal(TypeKind.Error, t.TypeKind); 46Assert.Equal(TypeKind.Error, p.Type.TypeKind); 69Assert.Equal(TypeKind.Error, t.TypeKind); 73Assert.NotEqual(TypeKind.Error, t.TypeKind); 130Assert.NotEqual(TypeKind.Error, t.TypeKind); 134Assert.Equal(TypeKind.Error, t.TypeKind); 170Assert.Equal(TypeKind.Error, t.TypeKind);
Symbols\ExtensionMethodTests.cs (1)
55Assert.Equal(TypeKind.TypeParameter, parameter.Type.TypeKind);
Symbols\GenericConstraintTests.cs (1)
4935if (t.TypeKind == TypeKind.TypeParameter)
Symbols\Metadata\MetadataTypeTests.cs (4)
88Assert.Equal(TypeKind.Class, class1.TypeKind); 138Assert.Equal(TypeKind.Class, type1.TypeKind); 186Assert.Equal(TypeKind.Interface, type1.TypeKind); 236Assert.Equal(TypeKind.Struct, type1.TypeKind);
Symbols\Metadata\PE\LoadCustomModifiers.cs (1)
167Assert.Equal(TypeKind.Array, propertyType.TypeKind);
Symbols\Metadata\PE\LoadingEvents.cs (13)
197Assert.Equal(TypeKind.Interface, @interface.TypeKind); 202Assert.Equal(TypeKind.Class, @class.TypeKind); 224Assert.Equal(TypeKind.Interface, @interface.TypeKind); 229Assert.Equal(TypeKind.Class, @class.TypeKind); 256Assert.Equal(TypeKind.Interface, @interface.TypeKind); 261Assert.Equal(TypeKind.Class, @class.TypeKind); 292Assert.Equal(TypeKind.Interface, defInterface.TypeKind); 297Assert.Equal(TypeKind.Interface, defInterface.TypeKind); 301Assert.Equal(TypeKind.Class, @class.TypeKind); 333Assert.Equal(TypeKind.Interface, outerInterface.TypeKind); 339Assert.Equal(TypeKind.Class, outerClass.TypeKind); 343Assert.Equal(TypeKind.Interface, innerInterface.TypeKind); 365Assert.Equal(TypeKind.Class, innerClass.TypeKind);
Symbols\Metadata\PE\LoadingMethods.cs (28)
377Assert.Equal(TypeKind.Struct, byrefReturnMethod.ReturnType.TypeKind); 389Assert.Equal(TypeKind.Interface, @interface.TypeKind); 394Assert.Equal(TypeKind.Class, @class.TypeKind); 413Assert.Equal(TypeKind.Interface, interface1.TypeKind); 418Assert.Equal(TypeKind.Interface, interface2.TypeKind); 423Assert.Equal(TypeKind.Class, @class.TypeKind); 449Assert.Equal(TypeKind.Interface, @interface.TypeKind); 455Assert.Equal(TypeKind.Class, @class.TypeKind); 485Assert.Equal(TypeKind.Interface, @interface.TypeKind); 491Assert.Equal(TypeKind.Class, @class.TypeKind); 517Assert.Equal(TypeKind.Interface, cyclicInterface.TypeKind); 520Assert.Equal(TypeKind.Interface, implementedInterface.TypeKind); 525Assert.Equal(TypeKind.Class, @class.TypeKind); 545Assert.Equal(TypeKind.Interface, cyclicInterface.TypeKind); 548Assert.Equal(TypeKind.Class, @class.TypeKind); 576Assert.Equal(TypeKind.Interface, defInterface.TypeKind); 581Assert.Equal(TypeKind.Interface, defInterface.TypeKind); 585Assert.Equal(TypeKind.Class, @class.TypeKind); 612Assert.Equal(TypeKind.Class, baseClass.TypeKind); 615Assert.Equal(TypeKind.Class, derivedClass.TypeKind); 637Assert.Equal(TypeKind.Interface, @interface.TypeKind); 640Assert.Equal(TypeKind.Class, @class.TypeKind); 670Assert.Equal(TypeKind.Interface, @interface.TypeKind); 673Assert.Equal(TypeKind.Class, @class.TypeKind); 704Assert.Equal(TypeKind.Interface, outerInterface.TypeKind); 710Assert.Equal(TypeKind.Class, outerClass.TypeKind); 714Assert.Equal(TypeKind.Interface, innerInterface.TypeKind); 736Assert.Equal(TypeKind.Class, innerClass.TypeKind);
Symbols\Metadata\PE\LoadingProperties.cs (15)
32Assert.Equal(TypeKind.Interface, @interface.TypeKind); 37Assert.Equal(TypeKind.Class, @class.TypeKind); 59Assert.Equal(TypeKind.Interface, @interface.TypeKind); 64Assert.Equal(TypeKind.Class, @class.TypeKind); 91Assert.Equal(TypeKind.Interface, @interface.TypeKind); 96Assert.Equal(TypeKind.Class, @class.TypeKind); 127Assert.Equal(TypeKind.Interface, defInterface.TypeKind); 132Assert.Equal(TypeKind.Interface, defInterface.TypeKind); 136Assert.Equal(TypeKind.Class, @class.TypeKind); 168Assert.Equal(TypeKind.Interface, outerInterface.TypeKind); 174Assert.Equal(TypeKind.Class, outerClass.TypeKind); 178Assert.Equal(TypeKind.Interface, innerInterface.TypeKind); 200Assert.Equal(TypeKind.Class, innerClass.TypeKind); 230Assert.Equal(TypeKind.Interface, @interface.TypeKind); 254Assert.Equal(TypeKind.Class, @class.TypeKind);
Symbols\Metadata\PE\NoPia.cs (4)
268Assert.Equal(TypeKind.Interface, param[0].Type.TypeKind); 269Assert.Equal(TypeKind.Interface, param[1].Type.TypeKind); 602Assert.Equal(TypeKind.Interface, param[0].Type.TypeKind); 603Assert.Equal(TypeKind.Interface, param[1].Type.TypeKind);
Symbols\Metadata\PE\NoPiaInstantiationOfGenericClassAndStruct.cs (2)
143if (m.ReturnType.TypeKind != TypeKind.Struct) 448if (m.ReturnType.TypeKind != TypeKind.Struct)
Symbols\Metadata\PE\TypeForwarders.cs (3)
106Assert.NotEqual(TypeKind.Error, funcType.TypeKind); 1492Assert.NotEqual(TypeKind.Error, type.TypeKind); 1761Assert.NotEqual(TypeKind.Error, type.TypeKind);
Symbols\Metadata\PE\TypeKindTests.cs (6)
40Assert.Equal(TypeKind.Class, obj.TypeKind); 46Assert.Equal(TypeKind.Class, @enum.TypeKind); 52Assert.Equal(TypeKind.Struct, int32.TypeKind); 58Assert.Equal(TypeKind.Delegate, func.TypeKind); 68Assert.Equal(TypeKind.Interface, ienumerable.TypeKind); 75Assert.Equal(TypeKind.Enum, typeCode.TypeKind);
Symbols\MissingSpecialMember.cs (11)
158Assert.Equal(TypeKind.Error, specialType.TypeKind); 163Assert.Equal(TypeKind.Class, lookupType.TypeKind); 236Assert.Equal(TypeKind.Struct, specialType.TypeKind); 240Assert.Equal(TypeKind.Struct, lookupType.TypeKind); 272Assert.Equal(TypeKind.Class, wellKnownType.TypeKind); 276Assert.Equal(TypeKind.Class, lookupType.TypeKind); 305Assert.Equal(TypeKind.Error, wellKnownType.TypeKind); 309Assert.Equal(TypeKind.Enum, lookupType.TypeKind); 382Assert.Equal(TypeKind.Class, wellKnownType.TypeKind); 385Assert.Equal(TypeKind.Class, lookupType.TypeKind); 499Assert.Equal(TypeKind.Class, wellKnown.TypeKind);
Symbols\MockSymbolTests.cs (1)
140builder.AppendFormat("{0} {1}", (sym as NamedTypeSymbol).TypeKind.ToString().ToLower(), sym.Name);
Symbols\Retargeting\NoPia.cs (6)
570Assert.Equal(TypeKind.Interface, param[0].Type.TypeKind); 571Assert.Equal(TypeKind.Interface, param[1].Type.TypeKind); 871Assert.Equal(TypeKind.Interface, param[0].Type.TypeKind); 872Assert.Equal(TypeKind.Interface, param[1].Type.TypeKind); 1175Assert.Equal(TypeKind.Interface, param[0].Type.TypeKind); 1176Assert.Equal(TypeKind.Interface, param[1].Type.TypeKind);
Symbols\Retargeting\RetargetingTests.cs (18)
345Assert.Equal(TypeKind.Error, sourceType.BaseType().TypeKind); 347Assert.Equal(TypeKind.Error, sourceType.EnumUnderlyingType.TypeKind); 354Assert.Equal(TypeKind.Error, retargetingType.BaseType().TypeKind); 356Assert.Equal(TypeKind.Error, retargetingType.EnumUnderlyingType.TypeKind); 382Assert.Equal(TypeKind.Error, sourceType.BaseType().TypeKind); 384Assert.Equal(TypeKind.Error, sourceType.EnumUnderlyingType.TypeKind); 391Assert.Equal(TypeKind.Error, retargetingType.BaseType().TypeKind); 393Assert.Equal(TypeKind.Error, retargetingType.EnumUnderlyingType.TypeKind); 442Assert.Equal(TypeKind.Error, sourceType.BaseType().TypeKind); 448Assert.Equal(TypeKind.Error, retargetingType.BaseType().TypeKind); 523Assert.Equal(TypeKind.Error, sourceType.Interfaces().Single().TypeKind); 525Assert.Equal(TypeKind.Error, sourceType.BaseType().TypeKind); 530Assert.Equal(TypeKind.Error, retargetingType.Interfaces().Single().TypeKind); 532Assert.Equal(TypeKind.Error, retargetingType.BaseType().TypeKind); 581Assert.Equal(TypeKind.Error, sourceType.Interfaces().Single().TypeKind); 587Assert.Equal(TypeKind.Error, retargetingType.Interfaces().Single().TypeKind); 650Assert.Equal(TypeKind.Error, sourceTypeParameterConstraint.TypeKind); 657Assert.Equal(TypeKind.Error, retargetingTypeParameterConstraint.TypeKind);
Symbols\Source\BaseClassTests.cs (1)
1898Assert.Equal(TypeKind.Class, derived.TypeKind);
Symbols\Source\CustomModifierCopyTests.cs (4)
779Assert.Equal(TypeKind.Dynamic, classMethod.ParameterTypesWithAnnotations.Single().Type.TypeKind); 822Assert.Equal(TypeKind.Dynamic, interfaceMethod.ParameterTypesWithAnnotations.Single().Type.TypeKind); 1259Assert.Equal(TypeKind.Dynamic, interfaceMethod.ReturnType.TypeKind); 1300Assert.Equal(TypeKind.Dynamic, classMethod.ReturnType.TypeKind);
Symbols\Source\DelegateTests.cs (4)
110Assert.Equal(TypeKind.Delegate, fieldType.TypeKind); 130Assert.Equal(TypeKind.Delegate, v.TypeKind); 162Assert.Equal(TypeKind.Interface, beginInvoke.ReturnType.TypeKind); 208Assert.Equal(TypeKind.Delegate, d.TypeKind);
Symbols\Source\EnumTests.cs (1)
759Assert.Equal(TypeKind.Enum, member.Type.TypeKind);
Symbols\Source\FieldTests.cs (6)
65Assert.Equal(TypeKind.Class, sym.Type.TypeKind); 92Assert.Equal(TypeKind.Class, f.Type.TypeKind); 180Assert.Equal(TypeKind.Struct, sym.Type.TypeKind); 209Assert.Equal(TypeKind.Class, sym.Type.TypeKind); 214Assert.Equal(TypeKind.Interface, sym.Type.TypeKind); 219Assert.Equal(TypeKind.Struct, sym.Type.TypeKind);
Symbols\Source\MethodTests.cs (11)
367Assert.Equal(TypeKind.Class, refP.TypeKind); 375Assert.Equal(TypeKind.Struct, outP.TypeKind); 406Assert.Equal(TypeKind.Struct, m.ReturnType.TypeKind); 1667Assert.Equal(TypeKind.Interface, @interface.TypeKind); 1672Assert.Equal(TypeKind.Class, @class.TypeKind); 1711Assert.Equal(TypeKind.Interface, @interface.TypeKind); 1716Assert.Equal(TypeKind.Class, @class.TypeKind); 1756Assert.Equal(TypeKind.Interface, @interface.TypeKind); 1762Assert.Equal(TypeKind.Class, @class.TypeKind); 1807Assert.Equal(TypeKind.Interface, @interface.TypeKind); 1812Assert.Equal(TypeKind.Class, @class.TypeKind);
Symbols\Source\PropertyTests.cs (7)
1750Assert.Equal(TypeKind.Interface, @interface.TypeKind); 1755Assert.Equal(TypeKind.Class, @class.TypeKind); 1784Assert.Equal(TypeKind.Interface, @interface.TypeKind); 1789Assert.Equal(TypeKind.Class, @class.TypeKind); 1822Assert.Equal(TypeKind.Interface, @interface.TypeKind); 1827Assert.Equal(TypeKind.Class, @class.TypeKind); 1957Assert.Equal(TypeKind.Class, @class.TypeKind);
Symbols\SymbolDistinguisherTests.cs (2)
318Assert.NotEqual(TypeKind.Error, validType.TypeKind); 319Assert.Equal(TypeKind.Error, errorType.TypeKind);
Symbols\SymbolErrorTests.cs (15)
1577Assert.Equal(TypeKind.Struct, (n as FieldSymbol).Type.TypeKind); 1688Assert.Equal(TypeKind.Error, classCInterface.TypeKind); 1693Assert.Equal(TypeKind.Error, structSField.Type.TypeKind); 2334Assert.Equal(TypeKind.Error, baseType.TypeKind); 2340Assert.Equal(TypeKind.Error, mem1.Type.TypeKind); 2346Assert.Equal(TypeKind.Error, param.Type.TypeKind); 2576Assert.Equal(TypeKind.Error, baseType.TypeKind); 2581Assert.Equal(TypeKind.Error, baseType.TypeKind); 2586Assert.Equal(TypeKind.Error, baseType.TypeKind); 3361Assert.Equal(TypeKind.Error, ptype.Type.TypeKind); 3367Assert.Equal(TypeKind.Error, base1.TypeKind); 3372Assert.Equal(TypeKind.Error, mem2.Type.TypeKind); 3375Assert.Equal(TypeKind.Error, mem3.ReturnType.TypeKind); 3601Assert.Equal(TypeKind.Error, base1.TypeKind); 19284Assert.Equal(TypeKind.Class, Base.TypeKind);
Symbols\TypeTests.cs (18)
281Assert.Equal(TypeKind.Struct, type3.TypeKind); 288Assert.Equal(TypeKind.Interface, type4.TypeKind); 299Assert.Equal(TypeKind.Interface, type3.TypeKind); 307Assert.Equal(TypeKind.Class, type4.TypeKind); 473Assert.Equal(TypeKind.Array, elemType1.Type.TypeKind); 487Assert.Equal(TypeKind.Array, elemType2.TypeKind); 497Assert.Equal(TypeKind.Array, retType.TypeKind); 518Assert.Equal(TypeKind.Array, p3.Type.TypeKind); 855Assert.Equal(TypeKind.Interface, igoo.TypeKind); 868Assert.Equal(TypeKind.Class, classA.TypeKind); 880Assert.Equal(TypeKind.Struct, structS.TypeKind); 907Assert.Equal(TypeKind.Class, varA.Type.TypeKind); 1310Assert.Equal(TypeKind.Class, baseType.TypeKind); 1311Assert.Equal(TypeKind.Interface, interface1.TypeKind); 1312Assert.Equal(TypeKind.Interface, interface2.TypeKind); 1330Assert.Equal(TypeKind.Error, derived.BaseType().TypeKind); 1334Assert.Equal(TypeKind.Error, i.TypeKind); 1367Assert.Equal(TypeKind.Error, typeSymbol.TypeKind);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (8)
Parsing\ReadOnlyStructs.cs (8)
48Assert.Equal(TypeKind.Struct, s1.TypeKind); 54Assert.Equal(TypeKind.Struct, s2.TypeKind); 60Assert.Equal(TypeKind.Struct, s3.TypeKind); 122Assert.Equal(TypeKind.Class, s1.TypeKind); 128Assert.Equal(TypeKind.Delegate, s2.TypeKind); 134Assert.Equal(TypeKind.Interface, s3.TypeKind); 157Assert.Equal(TypeKind.Struct, s1.TypeKind); 163Assert.Equal(TypeKind.Struct, s2.TypeKind);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (8)
Extensions.cs (5)
433if ((typeSym.TypeKind == TypeKind.Interface || typeSym.TypeKind == TypeKind.Class || typeSym.TypeKind == TypeKind.Struct || typeSym.TypeKind == TypeKind.Delegate)) 475else if (typeSym.TypeKind == TypeKind.Array)
UsesIsNullableVisitor.cs (3)
168switch (type.TypeKind) 181switch (type.TypeKind) 207throw ExceptionUtilities.UnexpectedValue(type.TypeKind);
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (1)
Metadata\WinMdEventTests.cs (1)
3347Assert.Equal(TypeKind.Error, fieldType.TypeKind);