301 references to TypedConstantKind
Aspire.Hosting.Integration.Analyzers (1)
AspireExportAnalyzer.cs (1)
727if (typesArg.Kind != TypedConstantKind.Array)
ILLink.RoslynAnalyzer (1)
DataFlow\LocalDataFlowVisitor.cs (1)
883if (attributeArgument.Kind != TypedConstantKind.Primitive)
Microsoft.AspNetCore.App.Analyzers (1)
RouteEmbeddedLanguage\Infrastructure\RouteStringSyntaxDetector.cs (1)
358if (argument.Kind != TypedConstantKind.Primitive || argument.Value is not string argString)
Microsoft.AspNetCore.Mvc.Analyzers (2)
TopLevelParameterNameAnalyzer.cs (2)
164namedArgumentValue.Kind == TypedConstantKind.Primitive && 187namedArgumentValue.Kind == TypedConstantKind.Type)
Microsoft.AspNetCore.Mvc.Api.Analyzers (9)
ActualApiResponseMetadataFactory.cs (1)
250attribute.ConstructorArguments[0].Kind == TypedConstantKind.Primitive &&
SymbolApiConventionMatcher.cs (2)
66attribute.ConstructorArguments[0].Kind != TypedConstantKind.Enum) 88attribute.ConstructorArguments[0].Kind != TypedConstantKind.Enum)
SymbolApiResponseMetadataProvider.cs (6)
55errorTypeAttribute.ConstructorArguments[0].Kind == TypedConstantKind.Type && 98if (attribute.ConstructorArguments[0].Kind != TypedConstantKind.Type || 104if (attribute.ConstructorArguments[1].Kind != TypedConstantKind.Primitive || 174attribute.ConstructorArguments[0].Kind != TypedConstantKind.Type || 194namedArgumentValue.Kind == TypedConstantKind.Primitive && 220if (argument.Kind == TypedConstantKind.Primitive && argument.Value is int statusCode)
Microsoft.CodeAnalysis (31)
MetadataReader\MetadataDecoder.cs (11)
1528TypedConstantKind kind = PEModule.CrackStringInAttributeValue(out s, ref argReader) ? 1529TypedConstantKind.Primitive : 1530TypedConstantKind.Error; 1540return CreateTypedConstant(type, TypedConstantKind.Type, serializedType); 1547private static TypedConstantKind GetPrimitiveOrEnumTypedConstantKind(TypeSymbol type) 1549return (type.TypeKind == TypeKind.Enum) ? TypedConstantKind.Enum : TypedConstantKind.Primitive; 2146return new TypedConstant(type, TypedConstantKind.Error, null); 2153private static TypedConstant CreateTypedConstant(TypeSymbol type, TypedConstantKind kind, object value) 2157return new TypedConstant(type, TypedConstantKind.Error, null); 2163private static TypedConstant CreateTypedConstant(TypeSymbol type, TypedConstantKind kind, bool value)
Symbols\Attributes\CommonAttributeDataComparer.cs (2)
120if (x.Kind == TypedConstantKind.Type && y.Kind == TypedConstantKind.Type)
Symbols\Attributes\UnmanagedCallersOnlyAttributeData.cs (2)
37&& value.Kind == TypedConstantKind.Array 38&& (value.Values.IsDefaultOrEmpty || value.Values.All(v => v.Kind == TypedConstantKind.Type));
Symbols\TypedConstant.cs (16)
19private readonly TypedConstantKind _kind; 23internal TypedConstant(ITypeSymbolInternal? type, TypedConstantKind kind, object? value) 25Debug.Assert(kind == TypedConstantKind.Array || !(value is ImmutableArray<TypedConstant>)); 27Debug.Assert(type is object || kind == TypedConstantKind.Error); 35: this(type, TypedConstantKind.Array, value: array.IsDefault ? null : (object)array) 42public TypedConstantKind Kind 97if (Kind == TypedConstantKind.Array) 115if (Kind != TypedConstantKind.Array) 137if (_kind == TypedConstantKind.Error) 158internal static TypedConstantKind GetTypedConstantKind(ITypeSymbolInternal type, Compilation compilation) 178return TypedConstantKind.Primitive; 183return TypedConstantKind.Array; 185return TypedConstantKind.Enum; 187return TypedConstantKind.Error; 193return TypedConstantKind.Type; 196return TypedConstantKind.Error;
Microsoft.CodeAnalysis.Analyzers (4)
MetaAnalyzers\CompilerExtensionStrictApiAnalyzer.cs (2)
184if (arg.Kind == TypedConstantKind.Array) 203if (argument is { Kind: TypedConstantKind.Primitive, Type.SpecialType: SpecialType.System_String })
MetaAnalyzers\DiagnosticAnalyzerAttributeAnalyzer.cs (2)
110if (arg.Kind == TypedConstantKind.Array) 149if (argument.Kind == TypedConstantKind.Primitive &&
Microsoft.CodeAnalysis.CodeStyle (4)
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
850attribute.ConstructorArguments is [_, { Kind: TypedConstantKind.Primitive, Value: string checkId }, ..]) 861Kind: TypedConstantKind.Primitive,
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (2)
902if (attribute.ConstructorArguments is [{ Kind: TypedConstantKind.Primitive, Type.SpecialType: SpecialType.System_String, Value: string value }]) 913Value: { Kind: TypedConstantKind.Primitive, Type.SpecialType: SpecialType.System_String, Value: string namedValue },
Microsoft.CodeAnalysis.CSharp (119)
Binder\Binder_Attributes.cs (22)
731if (reorderedArgument.Kind == TypedConstantKind.Error) 735else if (reorderedArgument.Kind == TypedConstantKind.Array && 749Debug.Assert(hasErrors || reorderedArguments.All(arg => arg.Kind != TypedConstantKind.Error)); 848var typedConstantKind = node.Type.GetAttributeParameterTypedConstantKind(_binder.Compilation); 850return VisitExpression(node, typedConstantKind, diagnostics, ref attrHasErrors, curArgumentHasErrors || typedConstantKind == TypedConstantKind.Error); 853private TypedConstant VisitExpression(BoundExpression node, TypedConstantKind typedConstantKind, BindingDiagnosticBag diagnostics, ref bool attrHasErrors, bool curArgumentHasErrors) 862typedConstantKind = TypedConstantKind.Error; 879return CreateTypedConstant(node, TypedConstantKind.Error, diagnostics, ref attrHasErrors, curArgumentHasErrors); 885var typedConstantKind = type.GetAttributeParameterTypedConstantKind(_binder.Compilation); 901return new TypedConstant(spread.Expression.Type, TypedConstantKind.Error, value: null); 935var typedConstantKind = operandType.GetAttributeParameterTypedConstantKind(_binder.Compilation); 940return CreateTypedConstant(node, TypedConstantKind.Error, diagnostics, ref attrHasErrors, curArgumentHasErrors); 976return CreateTypedConstant(node, TypedConstantKind.Type, diagnostics, ref attrHasErrors, curArgumentHasErrors, simpleValue: node.SourceType.Type); 986return CreateTypedConstant(node, TypedConstantKind.Error, diagnostics, ref attrHasErrors, curArgumentHasErrors); 990var typedConstantKind = type.GetAttributeParameterTypedConstantKind(_binder.Compilation); 1008initializer = ImmutableArray.Create(CreateTypedConstant(node, TypedConstantKind.Error, diagnostics, ref attrHasErrors, curArgumentHasErrors)); 1020private static TypedConstant CreateTypedConstant(BoundExpression node, TypedConstantKind typedConstantKind, BindingDiagnosticBag diagnostics, ref bool attrHasErrors, bool curArgumentHasErrors, 1026if (typedConstantKind != TypedConstantKind.Error && type.ContainsTypeParameter()) 1047typedConstantKind = TypedConstantKind.Error; 1050if (typedConstantKind == TypedConstantKind.Error) 1058return new TypedConstant(type, TypedConstantKind.Error, null); 1060else if (typedConstantKind == TypedConstantKind.Array)
Compiler\ClsComplianceChecker.cs (1)
286paramType.Type.GetAttributeParameterTypedConstantKind(_compilation) == TypedConstantKind.Error)
Emitter\Model\AttributeDataAdapter.cs (3)
30Debug.Assert(argument.Kind != TypedConstantKind.Error); 108case TypedConstantKind.Array: 111case TypedConstantKind.Type:
Emitter\Model\PEAssemblyBuilder.cs (1)
381[new TypedConstant(Compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, markerName)],
Emitter\Model\PEModuleBuilder.cs (5)
1743var value = flagsBuilder.SelectAsArray((flag, byteType) => new TypedConstant(byteType, TypedConstantKind.Primitive, flag), byteType); 1765ImmutableArray.Create(new TypedConstant(byteType, TypedConstantKind.Primitive, nullableValue))); 1785ImmutableArray.Create(new TypedConstant(Compilation.GetSpecialType(SpecialType.System_Byte), TypedConstantKind.Primitive, value))); 1827var transformFlags = builder.SelectAsArray((flag, constantType) => new TypedConstant(constantType, TypedConstantKind.Primitive, flag), booleanType); 1927[new TypedConstant(Compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, markerName)]);
Emitter\NoPia\EmbeddedType.cs (2)
279ImmutableArray.Create(new TypedConstant(stringType, TypedConstantKind.Primitive, guidString), 280new TypedConstant(stringType, TypedConstantKind.Primitive,
Emitter\NoPia\EmbeddedTypesManager.cs (1)
189ImmutableArray.Create(new TypedConstant(ctor.Parameters[0].Type, TypedConstantKind.Type, ctor.ContainingAssembly.GetSpecialType(SpecialType.System_Object))),
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.FieldSymbol.cs (1)
157new TypedConstant(manager.System_Diagnostics_DebuggerBrowsableState, TypedConstantKind.Enum, DebuggerBrowsableState.Never))));
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TemplateSymbol.cs (2)
224arguments: ImmutableArray.Create(new TypedConstant(Manager.System_String, TypedConstantKind.Primitive, displayString)), 227new TypedConstant(Manager.System_String, TypedConstantKind.Primitive, "<Anonymous Type>"))));
Symbols\Attributes\AttributeData.cs (8)
259if (value.Kind != TypedConstantKind.Array) 310if (value.Kind != TypedConstantKind.Array) 575Debug.Assert(ctorArgument.Kind == TypedConstantKind.Enum || ctorArgument.Kind == TypedConstantKind.Primitive); 577ClassInterfaceType interfaceType = ctorArgument.Kind == TypedConstantKind.Enum ? 600Debug.Assert(ctorArgument.Kind == TypedConstantKind.Enum || ctorArgument.Kind == TypedConstantKind.Primitive); 602ComInterfaceType interfaceType = ctorArgument.Kind == TypedConstantKind.Enum ?
Symbols\Compilation_WellKnownMembers.cs (13)
477new TypedConstant(systemByte, TypedConstantKind.Primitive, scale), 478new TypedConstant(systemByte, TypedConstantKind.Primitive, (byte)(isNegative ? 128 : 0)), 479new TypedConstant(systemUnit32, TypedConstantKind.Primitive, high), 480new TypedConstant(systemUnit32, TypedConstantKind.Primitive, mid), 481new TypedConstant(systemUnit32, TypedConstantKind.Primitive, low) 487var ticks = new TypedConstant(GetSpecialType(SpecialType.System_Int64), TypedConstantKind.Primitive, value.Ticks); 504TypedConstantKind.Enum, 805var typedConstantDebugMode = new TypedConstant(debuggingModesType, TypedConstantKind.Enum, constantVal); 858new TypedConstant(attributeTargetsType, TypedConstantKind.Enum, targets)); 860new KeyValuePair<WellKnownMember, TypedConstant>(WellKnownMember.System_AttributeUsageAttribute__AllowMultiple, new TypedConstant(boolType, TypedConstantKind.Primitive, allowMultiple)), 861new KeyValuePair<WellKnownMember, TypedConstant>(WellKnownMember.System_AttributeUsageAttribute__Inherited, new TypedConstant(boolType, TypedConstantKind.Primitive, inherited))); 891new TypedConstant(constantType, TypedConstantKind.Primitive, name), stringType); 938var result = flagsBuilder.SelectAsArray((flag, constantType) => new TypedConstant(constantType, TypedConstantKind.Primitive, flag), booleanType);
Symbols\MethodSymbol.cs (5)
1029Debug.Assert(callConvTypedConstant.Kind == TypedConstantKind.Type); 1298new TypedConstant(declaringCompilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, PEModule.RequiredMembersMarker), // message 1299new TypedConstant(declaringCompilation.GetSpecialType(SpecialType.System_Boolean), TypedConstantKind.Primitive, true)) // error 1304ImmutableArray.Create(new TypedConstant(declaringCompilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, nameof(CompilerFeatureRequiredFeatures.RequiredMembers))) 1318[new TypedConstant(declaringCompilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, nameof(CompilerFeatureRequiredFeatures.ClosedClasses))]));
Symbols\Retargeting\RetargetingSymbolTranslator.cs (2)
1228if (oldConstant.Kind == TypedConstantKind.Array) 1244if ((oldConstant.Kind == TypedConstantKind.Type) && (oldConstantValue != null))
Symbols\Source\SourceAssemblySymbol.cs (6)
1829var typedConstantRequestMinimum = new TypedConstant(securityActionType, TypedConstantKind.Enum, constantValue); 1835var typedConstantTrue = new TypedConstant(boolType, TypedConstantKind.Primitive, value: true); 1975var typedConstantNoStringInterning = new TypedConstant(int32Type, TypedConstantKind.Primitive, Cci.Constants.CompilationRelaxations_NoStringInterning); 1994var typedConstantTrue = new TypedConstant(boolType, TypedConstantKind.Primitive, value: true); 2028var typedConstant = new TypedConstant(stringType, TypedConstantKind.Primitive, _compilation.Options.CryptoKeyContainer); 2038var typedConstant = new TypedConstant(stringType, TypedConstantKind.Primitive, _compilation.Options.CryptoKeyFile);
Symbols\Source\SourceComplexParameterSymbol.cs (2)
1004SpecialType specialType = arg.Kind == TypedConstantKind.Enum ? 1013if (arg.Kind != TypedConstantKind.Array && arg.ValueInternal == null)
Symbols\Source\SourceFixedFieldSymbol.cs (2)
48var item1 = new TypedConstant(systemType, TypedConstantKind.Type, ((PointerTypeSymbol)this.Type).PointedAtType); 49var item2 = new TypedConstant(intType, TypedConstantKind.Primitive, this.FixedSize);
Symbols\Source\SourceMemberContainerSymbol.cs (1)
1578&& attr.CommonConstructorArguments[0].Kind == TypedConstantKind.Type)
Symbols\Source\SourceMethodSymbol.cs (2)
199TypedConstantKind.Type, stateMachineType.GetUnboundGenericTypeOrSelf()); 292ImmutableArray.Create(new TypedConstant(compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, nameof(CompilerFeatureRequiredFeatures.UserDefinedCompoundAssignmentOperators)))
Symbols\Source\SourceMethodSymbolWithAttributes.cs (2)
1012{ Kind: not TypedConstantKind.Array, Value: int lineNumberOneBased }, 1013{ Kind: not TypedConstantKind.Array, Value: int characterNumberOneBased }])
Symbols\Source\SourceModuleSymbol.cs (3)
680var version = ImmutableArray.Create(new TypedConstant(compilation.GetSpecialType(SpecialType.System_Int32), TypedConstantKind.Primitive, 11)); 686var version = ImmutableArray.Create(new TypedConstant(compilation.GetSpecialType(SpecialType.System_Int32), TypedConstantKind.Primitive, CSharpCompilationOptions.UpdatedMemorySafetyRulesVersion)); 693new TypedConstant(compilation.GetSpecialType(SpecialType.System_Boolean), TypedConstantKind.Primitive, _assemblySymbol.InternalsAreVisible));
Symbols\Source\SourceNamedTypeSymbol.cs (7)
1040Debug.Assert(attributeData.CommonConstructorArguments[0].Kind == TypedConstantKind.Type); 1361Debug.Assert(argument.Kind == TypedConstantKind.Type); 1766new TypedConstant(compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, PEModule.ByRefLikeMarker), // message 1767new TypedConstant(compilation.GetSpecialType(SpecialType.System_Boolean), TypedConstantKind.Primitive, true)), // error=true 1772ImmutableArray.Create(new TypedConstant(compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, nameof(CompilerFeatureRequiredFeatures.RefStructs))), 1785var defaultMemberNameConstant = new TypedConstant(compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, defaultMemberName); 1828ImmutableArray.Create(new TypedConstant(compilation.GetWellKnownType(WellKnownType.System_Type), TypedConstantKind.Type, originalType)),
Symbols\Source\SourceNamedTypeSymbol_Extension.cs (5)
875if (argument.Kind == TypedConstantKind.Error) 890case TypedConstantKind.Primitive: 894case TypedConstantKind.Enum: 900case TypedConstantKind.Type: 907case TypedConstantKind.Array:
Symbols\Synthesized\SynthesizedInlineArrayTypeSymbol.cs (1)
213arguments: ImmutableArray.Create(new TypedConstant(compilation.GetSpecialType(SpecialType.System_Int32), TypedConstantKind.Primitive, _arrayLength)),
Symbols\TypedConstantExtensions.cs (6)
25if (constant.Kind == TypedConstantKind.Array) 30if (constant.Kind == TypedConstantKind.Type || constant.TypeInternal!.SpecialType == SpecialType.System_Object) 36if (constant.Kind == TypedConstantKind.Enum) 51Debug.Assert(constant.Kind == TypedConstantKind.Enum); 71Debug.Assert(constant.Kind == TypedConstantKind.Enum); 150Debug.Assert(constant.Kind == TypedConstantKind.Enum);
Symbols\TypeSymbolExtensions.cs (16)
258return GetAttributeParameterTypedConstantKind(type, compilation) != TypedConstantKind.Error; 267public static TypedConstantKind GetAttributeParameterTypedConstantKind(this TypeSymbol type, CSharpCompilation compilation) 279TypedConstantKind kind = TypedConstantKind.Error; 282return TypedConstantKind.Error; 290return TypedConstantKind.Error; 293kind = TypedConstantKind.Array; 303if (kind == TypedConstantKind.Error) 306kind = TypedConstantKind.Enum; 312var typedConstantKind = TypedConstant.GetTypedConstantKind(type, compilation); 315case TypedConstantKind.Array: 316case TypedConstantKind.Enum: 317case TypedConstantKind.Error: 318return TypedConstantKind.Error; 321if (kind == TypedConstantKind.Array || kind == TypedConstantKind.Enum)
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (2)
329{ Kind: TypedConstantKind.Type, Value: INamedTypeSymbol builderType }, 330{ Kind: TypedConstantKind.Primitive, Value: string methodName }
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (5)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (1)
103if (existingSyntax?.ArgumentList != null && constant is { Kind: not TypedConstantKind.Array, Value: string stringValue })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (4)
29case TypedConstantKind.Primitive: 30case TypedConstantKind.Enum: 33case TypedConstantKind.Type: 38case TypedConstantKind.Array:
Microsoft.CodeAnalysis.CSharp.Features (2)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (2)
329{ Kind: TypedConstantKind.Type, Value: INamedTypeSymbol builderType }, 330{ Kind: TypedConstantKind.Primitive, Value: string methodName }
Microsoft.CodeAnalysis.CSharp.Workspaces (5)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (1)
103if (existingSyntax?.ArgumentList != null && constant is { Kind: not TypedConstantKind.Array, Value: string stringValue })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (4)
29case TypedConstantKind.Primitive: 30case TypedConstantKind.Enum: 33case TypedConstantKind.Type: 38case TypedConstantKind.Array:
Microsoft.CodeAnalysis.Features (7)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (2)
6975TypedConstantKind.Array => x.Values.IsDefault || x.Values.SequenceEqual(y.Values, Instance), 6976TypedConstantKind.Type => TypesEquivalent((ITypeSymbol?)x.Value, (ITypeSymbol?)y.Value, exact: false),
EmbeddedLanguages\EmbeddedLanguageDetector.cs (1)
533if (argument.Kind != TypedConstantKind.Primitive || argument.Value is not string argString)
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
850attribute.ConstructorArguments is [_, { Kind: TypedConstantKind.Primitive, Value: string checkId }, ..]) 861Kind: TypedConstantKind.Primitive,
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (2)
902if (attribute.ConstructorArguments is [{ Kind: TypedConstantKind.Primitive, Type.SpecialType: SpecialType.System_String, Value: string value }]) 913Value: { Kind: TypedConstantKind.Primitive, Type.SpecialType: SpecialType.System_String, Value: string namedValue },
Microsoft.CodeAnalysis.Razor.Compiler (1)
Language\TagHelpers\Producers\ComponentTagHelperProducer.cs (1)
478if (arg.Kind == TypedConstantKind.Enum)
Microsoft.CodeAnalysis.VisualBasic (62)
Binding\Binder_Attributes.vb (2)
886If kind = TypedConstantKind.Array Then 896Return New TypedConstant(type, TypedConstantKind.Error, Nothing)
Emit\AttributeDataAdapter.vb (2)
71Case TypedConstantKind.Array 73Case TypedConstantKind.Type
Emit\NoPia\EmbeddedType.vb (2)
219ImmutableArray.Create(New TypedConstant(stringType, TypedConstantKind.Primitive, guidString), 220New TypedConstant(stringType, TypedConstantKind.Primitive, UnderlyingNamedType.AdaptedNamedTypeSymbol.ToDisplayString(SymbolDisplayFormat.QualifiedNameOnlyFormat))),
Emit\NoPia\EmbeddedTypesManager.vb (1)
133ImmutableArray.Create(New TypedConstant(ctor.Parameters(0).Type, TypedConstantKind.Type, ctor.ContainingAssembly.GetSpecialType(SpecialType.System_Object))),
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousDelegate_TemplateSymbol.vb (1)
181Dim value As New TypedConstant(Manager.System_String, TypedConstantKind.Primitive, "<generated method>")
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType_TemplateSymbol.vb (1)
184ImmutableArray.Create(New TypedConstant(Manager.System_String, TypedConstantKind.Primitive, builder.ToStringAndFree())))
Symbols\Attributes\AttributeData.vb (9)
438Debug.Assert(ctorArgument.Kind = TypedConstantKind.Enum OrElse ctorArgument.Kind = TypedConstantKind.Primitive) 440Dim interfaceType As ClassInterfaceType = If(ctorArgument.Kind = TypedConstantKind.Enum, 465Debug.Assert(ctorArgument.Kind = TypedConstantKind.Enum OrElse ctorArgument.Kind = TypedConstantKind.Primitive) 467interfaceType = If(ctorArgument.Kind = TypedConstantKind.Enum, 483Debug.Assert(ctorArgument.Kind = TypedConstantKind.Enum OrElse ctorArgument.Kind = TypedConstantKind.Primitive) 485Return If(ctorArgument.Kind = TypedConstantKind.Enum,
Symbols\Retargeting\RetargetingSymbolTranslator.vb (2)
726If oldConstant.Kind = TypedConstantKind.Array Then 738If (oldConstant.Kind = TypedConstantKind.Type) AndAlso (oldConstantValue IsNot Nothing) Then
Symbols\Source\SourceAssemblySymbol.vb (5)
1543Dim typedConstantNoStringInterning = New TypedConstant(int32Type, TypedConstantKind.Primitive, Cci.Constants.CompilationRelaxations_NoStringInterning) 1561Dim typedConstantTrue = New TypedConstant(boolType, TypedConstantKind.Primitive, True) 1599Dim typedConstantDebugMode = New TypedConstant(int32Type, TypedConstantKind.Enum, CInt(debuggingMode)) 1616Dim typedConstant = New TypedConstant(stringType, TypedConstantKind.Primitive, _compilation.Options.CryptoKeyContainer) 1625Dim typedConstant = New TypedConstant(stringType, TypedConstantKind.Primitive, _compilation.Options.CryptoKeyFile)
Symbols\Source\SourceFieldSymbol.vb (1)
695New TypedConstant(specialTypeInt64, TypedConstantKind.Primitive, attributeValue.Ticks))))
Symbols\Source\SourceMemberMethodSymbol.vb (1)
1014If arg.Kind <> TypedConstantKind.Array AndAlso CInt(arg.ValueInternal) = DESIGNERSERIALIZATIONVISIBILITYTYPE_CONTENT Then
Symbols\Source\SourceNamedTypeSymbol.vb (7)
2282If attrData.CommonConstructorArguments.Length = 1 AndAlso attrData.CommonConstructorArguments(0).Kind = TypedConstantKind.Primitive Then 2299Debug.Assert(argument.Kind = TypedConstantKind.Type) 2586New TypedConstant(stringType, TypedConstantKind.Primitive, DefaultPropertyName)))) 2601New TypedConstant(GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, _comClassData.ClassId)))) 2607New TypedConstant(GetSpecialType(SpecialType.System_Int32), TypedConstantKind.Enum, CInt(ClassInterfaceType.None))))) 2628New TypedConstant(GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, eventInterfaceName)))) 2655ImmutableArray.Create(New TypedConstant(compilation.GetWellKnownType(WellKnownType.System_Type), TypedConstantKind.Type, originalType)),
Symbols\Source\SourceNamedTypeSymbol_ComClass.vb (11)
43Dim strVal As String = If(args(0).Kind <> TypedConstantKind.Array, TryCast(args(0).ValueInternal, String), Nothing) 50strVal = If(args(1).Kind <> TypedConstantKind.Array, TryCast(args(1).ValueInternal, String), Nothing) 56strVal = If(args(2).Kind <> TypedConstantKind.Array, TryCast(args(2).ValueInternal, String), Nothing) 313Dim value As Object = If(typedValue.Kind <> TypedConstantKind.Array, typedValue.ValueInternal, Nothing) 487Dim value As Object = If(typedValue.Kind <> TypedConstantKind.Array, typedValue.ValueInternal, Nothing) 1002New TypedConstant(_comClass.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, id)))) 1010TypedConstantKind.Primitive, 1017TypedConstantKind.Primitive, 1024TypedConstantKind.Primitive, 1372TypedConstantKind.Primitive, 1878TypedConstantKind.Primitive,
Symbols\Source\SourceParameterSymbol.vb (2)
421Dim specialType = If(arg.Kind = TypedConstantKind.Enum, 427If arg.Kind <> TypedConstantKind.Array AndAlso
Symbols\Source\SourceParameterSymbolBase.vb (1)
64TypedConstantKind.Primitive,
Symbols\Source\SourceWithEventsBackingFieldSymbol.vb (1)
76TypedConstantKind.Primitive,
Symbols\TypedConstant.vb (4)
33If constant.Kind = TypedConstantKind.Array Then 37If constant.Kind = TypedConstantKind.Type OrElse constant.TypeInternal.SpecialType = SpecialType.System_Object Then 41If constant.Kind = TypedConstantKind.Enum Then 51Debug.Assert(constant.Kind = TypedConstantKind.Enum)
Symbols\WellKnownMembers.vb (9)
221TypedConstantKind.Type, 245New TypedConstant(specialTypeByte, TypedConstantKind.Primitive, scale), 246New TypedConstant(specialTypeByte, TypedConstantKind.Primitive, CByte(If(isNegative, 128, 0))), 247New TypedConstant(specialTypeUInt32, TypedConstantKind.Primitive, high), 248New TypedConstant(specialTypeUInt32, TypedConstantKind.Primitive, mid), 249New TypedConstant(specialTypeUInt32, TypedConstantKind.Primitive, low) 261TypedConstantKind.Enum, 277TypedConstantKind.Enum, 737Return New TypedConstant(constantType, TypedConstantKind.Primitive, name)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.vb (4)
20Case TypedConstantKind.Primitive, TypedConstantKind.Enum 23Case TypedConstantKind.Array 30Case TypedConstantKind.Type
Microsoft.CodeAnalysis.VisualBasic.Workspaces (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.vb (4)
20Case TypedConstantKind.Primitive, TypedConstantKind.Enum 23Case TypedConstantKind.Array 30Case TypedConstantKind.Type
Microsoft.Diagnostics.DataContractReader.DataGenerator (1)
Parser.cs (1)
102if (constant.Kind != TypedConstantKind.Array || constant.IsNull)
Microsoft.DotNet.ApiCompatibility (2)
Comparing\TypedConstantEqualityComparer.cs (2)
25case TypedConstantKind.Array: 29case TypedConstantKind.Type:
Microsoft.DotNet.ApiSymbolExtensions (1)
AttributeDataExtensions.cs (1)
38.Any(typedConstant => typedConstant.Kind == TypedConstantKind.Type
Microsoft.Extensions.Logging.Generators (3)
LoggerMessageGenerator.Parser.cs (3)
138if (typedConstant.Kind == TypedConstantKind.Error) 194if (typedConstant.Kind == TypedConstantKind.Error) 952private static object GetItem(TypedConstant arg) => arg.Kind == TypedConstantKind.Array ? arg.Values : arg.Value;
Microsoft.Extensions.Options.SourceGeneration (2)
Parser.cs (2)
509if (argument.Kind == TypedConstantKind.Array) 522if (namedArgument.Value.Kind == TypedConstantKind.Array)
Microsoft.Gen.MetadataExtractor (6)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (6)
266&& attributeData.ConstructorArguments[0].Kind == TypedConstantKind.Primitive) 293if (arg.Value.Kind == TypedConstantKind.Primitive && 298else if (arg.Value.Kind == TypedConstantKind.Primitive && 310if (arg.Kind != TypedConstantKind.Array) 317if (item.Kind != TypedConstantKind.Primitive) 427&& methodAttribute.ConstructorArguments[0].Kind == TypedConstantKind.Type)
Microsoft.Gen.Metrics (6)
Parser.cs (6)
266&& attributeData.ConstructorArguments[0].Kind == TypedConstantKind.Primitive) 293if (arg.Value.Kind == TypedConstantKind.Primitive && 298else if (arg.Value.Kind == TypedConstantKind.Primitive && 310if (arg.Kind != TypedConstantKind.Array) 317if (item.Kind != TypedConstantKind.Primitive) 427&& methodAttribute.ConstructorArguments[0].Kind == TypedConstantKind.Type)
Microsoft.Gen.MetricsReports (6)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (6)
266&& attributeData.ConstructorArguments[0].Kind == TypedConstantKind.Primitive) 293if (arg.Value.Kind == TypedConstantKind.Primitive && 298else if (arg.Value.Kind == TypedConstantKind.Primitive && 310if (arg.Kind != TypedConstantKind.Array) 317if (item.Kind != TypedConstantKind.Primitive) 427&& methodAttribute.ConstructorArguments[0].Kind == TypedConstantKind.Type)
Roslyn.Diagnostics.CSharp.Analyzers (5)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (1)
103if (existingSyntax?.ArgumentList != null && constant is { Kind: not TypedConstantKind.Array, Value: string stringValue })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (4)
29case TypedConstantKind.Primitive: 30case TypedConstantKind.Enum: 33case TypedConstantKind.Type: 38case TypedConstantKind.Array:
Roslyn.Diagnostics.VisualBasic.Analyzers (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.vb (4)
20Case TypedConstantKind.Primitive, TypedConstantKind.Enum 23Case TypedConstantKind.Array 30Case TypedConstantKind.Type
System.Text.RegularExpressions.Generator (1)
RegexGenerator.Parser.cs (1)
69if (generatedRegexAttr.ConstructorArguments.Any(ca => ca.Kind == TypedConstantKind.Error))