232 references to TypedConstantKind
Aspire.Hosting.Azure.Provisioning.Generators (2)
AspireProvisioningProxyGenerator.cs (2)
131attribute.ConstructorArguments[0] is { Kind: TypedConstantKind.Type, Value: INamedTypeSymbol type }) 151namedArgument.Value.Kind == TypedConstantKind.Array)
Aspire.Hosting.Integration.Analyzers (1)
AspireExportAnalyzer.cs (1)
1654if (typesArg.Kind != TypedConstantKind.Array)
ILLink.RoslynAnalyzer (1)
DataFlow\LocalDataFlowVisitor.cs (1)
1453Kind: 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.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 (122)
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\ExtensionGroupingInfo.cs (1)
809var defaultMemberNameConstant = new TypedConstant(compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, firstIndexer.MetadataName);
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)
1577&& attr.CommonConstructorArguments[0].Kind == TypedConstantKind.Type)
Symbols\Source\SourceMethodSymbol.cs (2)
197TypedConstantKind.Type, stateMachineType.GetUnboundGenericTypeOrSelf()); 290ImmutableArray.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, (int)MemorySafetyRulesVersion)); 693new TypedConstant(compilation.GetSpecialType(SpecialType.System_Boolean), TypedConstantKind.Primitive, _assemblySymbol.InternalsAreVisible));
Symbols\Source\SourceNamedTypeSymbol_Extension.cs (5)
875if (argument.Kind == TypedConstantKind.Error) 890case TypedConstantKind.Primitive: 894case TypedConstantKind.Enum: 900case TypedConstantKind.Type: 907case TypedConstantKind.Array:
Symbols\Source\SourceNamedTypeSymbol.cs (8)
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); 1815static (subtype, elementType) => new TypedConstant(elementType, TypedConstantKind.Type, subtype.GetUnboundGenericTypeOrSelf()), propertyType.ElementType)); 1847ImmutableArray.Create(new TypedConstant(compilation.GetWellKnownType(WellKnownType.System_Type), TypedConstantKind.Type, originalType)),
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListTypeSymbol.cs (1)
993[new TypedConstant(DeclaringCompilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, debuggerDisplayString)]));
Symbols\Synthesized\SynthesizedInlineArrayTypeSymbol.cs (1)
213arguments: ImmutableArray.Create(new TypedConstant(compilation.GetSpecialType(SpecialType.System_Int32), TypedConstantKind.Primitive, _arrayLength)),
Symbols\TypedConstantExtensions.cs (6)
49if (constant.Kind == TypedConstantKind.Array) 54if (constant.Kind == TypedConstantKind.Type || constant.TypeInternal!.SpecialType == SpecialType.System_Object) 60if (constant.Kind == TypedConstantKind.Enum) 81Debug.Assert(constant.Kind == TypedConstantKind.Enum); 101Debug.Assert(constant.Kind == TypedConstantKind.Enum); 180Debug.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)
6980TypedConstantKind.Array => x.Values.IsDefault || x.Values.SequenceEqual(y.Values, Instance), 6981TypedConstantKind.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.NetAnalyzers (7)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\MarkAssembliesWithComVisible.cs (1)
74attributeInstance.ConstructorArguments[0].Kind == TypedConstantKind.Primitive &&
Microsoft.CodeQuality.Analyzers\Maintainability\AvoidUninstantiatedInternalClasses.cs (1)
190attribute.ConstructorArguments[0].Kind == TypedConstantKind.Type &&
Microsoft.NetCore.Analyzers\Performance\ConstantExpectedAnalyzer.cs (1)
579return typedConstant.Kind == TypedConstantKind.Array ? typedConstant.Values : typedConstant.Value;
Microsoft.NetCore.Analyzers\Runtime\DoNotPassLiteralsAsLocalizedParameters.cs (1)
320localizableAttribute.ConstructorArguments[0].Kind == TypedConstantKind.Primitive &&
Microsoft.NetCore.Analyzers\Security\DoNotDisableRequestValidation.cs (1)
80constructorArguments[0].Kind == TypedConstantKind.Primitive &&
Microsoft.NetCore.Analyzers\Security\Helpers\InsecureDeserializationTypeDecider.cs (2)
344if (typedConstant.Kind != TypedConstantKind.Type // Not handling the string methodName overload 379if (typedConstant.Kind != TypedConstantKind.Type
Microsoft.CodeAnalysis.Razor.Compiler (1)
Language\TagHelpers\Producers\ComponentTagHelperProducer.cs (1)
584if (arg.Kind == TypedConstantKind.Enum)
Microsoft.Diagnostics.DataContractReader.DataGenerator (1)
Parser.cs (1)
113if (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) 953private static object GetItem(TypedConstant arg) => arg.Kind == TypedConstantKind.Array ? arg.Values : arg.Value;
Microsoft.Extensions.Options.SourceGeneration (2)
Parser.cs (2)
631if (argument.Kind == TypedConstantKind.Array) 644if (namedArgument.Value.Kind == TypedConstantKind.Array)
Microsoft.Extensions.Validation.ValidationsGenerator (2)
Extensions\ISymbolExtensions.cs (2)
34if (string.Equals(arg.Key, "Name", StringComparison.Ordinal) && arg.Value.Kind == TypedConstantKind.Primitive) 38else if (string.Equals(arg.Key, "ResourceType", StringComparison.Ordinal) && arg.Value.Kind == TypedConstantKind.Type)
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:
System.Text.RegularExpressions.Generator (1)
RegexGenerator.Parser.cs (1)
69if (generatedRegexAttr.ConstructorArguments.Any(ca => ca.Kind == TypedConstantKind.Error))