62 instantiations of TypedConstant
Microsoft.CodeAnalysis (4)
MetadataReader\MetadataDecoder.cs (4)
2146return new TypedConstant(type, TypedConstantKind.Error, null); 2150return new TypedConstant(type, array); 2157return new TypedConstant(type, TypedConstantKind.Error, null); 2160return new TypedConstant(type, kind, value);
Microsoft.CodeAnalysis.CSharp (58)
Binder\Binder_Attributes.cs (4)
901return new TypedConstant(spread.Expression.Type, TypedConstantKind.Error, value: null); 1058return new TypedConstant(type, TypedConstantKind.Error, null); 1062return new TypedConstant(type, arrayValue); 1066return new TypedConstant(type, typedConstantKind, simpleValue);
Emitter\Model\PEAssemblyBuilder.cs (1)
381[new TypedConstant(Compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, markerName)],
Emitter\Model\PEModuleBuilder.cs (7)
1743var value = flagsBuilder.SelectAsArray((flag, byteType) => new TypedConstant(byteType, TypedConstantKind.Primitive, flag), byteType); 1746ImmutableArray.Create(new TypedConstant(byteArrayType, value))); 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); 1829var arguments = ImmutableArray.Create(new TypedConstant(boolArray, transformFlags)); 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\Compilation_WellKnownMembers.cs (15)
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); 502ImmutableArray.Create(new TypedConstant( 805var typedConstantDebugMode = new TypedConstant(debuggingModesType, TypedConstantKind.Enum, constantVal); 832var arguments = ImmutableArray.Create(new TypedConstant(boolArray, transformFlags)); 849var args = ImmutableArray.Create(new TypedConstant(stringArray, names)); 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 (4)
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)
1234return new TypedConstant(newConstantType, newArray); 1256return new TypedConstant(newConstantType, oldConstant.Kind, newConstantValue);
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\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\SourceMethodSymbol.cs (2)
183var arg = new TypedConstant(compilation.GetWellKnownType(WellKnownType.System_Type), 277ImmutableArray.Create(new TypedConstant(compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, nameof(CompilerFeatureRequiredFeatures.UserDefinedCompoundAssignmentOperators)))
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 (5)
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\Synthesized\SynthesizedInlineArrayTypeSymbol.cs (1)
213arguments: ImmutableArray.Create(new TypedConstant(compilation.GetSpecialType(SpecialType.System_Int32), TypedConstantKind.Primitive, _arrayLength)),
579 references to TypedConstant
Aspire.Hosting.Integration.Analyzers (2)
AspireExportAnalyzer.cs (2)
726var typesArg = attr.ConstructorArguments[0]; 744foreach (var typeConstant in types)
ConfigurationSchemaGenerator (3)
ConfigSchemaGenerator.cs (3)
64ImmutableArray<TypedConstant> args = attribute.ConstructorArguments; 79var exclusionPathsArg = args[2]; 87ImmutableArray<TypedConstant> args = attribute.ConstructorArguments;
EventSourceGenerator (2)
EventSourceGenerator.Parser.cs (2)
107ImmutableArray<KeyValuePair<string, TypedConstant>> args = attribute.NamedArguments; 108foreach (KeyValuePair<string, TypedConstant> arg in args)
GenerateDocumentationAndConfigFiles (8)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (2)
405ImmutableArray<TypedConstant> constructorArguments = default, 406ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments = default)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAttributeData.cs (6)
14ImmutableArray<TypedConstant> constructorArguments, 15ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments) : AttributeData 17private readonly ImmutableArray<TypedConstant> _constructorArguments = constructorArguments.NullToEmpty(); 18private readonly ImmutableArray<KeyValuePair<string, TypedConstant>> _namedArguments = namedArguments.NullToEmpty(); 22protected override ImmutableArray<TypedConstant> CommonConstructorArguments => _constructorArguments; 23protected override ImmutableArray<KeyValuePair<string, TypedConstant>> CommonNamedArguments => _namedArguments;
ILLink.RoslynAnalyzer (3)
COMAnalyzer.cs (1)
67marshalAsAttribute.ConstructorArguments.Length >= 1 && marshalAsAttribute.ConstructorArguments[0] is TypedConstant typedConstant &&
DataFlow\LocalDataFlowVisitor.cs (1)
882var attributeArgument = attributeData.ConstructorArguments[0];
ISymbolExtensions.cs (1)
89if (featureGuardAttribute.ConstructorArguments is [TypedConstant { Value: INamedTypeSymbol featureType }])
Microsoft.Analyzers.Extra (3)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (3)
238private static TypedConstant? GetLogMethodAttributeParameter( 240ImmutableArray<TypedConstant> constructorArguments, 247foreach (var ctorArg in constructorArguments)
Microsoft.AspNetCore.App.Analyzers (3)
RouteEmbeddedLanguage\Infrastructure\RoutePatternParametersDetector.cs (1)
55var routeParameterNameConstant = namedArgument.Value;
RouteEmbeddedLanguage\Infrastructure\RouteStringSyntaxDetector.cs (1)
357var argument = attribute.ConstructorArguments[0];
src\aspnetcore\src\Shared\RoslynUtils\SymbolExtensions.cs (1)
287var routeParameterNameConstant = namedArgument.Value;
Microsoft.AspNetCore.Mvc.Analyzers (2)
TopLevelParameterNameAnalyzer.cs (2)
162var namedArgumentValue = namedArgument.Value; 185var namedArgumentValue = namedArgument.Value;
Microsoft.AspNetCore.Mvc.Api.Analyzers (2)
SymbolApiResponseMetadataProvider.cs (2)
192var namedArgumentValue = namedArgument.Value; 219var argument = attribute.ConstructorArguments[i];
Microsoft.CodeAnalysis (75)
Emit\NoPia\CommonEmbeddedParameter.cs (2)
93ImmutableArray<TypedConstant> constructorArguments; 94ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments;
Emit\NoPia\CommonEmbeddedType.cs (2)
112ImmutableArray<TypedConstant> constructorArguments; 113ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments;
Emit\NoPia\EmbeddedTypesManager.cs (6)
158internal abstract TAttributeData CreateSynthesizedAttribute(WellKnownMember constructor, ImmutableArray<TypedConstant> constructorArguments, ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments, TSyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics); 159internal abstract TAttributeData CreateSynthesizedAttribute(SpecialMember constructor, ImmutableArray<TypedConstant> constructorArguments, ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments, TSyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics); 160internal abstract bool TryGetAttributeArguments(TAttributeData attrData, out ImmutableArray<TypedConstant> constructorArguments, out ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments, TSyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics);
MetadataReader\MetadataDecoder.cs (23)
108(KeyValuePair<string, TypedConstant> nameValuePair, bool isProperty, SerializationTypeCode typeCode, SerializationTypeCode elementTypeCode) DecodeCustomAttributeNamedArgumentOrThrow(ref BlobReader argReader); 1402private TypedConstant DecodeCustomAttributeFixedArgumentOrThrow(ITypeSymbolInternal type, ref BlobReader argReader) 1437private TypedConstant DecodeCustomAttributeElementOrThrow(ref BlobReader argReader, SerializationTypeCode typeCode, TypeSymbol type) 1457private TypedConstant DecodeCustomAttributeElementArrayOrThrow(ref BlobReader argReader, SerializationTypeCode elementTypeCode, TypeSymbol elementType, TypeSymbol arrayType) 1460TypedConstant[] values; 1468values = Array.Empty<TypedConstant>(); 1472values = new TypedConstant[count]; 1484private TypedConstant DecodeCustomAttributePrimitiveElementOrThrow(ref BlobReader argReader, SerializationTypeCode typeCode, TypeSymbol type) 1554public (KeyValuePair<string, TypedConstant> nameValuePair, bool isProperty, SerializationTypeCode typeCode, SerializationTypeCode elementTypeCode) DecodeCustomAttributeNamedArgumentOrThrow(ref BlobReader argReader) 1577TypedConstant value = typeCode == SerializationTypeCode.SZArray 1581return (new KeyValuePair<string, TypedConstant>(name, value), kind == CustomAttributeNamedArgumentKind.Property, typeCode, elementTypeCode); 1622out TypedConstant[] positionalArgs, 1623out KeyValuePair<string, TypedConstant>[] namedArgs) 1627positionalArgs = Array.Empty<TypedConstant>(); 1628namedArgs = Array.Empty<KeyValuePair<string, TypedConstant>>(); 1649positionalArgs = new TypedConstant[paramCount]; 1662namedArgs = new KeyValuePair<string, TypedConstant>[namedParamCount]; 1674positionalArgs = Array.Empty<TypedConstant>(); 1675namedArgs = Array.Empty<KeyValuePair<String, TypedConstant>>(); 2142private static TypedConstant CreateArrayTypedConstant(TypeSymbol type, ImmutableArray<TypedConstant> array) 2153private static TypedConstant CreateTypedConstant(TypeSymbol type, TypedConstantKind kind, object value) 2163private static TypedConstant CreateTypedConstant(TypeSymbol type, TypedConstantKind kind, bool value)
MetadataReader\PEModule.cs (3)
1412(KeyValuePair<string, TypedConstant> nameValuePair, bool isProperty, SerializationTypeCode typeCode, SerializationTypeCode elementTypeCode) namedArgValues = 1447Func<string, TypedConstant, bool, (bool IsCallConvs, ImmutableHashSet<INamedTypeSymbolInternal>? CallConvs)> unmanagedCallersOnlyDecoder) 1572(KeyValuePair<string, TypedConstant> nameValuePair, bool isProperty, SerializationTypeCode typeCode, SerializationTypeCode elementTypeCode) namedArgValues =
Symbols\Attributes\CommonAttributeData.cs (10)
42public ImmutableArray<TypedConstant> ConstructorArguments { get { return CommonConstructorArguments; } } 43protected internal abstract ImmutableArray<TypedConstant> CommonConstructorArguments { get; } 48public ImmutableArray<KeyValuePair<string, TypedConstant>> NamedArguments { get { return CommonNamedArguments; } } 49protected internal abstract ImmutableArray<KeyValuePair<string, TypedConstant>> CommonNamedArguments { get; } 170private static T? DecodeNamedArgument<T>(ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments, string name, SpecialType specialType, T? defaultValue = default) 176private static int IndexOfNamedArgument(ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments, string name) 205ImmutableArray<TypedConstant> args = this.CommonConstructorArguments; 312ImmutableArray<TypedConstant> args = this.CommonConstructorArguments; 575internal static AttributeUsageInfo DecodeAttributeUsageAttribute(TypedConstant positionalArg, ImmutableArray<KeyValuePair<string, TypedConstant>> namedArgs)
Symbols\Attributes\CommonAttributeDataComparer.cs (13)
64private static int GetHashCodeForConstructorArguments(ImmutableArray<TypedConstant> constructorArguments) 68foreach (var arg in constructorArguments) 76private int GetHashCodeForNamedArguments(ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments) 104private class TypedConstantComparer : IEqualityComparer<TypedConstant> 112public bool Equals(TypedConstant x, TypedConstant y) 118static bool equals(TypedConstant x, TypedConstant y) 129public int GetHashCode(TypedConstant obj) 135private class NamedArgumentComparer : IEqualityComparer<KeyValuePair<string, TypedConstant>> 143public bool Equals(KeyValuePair<string, TypedConstant> pair1, KeyValuePair<string, TypedConstant> pair2) 150public int GetHashCode(KeyValuePair<string, TypedConstant> pair)
Symbols\Attributes\UnmanagedCallersOnlyAttributeData.cs (1)
33internal static bool IsCallConvsTypedConstant(string key, bool isField, in TypedConstant value)
Symbols\TypedConstant.cs (9)
17public readonly struct TypedConstant : IEquatable<TypedConstant> 25Debug.Assert(kind == TypedConstantKind.Array || !(value is ImmutableArray<TypedConstant>)); 34internal TypedConstant(ITypeSymbolInternal type, ImmutableArray<TypedConstant> array) 107/// The value for a <see cref="TypedConstant"/> array. 111public ImmutableArray<TypedConstant> Values 125return (ImmutableArray<TypedConstant>)_value!; 202return obj is TypedConstant && Equals((TypedConstant)obj); 205public bool Equals(TypedConstant other)
Symbols\TypedConstantValue.cs (6)
15/// Represents a simple value or a read-only array of <see cref="TypedConstant"/>. 29internal TypedConstantValue(ImmutableArray<TypedConstant> array) 45public ImmutableArray<TypedConstant> Array 49return _value == null ? default(ImmutableArray<TypedConstant>) : (ImmutableArray<TypedConstant>)_value; 57Debug.Assert(!(_value is ImmutableArray<TypedConstant>));
Microsoft.CodeAnalysis.Analyzers (14)
MetaAnalyzers\CompilerExtensionStrictApiAnalyzer.cs (3)
181foreach (var arg in attribute.ConstructorArguments) 186foreach (var element in arg.Values) 201private static void CheckLanguage(TypedConstant argument, ref bool supportsCSharp, ref bool supportsVisualBasic)
MetaAnalyzers\DiagnosticAnalyzerAttributeAnalyzer.cs (3)
106foreach (TypedConstant arg in attribute.ConstructorArguments) 112foreach (TypedConstant element in arg.Values) 147private static void CheckLanguage(TypedConstant argument, ref bool supportsCSharp, ref bool supportsVB)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (2)
405ImmutableArray<TypedConstant> constructorArguments = default, 406ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments = default)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAttributeData.cs (6)
14ImmutableArray<TypedConstant> constructorArguments, 15ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments) : AttributeData 17private readonly ImmutableArray<TypedConstant> _constructorArguments = constructorArguments.NullToEmpty(); 18private readonly ImmutableArray<KeyValuePair<string, TypedConstant>> _namedArguments = namedArguments.NullToEmpty(); 22protected override ImmutableArray<TypedConstant> CommonConstructorArguments => _constructorArguments; 23protected override ImmutableArray<KeyValuePair<string, TypedConstant>> CommonNamedArguments => _namedArguments;
Microsoft.CodeAnalysis.CodeStyle.Fixes (8)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (2)
405ImmutableArray<TypedConstant> constructorArguments = default, 406ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments = default)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAttributeData.cs (6)
14ImmutableArray<TypedConstant> constructorArguments, 15ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments) : AttributeData 17private readonly ImmutableArray<TypedConstant> _constructorArguments = constructorArguments.NullToEmpty(); 18private readonly ImmutableArray<KeyValuePair<string, TypedConstant>> _namedArguments = namedArguments.NullToEmpty(); 22protected override ImmutableArray<TypedConstant> CommonConstructorArguments => _constructorArguments; 23protected override ImmutableArray<KeyValuePair<string, TypedConstant>> CommonNamedArguments => _namedArguments;
Microsoft.CodeAnalysis.CSharp (198)
Binder\Binder_Attributes.cs (30)
313ImmutableArray<TypedConstant> rewrittenArguments; 704private ImmutableArray<TypedConstant> GetRewrittenAttributeConstructorArguments( 706ImmutableArray<TypedConstant> constructorArgsArray, 721var reorderedArguments = new TypedConstant[parameterCount]; 727TypedConstant reorderedArgument = constructorArgsArray[i]; 769public ImmutableArray<TypedConstant> VisitArguments(ImmutableArray<BoundExpression> arguments, BindingDiagnosticBag diagnostics, ref bool attrHasErrors, bool parentHasErrors = false) 771var validatedArguments = ImmutableArray<TypedConstant>.Empty; 776var builder = ArrayBuilder<TypedConstant>.GetInstance(numArguments); 790public ImmutableArray<KeyValuePair<string, TypedConstant>> VisitNamedArguments(ImmutableArray<BoundAssignmentOperator> arguments, BindingDiagnosticBag diagnostics, ref bool attrHasErrors) 792ArrayBuilder<KeyValuePair<string, TypedConstant>>? builder = null; 801builder = ArrayBuilder<KeyValuePair<string, TypedConstant>>.GetInstance(); 810return ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty; 816private KeyValuePair<String, TypedConstant>? VisitNamedArgument(BoundAssignmentOperator assignment, BindingDiagnosticBag diagnostics, ref bool attrHasErrors) 818KeyValuePair<String, TypedConstant>? visitedArgument = null; 824visitedArgument = new KeyValuePair<String, TypedConstant>(fa.FieldSymbol.Name, VisitExpression(assignment.Right, diagnostics, ref attrHasErrors, assignment.HasAnyErrors)); 829visitedArgument = new KeyValuePair<String, TypedConstant>(pa.PropertySymbol.Name, VisitExpression(assignment.Right, diagnostics, ref attrHasErrors, assignment.HasAnyErrors)); 843private TypedConstant VisitExpression(BoundExpression node, BindingDiagnosticBag diagnostics, ref bool attrHasErrors, bool curArgumentHasErrors) 853private TypedConstant VisitExpression(BoundExpression node, TypedConstantKind typedConstantKind, BindingDiagnosticBag diagnostics, ref bool attrHasErrors, bool curArgumentHasErrors) 883private TypedConstant VisitArrayCollectionExpression(TypeSymbol type, BoundCollectionExpression collection, BindingDiagnosticBag diagnostics, ref bool attrHasErrors, bool curArgumentHasErrors) 887var builder = ArrayBuilder<TypedConstant>.GetInstance(elements.Length); 895private TypedConstant VisitCollectionExpressionElement(BoundNode node, BindingDiagnosticBag diagnostics, ref bool attrHasErrors, bool curArgumentHasErrors) 906private TypedConstant VisitConversion(BoundConversion node, BindingDiagnosticBag diagnostics, ref bool attrHasErrors, bool curArgumentHasErrors) 943private static TypedConstant VisitTypeOfExpression(BoundTypeOfOperator node, BindingDiagnosticBag diagnostics, ref bool attrHasErrors, bool curArgumentHasErrors) 979private TypedConstant VisitArrayCreation(BoundArrayCreation node, BindingDiagnosticBag diagnostics, ref bool attrHasErrors, bool curArgumentHasErrors) 992ImmutableArray<TypedConstant> initializer; 997initializer = ImmutableArray<TypedConstant>.Empty; 1003initializer = ImmutableArray<TypedConstant>.Empty; 1020private static TypedConstant CreateTypedConstant(BoundExpression node, TypedConstantKind typedConstantKind, BindingDiagnosticBag diagnostics, ref bool attrHasErrors, bool curArgumentHasErrors, 1021object? simpleValue = null, ImmutableArray<TypedConstant> arrayValue = default(ImmutableArray<TypedConstant>))
Compiler\ClsComplianceChecker.cs (3)
603foreach (TypedConstant argument in attribute.ConstructorArguments) 620TypedConstant argument = pair.Value; 1208ImmutableArray<TypedConstant> args = data.CommonConstructorArguments;
Emitter\Model\AttributeDataAdapter.cs (5)
28foreach (var argument in commonArgs) 99private Cci.IMetadataExpression CreateMetadataExpression(TypedConstant argument, EmitContext context) 119private MetadataCreateArray CreateMetadataArray(TypedConstant argument, EmitContext context) 143private static MetadataTypeOf CreateType(TypedConstant argument, EmitContext context) 159private Cci.IMetadataNamedArgument CreateMetadataNamedArgument(string name, TypedConstant argument, EmitContext context)
Emitter\Model\PEAssemblyBuilder.cs (28)
214ImmutableArray<TypedConstant>.Empty, 215ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty); 218internal override SynthesizedAttributeData SynthesizeNullableAttribute(WellKnownMember member, ImmutableArray<TypedConstant> arguments) 227ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty); 233internal override SynthesizedAttributeData SynthesizeNullableContextAttribute(ImmutableArray<TypedConstant> arguments) 241ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty); 247internal override SynthesizedAttributeData SynthesizeNullablePublicOnlyAttribute(ImmutableArray<TypedConstant> arguments) 255ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty); 261internal override SynthesizedAttributeData SynthesizeNativeIntegerAttribute(WellKnownMember member, ImmutableArray<TypedConstant> arguments) 270ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty); 283ImmutableArray<TypedConstant>.Empty, 284ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty); 290internal override SynthesizedAttributeData SynthesizeRefSafetyRulesAttribute(ImmutableArray<TypedConstant> arguments) 298ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty); 304internal override SynthesizedAttributeData TrySynthesizeMemorySafetyRulesAttribute(ImmutableArray<TypedConstant> arguments) 325ImmutableArray<TypedConstant>.Empty, 326ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty); 339ImmutableArray<TypedConstant>.Empty, 340ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty); 353ImmutableArray<TypedConstant>.Empty, 354ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty); 367ImmutableArray<TypedConstant>.Empty, 368ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty); 382ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty); 400ImmutableArray<TypedConstant>.Empty, 401ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty); 414ImmutableArray<TypedConstant>.Empty, 415ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty);
Emitter\Model\PEModuleBuilder.cs (7)
1768internal virtual SynthesizedAttributeData SynthesizeNullableAttribute(WellKnownMember member, ImmutableArray<TypedConstant> arguments) 1788internal virtual SynthesizedAttributeData SynthesizeNullableContextAttribute(ImmutableArray<TypedConstant> arguments) 1821attribute = SynthesizeNativeIntegerAttribute(WellKnownMember.System_Runtime_CompilerServices_NativeIntegerAttribute__ctor, ImmutableArray<TypedConstant>.Empty); 1837internal virtual SynthesizedAttributeData SynthesizeNativeIntegerAttribute(WellKnownMember member, ImmutableArray<TypedConstant> arguments) 1868internal virtual SynthesizedAttributeData SynthesizeRefSafetyRulesAttribute(ImmutableArray<TypedConstant> arguments) 1875internal virtual SynthesizedAttributeData TrySynthesizeMemorySafetyRulesAttribute(ImmutableArray<TypedConstant> arguments) 1888internal virtual SynthesizedAttributeData SynthesizeNullablePublicOnlyAttribute(ImmutableArray<TypedConstant> arguments)
Emitter\NoPia\EmbeddedType.cs (3)
262return SynthesizedAttributeData.Create(TypeManager.ModuleBeingBuilt.Compilation, ctor, ImmutableArray<TypedConstant>.Empty, ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty); 282ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty);
Emitter\NoPia\EmbeddedTypesManager.cs (9)
165internal override CSharpAttributeData CreateSynthesizedAttribute(WellKnownMember constructor, ImmutableArray<TypedConstant> constructorArguments, ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics) 180ImmutableArray.Create<TypedConstant>(constructorArguments[0], constructorArguments[0]), 181ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty); 190ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty); 197internal override CSharpAttributeData CreateSynthesizedAttribute(SpecialMember constructor, ImmutableArray<TypedConstant> constructorArguments, ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics) 208internal override bool TryGetAttributeArguments(CSharpAttributeData attrData, out ImmutableArray<TypedConstant> constructorArguments, out ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics)
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TemplateSymbol.cs (1)
225namedArguments: ImmutableArray.Create(new KeyValuePair<WellKnownMember, TypedConstant>(
Symbols\Attributes\AttributeData.cs (12)
53public new IEnumerable<TypedConstant> ConstructorArguments 61public new IEnumerable<KeyValuePair<string, TypedConstant>> NamedArguments 152foreach (var constructorArgument in this.CommonConstructorArguments) 253var value = arguments.Attribute.CommonConstructorArguments[0]; 271foreach (var member in value.Values) 303var value = arguments.Attribute.CommonConstructorArguments[1]; 322foreach (var member in value.Values) 366TypedConstant firstArg = ctorArgs[0]; 380private DeclarativeSecurityAction DecodeSecurityAction(TypedConstant typedValue, Symbol targetSymbol, AttributeSyntax? nodeOpt, BindingDiagnosticBag diagnostics, out bool hasErrors) 468private static Location GetSecurityAttributeActionSyntaxLocation(AttributeSyntax? nodeOpt, TypedConstant typedValue, out object displayString) 574TypedConstant ctorArgument = this.CommonConstructorArguments[0]; 599TypedConstant ctorArgument = this.CommonConstructorArguments[0];
Symbols\Attributes\PEAttributeData.cs (8)
24private ImmutableArray<TypedConstant> _lazyConstructorArguments; 25private ImmutableArray<KeyValuePair<string, TypedConstant>> _lazyNamedArguments; 57protected internal override ImmutableArray<TypedConstant> CommonConstructorArguments 66protected internal override ImmutableArray<KeyValuePair<string, TypedConstant>> CommonNamedArguments 103TypedConstant[]? lazyConstructorArguments = null; 104KeyValuePair<string, TypedConstant>[]? lazyNamedArguments = null; 114ImmutableArray.Create<TypedConstant>(lazyConstructorArguments)); 117ImmutableArray.Create<KeyValuePair<string, TypedConstant>>(lazyNamedArguments));
Symbols\Attributes\RetargetingAttributeData.cs (6)
20private readonly ImmutableArray<TypedConstant> _constructorArguments; 21private readonly ImmutableArray<KeyValuePair<string, TypedConstant>> _namedArguments; 27ImmutableArray<TypedConstant> constructorArguments, 28ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments) 42protected internal override ImmutableArray<TypedConstant> CommonConstructorArguments => _constructorArguments; 43protected internal override ImmutableArray<KeyValuePair<string, TypedConstant>> CommonNamedArguments => _namedArguments;
Symbols\Attributes\SourceAttributeData.cs (10)
23private readonly ImmutableArray<TypedConstant> _constructorArguments; 25private readonly ImmutableArray<KeyValuePair<string, TypedConstant>> _namedArguments; 35ImmutableArray<TypedConstant> constructorArguments, 37ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments, 67constructorArguments: ImmutableArray<TypedConstant>.Empty, 69namedArguments: ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty, 80ImmutableArray<TypedConstant> constructorArguments, 82ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments, 202protected internal sealed override ImmutableArray<TypedConstant> CommonConstructorArguments 207protected internal sealed override ImmutableArray<KeyValuePair<string, TypedConstant>> CommonNamedArguments
Symbols\Compilation_WellKnownMembers.cs (15)
396ImmutableArray<TypedConstant> arguments = default, 397ImmutableArray<KeyValuePair<WellKnownMember, TypedConstant>> namedArguments = default, 411arguments = ImmutableArray<TypedConstant>.Empty; 414ImmutableArray<KeyValuePair<string, TypedConstant>> namedStringArguments; 417namedStringArguments = ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty; 421var builder = new ArrayBuilder<KeyValuePair<string, TypedConstant>>(namedArguments.Length); 433builder.Add(new KeyValuePair<string, TypedConstant>( 458arguments: ImmutableArray<TypedConstant>.Empty, 459namedArguments: ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty); 487var ticks = new TypedConstant(GetSpecialType(SpecialType.System_Int64), TypedConstantKind.Primitive, value.Ticks); 805var typedConstantDebugMode = new TypedConstant(debuggingModesType, TypedConstantKind.Enum, constantVal); 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))); 880public static ImmutableArray<TypedConstant> Encode(TypeSymbol type, TypeSymbol stringType) 931internal static ImmutableArray<TypedConstant> Encode(TypeSymbol type, RefKind refKind, int customModifiersCount, TypeSymbol booleanType)
Symbols\MethodSymbol.cs (2)
1008TypedConstant value, 1027foreach (var callConvTypedConstant in value.Values)
Symbols\Retargeting\RetargetingSymbolTranslator.cs (19)
1178ImmutableArray<TypedConstant> oldAttributeCtorArguments = oldAttributeData.CommonConstructorArguments; 1179ImmutableArray<TypedConstant> newAttributeCtorArguments = RetargetAttributeConstructorArguments(oldAttributeCtorArguments); 1181ImmutableArray<KeyValuePair<string, TypedConstant>> oldAttributeNamedArguments = oldAttributeData.CommonNamedArguments; 1182ImmutableArray<KeyValuePair<string, TypedConstant>> newAttributeNamedArguments = RetargetAttributeNamedArguments(oldAttributeNamedArguments); 1195private ImmutableArray<TypedConstant> RetargetAttributeConstructorArguments(ImmutableArray<TypedConstant> constructorArguments) 1197ImmutableArray<TypedConstant> retargetedArguments = constructorArguments; 1202var newArguments = ArrayBuilder<TypedConstant>.GetInstance(constructorArguments.Length); 1204foreach (TypedConstant oldArgument in constructorArguments) 1206TypedConstant retargetedArgument = RetargetTypedConstant(oldArgument, ref argumentsHaveChanged); 1221private TypedConstant RetargetTypedConstant(TypedConstant oldConstant, ref bool typedConstantChanged) 1264private ImmutableArray<KeyValuePair<string, TypedConstant>> RetargetAttributeNamedArguments(ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments) 1271var newArguments = ArrayBuilder<KeyValuePair<string, TypedConstant>>.GetInstance(namedArguments.Length); 1273foreach (KeyValuePair<string, TypedConstant> oldArgument in namedArguments) 1275TypedConstant oldConstant = oldArgument.Value; 1277TypedConstant newConstant = RetargetTypedConstant(oldConstant, ref typedConstantChanged); 1281newArguments.Add(new KeyValuePair<string, TypedConstant>(oldArgument.Key, newConstant));
Symbols\Source\SourceAssemblySymbol.cs (9)
1829var typedConstantRequestMinimum = new TypedConstant(securityActionType, TypedConstantKind.Enum, constantValue); 1835var typedConstantTrue = new TypedConstant(boolType, TypedConstantKind.Primitive, value: true); 1840ImmutableArray.Create(new KeyValuePair<WellKnownMember, TypedConstant>( 1975var typedConstantNoStringInterning = new TypedConstant(int32Type, TypedConstantKind.Primitive, Cci.Constants.CompilationRelaxations_NoStringInterning); 1994var typedConstantTrue = new TypedConstant(boolType, TypedConstantKind.Primitive, value: true); 1998ImmutableArray<TypedConstant>.Empty, 1999ImmutableArray.Create(new KeyValuePair<WellKnownMember, TypedConstant>( 2028var typedConstant = new TypedConstant(stringType, TypedConstantKind.Primitive, _compilation.Options.CryptoKeyContainer); 2038var typedConstant = new TypedConstant(stringType, TypedConstantKind.Primitive, _compilation.Options.CryptoKeyFile);
Symbols\Source\SourceComplexParameterSymbol.cs (4)
1002var arg = attribute.CommonConstructorArguments[0]; 1309TypedConstant constructorArgument = arguments.Attribute.CommonConstructorArguments[0]; 1338foreach (var nestedArgument in constructorArgument.Values) 1367int? decodeName(TypedConstant constant, ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments)
Symbols\Source\SourceFixedFieldSymbol.cs (3)
48var item1 = new TypedConstant(systemType, TypedConstantKind.Type, ((PointerTypeSymbol)this.Type).PointedAtType); 49var item2 = new TypedConstant(intType, TypedConstantKind.Primitive, this.FixedSize); 52ImmutableArray.Create<TypedConstant>(item1, item2)));
Symbols\Source\SourceMethodSymbol.cs (1)
183var arg = new TypedConstant(compilation.GetWellKnownType(WellKnownType.System_Type),
Symbols\Source\SourceNamedTypeSymbol.cs (2)
1360TypedConstant argument = attribute.CommonConstructorArguments[0]; 1785var defaultMemberNameConstant = new TypedConstant(compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, defaultMemberName);
Symbols\Source\SourceNamedTypeSymbol_Extension.cs (5)
833foreach (TypedConstant argument in attribute.CommonConstructorArguments) 847foreach (KeyValuePair<string, TypedConstant> namedArgument in attribute.CommonNamedArguments) 873static void appendAttributeArgument(TypedConstant argument, StringBuilder builder) 911foreach (TypedConstant element in argument.Values) 930static void appendAttributeNamedArgument(KeyValuePair<string, TypedConstant> namedArgument, StringBuilder builder)
Symbols\Source\SynthesizedAttributeData.cs (10)
17public static SynthesizedAttributeData Create(CSharpCompilation compilation, MethodSymbol wellKnownMember, ImmutableArray<TypedConstant> arguments, ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments) 31private readonly ImmutableArray<TypedConstant> _arguments; 32private readonly ImmutableArray<KeyValuePair<string, TypedConstant>> _namedArguments; 34internal FromMethodAndArguments(CSharpCompilation compilation, MethodSymbol wellKnownMember, ImmutableArray<TypedConstant> arguments, ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments) 49protected internal override ImmutableArray<TypedConstant> CommonConstructorArguments => _arguments; 50protected internal override ImmutableArray<KeyValuePair<string, TypedConstant>> CommonNamedArguments => _namedArguments; 79protected internal override ImmutableArray<TypedConstant> CommonConstructorArguments => _original.CommonConstructorArguments; 80protected internal override ImmutableArray<KeyValuePair<string, TypedConstant>> CommonNamedArguments => _original.CommonNamedArguments;
Symbols\Synthesized\SynthesizedInlineArrayTypeSymbol.cs (1)
214namedArguments: ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty));
Symbols\TypedConstantExtensions.cs (4)
18public static string ToCSharpString(this TypedConstant constant) 49private static string DisplayEnumConstant(TypedConstant constant) 69private static string DisplayUnsignedEnumConstant(TypedConstant constant, SpecialType specialType, ulong constantToDecode, string typeName) 148private static string DisplaySignedEnumConstant(TypedConstant constant, SpecialType specialType, long constantToDecode, string typeName)
Symbols\TypeSymbolExtensions.cs (1)
312var typedConstantKind = TypedConstant.GetTypedConstantKind(type, compilation);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (2)
86foreach (var argument in attribute.ConstructorArguments) 99ExpressionSyntax GenerateAttributeSyntax(TypedConstant constant)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (1)
25TypedConstant typedConstant)
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (4)
Microsoft.NetCore.Analyzers\Security\CSharpDataSetDataTableInIFormatterSerializableObjectGraphAnalyzer.cs (1)
15protected override string ToString(TypedConstant typedConstant)
Microsoft.NetCore.Analyzers\Security\CSharpDataSetDataTableInSerializableObjectGraphAnalyzer.cs (1)
15protected override string ToString(TypedConstant typedConstant)
Microsoft.NetCore.Analyzers\Security\CSharpDataSetDataTableInSerializableTypeAnalyzer.cs (1)
15protected override string ToString(TypedConstant typedConstant)
Microsoft.NetCore.Analyzers\Security\CSharpDataSetDataTableInWebSerializableObjectGraphAnalyzer.cs (1)
15protected override string ToString(TypedConstant typedConstant)
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
3445public override SyntaxNode TypedConstantExpression(TypedConstant value)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (2)
86foreach (var argument in attribute.ConstructorArguments) 99ExpressionSyntax GenerateAttributeSyntax(TypedConstant constant)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (1)
25TypedConstant typedConstant)
Microsoft.CodeAnalysis.Features (9)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (8)
6965private sealed class TypedConstantComparer : IEqualityComparer<TypedConstant> 6969public bool Equals(TypedConstant x, TypedConstant y) 6980public int GetHashCode(TypedConstant obj) 6984private sealed class NamedArgumentComparer : IEqualityComparer<KeyValuePair<string, TypedConstant>> 6988public bool Equals(KeyValuePair<string, TypedConstant> x, KeyValuePair<string, TypedConstant> y) 6992public int GetHashCode(KeyValuePair<string, TypedConstant> obj)
EmbeddedLanguages\EmbeddedLanguageDetector.cs (1)
532var argument = attribute.ConstructorArguments[0];
Microsoft.CodeAnalysis.Razor.Compiler (4)
CSharp\DefaultTagHelperDescriptorFactory.cs (1)
161foreach (var value in arg1.Values)
Language\TagHelpers\Producers\ComponentTagHelperProducer.cs (1)
467foreach (var arg in attribute.ConstructorArguments)
Language\TagHelpers\Producers\EventHandlerTagHelperProducer.cs (2)
73static bool TryGetFromTwoArguments(ImmutableArray<TypedConstant> arguments, out AttributeArgs args) 89static bool TryGetFromFourArguments(ImmutableArray<TypedConstant> arguments, out AttributeArgs args)
Microsoft.CodeAnalysis.VisualBasic (113)
Binding\Binder_Attributes.vb (23)
79Dim args As ImmutableArray(Of TypedConstant) = visitor.VisitPositionalArguments(boundAttribute.ConstructorArguments, diagnostics) 80Dim namedArgs As ImmutableArray(Of KeyValuePair(Of String, TypedConstant)) = visitor.VisitNamedArguments(boundAttribute.NamedArguments, diagnostics) 684Public Function VisitPositionalArguments(arguments As ImmutableArray(Of BoundExpression), diag As BindingDiagnosticBag) As ImmutableArray(Of TypedConstant) 688Private Function VisitArguments(arguments As ImmutableArray(Of BoundExpression), diag As BindingDiagnosticBag) As ImmutableArray(Of TypedConstant) 689Dim builder As ArrayBuilder(Of TypedConstant) = Nothing 692builder = ArrayBuilder(Of TypedConstant).GetInstance() 698Return ImmutableArray(Of TypedConstant).Empty 704Public Function VisitNamedArguments(arguments As ImmutableArray(Of BoundExpression), diag As BindingDiagnosticBag) As ImmutableArray(Of KeyValuePair(Of String, TypedConstant)) 705Dim builder As ArrayBuilder(Of KeyValuePair(Of String, TypedConstant)) = Nothing 712builder = ArrayBuilder(Of KeyValuePair(Of String, TypedConstant)).GetInstance() 720Return ImmutableArray(Of KeyValuePair(Of String, TypedConstant)).Empty 726Private Function VisitNamedArgument(argument As BoundExpression, diag As BindingDiagnosticBag) As Nullable(Of KeyValuePair(Of String, TypedConstant)) 734Return New KeyValuePair(Of String, TypedConstant)(left.FieldSymbol.Name, VisitExpression(assignment.Right, diag)) 738Return New KeyValuePair(Of String, TypedConstant)(left.PropertySymbol.Name, VisitExpression(assignment.Right, diag)) 746Public Function VisitExpression(node As BoundExpression, diagBag As BindingDiagnosticBag) As TypedConstant 829Private Function VisitGetType(node As BoundGetType, diagBag As BindingDiagnosticBag) As TypedConstant 851Private Function VisitArrayCreation(node As BoundArrayCreation, diag As BindingDiagnosticBag) As TypedConstant 854Dim values As ImmutableArray(Of TypedConstant) = Nothing 879Private Shared Function CreateTypedConstant(type As ArrayTypeSymbol, array As ImmutableArray(Of TypedConstant)) As TypedConstant 883Private Function CreateTypedConstant(type As TypeSymbol, value As Object) As TypedConstant 884Dim kind = TypedConstant.GetTypedConstantKind(type, _binder.Compilation) 894Private Function CreateErrorTypedConstant(type As TypeSymbol) As TypedConstant
Compilation\ClsComplianceChecker.vb (1)
777Dim args As ImmutableArray(Of TypedConstant) = attributeData.CommonConstructorArguments
Emit\AttributeDataAdapter.vb (4)
65Private Function CreateMetadataExpression(argument As TypedConstant, context As EmitContext) As Cci.IMetadataExpression 80Private Function CreateMetadataArray(argument As TypedConstant, context As EmitContext) As MetadataCreateArray 103Private Function CreateType(argument As TypedConstant, context As EmitContext) As MetadataTypeOf 118Private Function CreateMetadataNamedArgument(name As String, argument As TypedConstant, context As EmitContext) As Cci.IMetadataNamedArgument
Emit\NoPia\EmbeddedType.vb (3)
204Return New SynthesizedAttributeData(TypeManager.ModuleBeingBuilt.Compilation, ctor, ImmutableArray(Of TypedConstant).Empty, ImmutableArray(Of KeyValuePair(Of String, TypedConstant)).Empty) 221ImmutableArray(Of KeyValuePair(Of String, TypedConstant)).Empty)
Emit\NoPia\EmbeddedTypesManager.vb (8)
112Friend Overrides Function CreateSynthesizedAttribute(constructor As WellKnownMember, constructorArguments As ImmutableArray(Of TypedConstant), namedArguments As ImmutableArray(Of KeyValuePair(Of String, TypedConstant)), syntaxNodeOpt As SyntaxNode, diagnostics As DiagnosticBag) As VisualBasicAttributeData 125ImmutableArray(Of KeyValuePair(Of String, TypedConstant)).Empty) 134ImmutableArray(Of KeyValuePair(Of String, TypedConstant)).Empty) 141Friend Overrides Function CreateSynthesizedAttribute(constructor As SpecialMember, constructorArguments As ImmutableArray(Of TypedConstant), namedArguments As ImmutableArray(Of KeyValuePair(Of String, TypedConstant)), syntaxNodeOpt As SyntaxNode, diagnostics As DiagnosticBag) As VisualBasicAttributeData 150Friend Overrides Function TryGetAttributeArguments(attrData As VisualBasicAttributeData, ByRef constructorArguments As ImmutableArray(Of TypedConstant), ByRef namedArguments As ImmutableArray(Of KeyValuePair(Of String, TypedConstant)), syntaxNodeOpt As SyntaxNode, diagnostics As DiagnosticBag) As Boolean
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousDelegate_TemplateSymbol.vb (1)
185ImmutableArray.Create(New KeyValuePair(Of WellKnownMember, TypedConstant)(
Symbols\Attributes\AttributeData.vb (7)
46Public Shadows ReadOnly Property ConstructorArguments As IEnumerable(Of TypedConstant) 55Public Shadows ReadOnly Property NamedArguments As IEnumerable(Of KeyValuePair(Of String, TypedConstant)) 233Dim firstArg As TypedConstant = Me.CommonConstructorArguments.FirstOrDefault() 278typedValue As TypedConstant, 437Dim ctorArgument As TypedConstant = Me.CommonConstructorArguments(0) 464Dim ctorArgument As TypedConstant = Me.CommonConstructorArguments(0) 482Dim ctorArgument As TypedConstant = Me.CommonConstructorArguments(0)
Symbols\Attributes\PEAttributeData.vb (8)
26Private _lazyConstructorArguments As TypedConstant() 27Private _lazyNamedArguments As KeyValuePair(Of String, TypedConstant)() 72Protected Overrides ReadOnly Property CommonConstructorArguments As ImmutableArray(Of TypedConstant) 85Protected Overrides ReadOnly Property CommonNamedArguments As ImmutableArray(Of KeyValuePair(Of String, TypedConstant)) 125Dim constructorArgs As TypedConstant() = Nothing 126Dim namedArgs As KeyValuePair(Of String, TypedConstant)() = Nothing 134Interlocked.CompareExchange(Of KeyValuePair(Of String, TypedConstant)())( 139Interlocked.CompareExchange(Of TypedConstant())(
Symbols\Attributes\RetargetingAttributeData.vb (6)
22Private ReadOnly _constructorArguments As ImmutableArray(Of TypedConstant) 23Private ReadOnly _namedArguments As ImmutableArray(Of KeyValuePair(Of String, TypedConstant)) 28ByVal constructorArguments As ImmutableArray(Of TypedConstant), 29ByVal namedArguments As ImmutableArray(Of KeyValuePair(Of String, TypedConstant))) 58Protected Overrides ReadOnly Property CommonConstructorArguments As ImmutableArray(Of TypedConstant) 64Protected Overrides ReadOnly Property CommonNamedArguments As ImmutableArray(Of KeyValuePair(Of String, TypedConstant))
Symbols\Attributes\SourceAttributeData.vb (7)
25Private ReadOnly _constructorArguments As ImmutableArray(Of TypedConstant) 26Private ReadOnly _namedArguments As ImmutableArray(Of KeyValuePair(Of String, TypedConstant)) 35ByVal constructorArgs As ImmutableArray(Of TypedConstant), 36ByVal namedArgs As ImmutableArray(Of KeyValuePair(Of String, TypedConstant)), 48Me._namedArguments = If(namedArgs.IsDefault, ImmutableArray.Create(Of KeyValuePair(Of String, TypedConstant))(), namedArgs) 71Protected Overrides ReadOnly Property CommonConstructorArguments As ImmutableArray(Of TypedConstant) 77Protected Overrides ReadOnly Property CommonNamedArguments As ImmutableArray(Of KeyValuePair(Of String, TypedConstant))
Symbols\Retargeting\RetargetingSymbolTranslator.vb (14)
698Private Function RetargetAttributeConstructorArguments(constructorArguments As ImmutableArray(Of TypedConstant)) As ImmutableArray(Of TypedConstant) 703Dim newArguments = ArrayBuilder(Of TypedConstant).GetInstance(constructorArguments.Length) 705For Each oldArgument As TypedConstant In constructorArguments 706Dim retargetedArgument As TypedConstant = RetargetTypedConstant(oldArgument, argumentsHaveChanged) 720Private Function RetargetTypedConstant(oldConstant As TypedConstant, ByRef typedConstantChanged As Boolean) As TypedConstant 752Private Function RetargetAttributeNamedArguments(namedArguments As ImmutableArray(Of KeyValuePair(Of String, TypedConstant))) As ImmutableArray(Of KeyValuePair(Of String, TypedConstant)) 757Dim newArguments = ArrayBuilder(Of KeyValuePair(Of String, TypedConstant)).GetInstance(namedArguments.Length) 759For Each oldArgument As KeyValuePair(Of String, TypedConstant) In namedArguments 760Dim oldConstant As TypedConstant = oldArgument.Value 762Dim newConstant As TypedConstant = RetargetTypedConstant(oldConstant, typedConstantChanged) 765newArguments.Add(New KeyValuePair(Of String, TypedConstant)(oldArgument.Key, newConstant))
Symbols\Source\SourceAssemblySymbol.vb (2)
1565ImmutableArray(Of TypedConstant).Empty, 1566ImmutableArray.Create(New KeyValuePair(Of WellKnownMember, TypedConstant)(
Symbols\Source\SourceNamedTypeSymbol.vb (3)
2297Dim argument As TypedConstant = attrData.CommonConstructorArguments(0) 2673arguments:=ImmutableArray(Of TypedConstant).Empty, 2674namedArgs:=ImmutableArray(Of KeyValuePair(Of String, TypedConstant)).Empty))
Symbols\Source\SourceNamedTypeSymbol_ComClass.vb (3)
40Dim args As ImmutableArray(Of TypedConstant) = attrData.CommonConstructorArguments 312Dim typedValue As TypedConstant = attrData(comVisible).CommonConstructorArguments(0) 486Dim typedValue As TypedConstant = attrData(dispIdIndex).CommonConstructorArguments(0)
Symbols\SynthesizedSymbols\SynthesizedAttributeData.vb (10)
21Private ReadOnly _constructorArguments As ImmutableArray(Of TypedConstant) 22Private ReadOnly _namedArguments As ImmutableArray(Of KeyValuePair(Of String, TypedConstant)) 26arguments As ImmutableArray(Of TypedConstant), 27namedArgs As ImmutableArray(Of KeyValuePair(Of String, TypedConstant))) 45Optional arguments As ImmutableArray(Of TypedConstant) = Nothing, 46Optional namedArguments As ImmutableArray(Of KeyValuePair(Of String, TypedConstant)) = Nothing) As SynthesizedAttributeData 58arguments = ImmutableArray(Of TypedConstant).Empty 62namedArguments = ImmutableArray(Of KeyValuePair(Of String, TypedConstant)).Empty 87Protected Overrides ReadOnly Property CommonConstructorArguments As ImmutableArray(Of TypedConstant) 93Protected Overrides ReadOnly Property CommonNamedArguments As ImmutableArray(Of KeyValuePair(Of String, TypedConstant))
Symbols\TypedConstant.vb (4)
28Public Function ToVisualBasicString(constant As TypedConstant) As String 50Private Function DisplayEnumConstant(constant As TypedConstant) As String 66Private Function DisplayUnsignedEnumConstant(constant As TypedConstant, splType As SpecialType, ByVal constantToDecode As ULong, ByVal typeName As String) As String 130Private Function DisplaySignedEnumConstant(constant As TypedConstant, ByVal splType As SpecialType, ByVal constantToDecode As Long, ByVal typeName As String) As String
Symbols\WellKnownMembers.vb (9)
154Optional arguments As ImmutableArray(Of TypedConstant) = Nothing, 155Optional namedArguments As ImmutableArray(Of KeyValuePair(Of WellKnownMember, TypedConstant)) = Nothing, 166arguments = ImmutableArray(Of TypedConstant).Empty 169Dim namedStringArguments As ImmutableArray(Of KeyValuePair(Of String, TypedConstant)) 171namedStringArguments = ImmutableArray(Of KeyValuePair(Of String, TypedConstant)).Empty 173Dim builder = New ArrayBuilder(Of KeyValuePair(Of String, TypedConstant))(namedArguments.Length) 181builder.Add(New KeyValuePair(Of String, TypedConstant)(wellKnownMember.Name, arg.Value)) 707Dim names As ImmutableArray(Of TypedConstant) = TupleNamesEncoder.Encode(type, stringType) 728Public Shared Function Encode(type As TypeSymbol, stringType As TypeSymbol) As ImmutableArray(Of TypedConstant)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.vb (1)
18Public Function GenerateExpression(generator As SyntaxGenerator, typedConstant As TypedConstant) As ExpressionSyntax
Microsoft.CodeAnalysis.VisualBasic.NetAnalyzers (4)
Microsoft.NetCore.Analyzers\Security\BasicDataSetDataTableInIFormatterSerializableObjectGraphAnalyzer.vb (1)
13Protected Overrides Function ToString(typedConstant As TypedConstant) As String
Microsoft.NetCore.Analyzers\Security\BasicDataSetDataTableInSerializableObjectGraphAnalyzer.vb (1)
13Protected Overrides Function ToString(typedConstant As TypedConstant) As String
Microsoft.NetCore.Analyzers\Security\BasicDataSetDataTableInSerializableTypeAnalyzer.vb (1)
13Protected Overrides Function ToString(typedConstant As TypedConstant) As String
Microsoft.NetCore.Analyzers\Security\BasicDataSetDataTableInWebSerializableObjectGraphAnalyzer.vb (1)
13Protected Overrides Function ToString(typedConstant As TypedConstant) As String
Microsoft.CodeAnalysis.VisualBasic.Workspaces (2)
CodeGeneration\VisualBasicSyntaxGenerator.vb (1)
143Public Overrides Function TypedConstantExpression(value As TypedConstant) As SyntaxNode
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.vb (1)
18Public Function GenerateExpression(generator As SyntaxGenerator, typedConstant As TypedConstant) As ExpressionSyntax
Microsoft.CodeAnalysis.Workspaces (10)
Editing\SyntaxGenerator.cs (1)
1866public abstract SyntaxNode TypedConstantExpression(TypedConstant value);
FindSymbols\FindReferences\DependentProjectsFinder.cs (1)
299var typeNameConstant = attr.ConstructorArguments.FirstOrDefault();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (2)
405ImmutableArray<TypedConstant> constructorArguments = default, 406ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments = default)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAttributeData.cs (6)
14ImmutableArray<TypedConstant> constructorArguments, 15ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments) : AttributeData 17private readonly ImmutableArray<TypedConstant> _constructorArguments = constructorArguments.NullToEmpty(); 18private readonly ImmutableArray<KeyValuePair<string, TypedConstant>> _namedArguments = namedArguments.NullToEmpty(); 22protected override ImmutableArray<TypedConstant> CommonConstructorArguments => _constructorArguments; 23protected override ImmutableArray<KeyValuePair<string, TypedConstant>> CommonNamedArguments => _namedArguments;
Microsoft.DotNet.ApiCompatibility (11)
Comparing\AttributeDataEqualityComparer.cs (1)
13IEqualityComparer<TypedConstant> typedConstantEqualityComparer) : IEqualityComparer<AttributeData>
Comparing\NamedArgumentComparer.cs (5)
12public sealed class NamedArgumentComparer(IEqualityComparer<TypedConstant> typedConstantEqualityComparer) : IEqualityComparer<KeyValuePair<string, TypedConstant>> 15public int GetHashCode([DisallowNull] KeyValuePair<string, TypedConstant> obj) => throw new NotImplementedException(); 18public bool Equals(KeyValuePair<string, TypedConstant> x, KeyValuePair<string, TypedConstant> y) =>
Comparing\TypedConstantEqualityComparer.cs (5)
10/// Defines methods to support the comparison of <see cref="TypedConstant"/> for equality. 12public sealed class TypedConstantEqualityComparer(IEqualityComparer<ISymbol> symbolEqualityComparer) : IEqualityComparer<TypedConstant> 15public int GetHashCode([DisallowNull] TypedConstant obj) => throw new NotImplementedException(); 18public bool Equals(TypedConstant x, TypedConstant y)
Microsoft.Extensions.Logging.Generators (6)
LoggerMessageGenerator.Parser.cs (6)
136foreach (TypedConstant typedConstant in attributeData.ConstructorArguments) 145ImmutableArray<TypedConstant> items = attributeData.ConstructorArguments; 191foreach (KeyValuePair<string, TypedConstant> namedArgument in attributeData.NamedArguments) 193TypedConstant typedConstant = namedArgument.Value; 201TypedConstant value = namedArgument.Value; 952private static object GetItem(TypedConstant arg) => arg.Kind == TypedConstantKind.Array ? arg.Values : arg.Value;
Microsoft.Extensions.Options.SourceGeneration (3)
Parser.cs (3)
504ImmutableArray<TypedConstant> arguments = attribute.ConstructorArguments; 508TypedConstant argument = arguments[i]; 778private string GetArrayArgumentExpression(ImmutableArray<Microsoft.CodeAnalysis.TypedConstant> value, bool isParams)
Microsoft.Gen.Logging (1)
Parsing\AttributeProcessors.cs (1)
40foreach (var a in attr.ConstructorArguments)
Microsoft.Gen.Logging.Unit.Tests (4)
LogParserUtilitiesTests.cs (4)
178.SetupGet<ImmutableArray<KeyValuePair<string, TypedConstant>>>("CommonNamedArguments") 179.Returns(ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty); 183.SetupGet<ImmutableArray<TypedConstant>>("CommonConstructorArguments") 184.Returns(ImmutableArray<TypedConstant>.Empty);
Microsoft.Gen.MetadataExtractor (7)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (7)
308foreach (var arg in attribute.ConstructorArguments) 315foreach (var item in arg.Values) 429ImmutableArray<KeyValuePair<string, TypedConstant>> namedArgs = ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty; 430var ctorArg = methodAttribute.ConstructorArguments[0]; 612TypedConstant constructorArg, 613ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments,
Microsoft.Gen.Metrics (7)
Parser.cs (7)
308foreach (var arg in attribute.ConstructorArguments) 315foreach (var item in arg.Values) 429ImmutableArray<KeyValuePair<string, TypedConstant>> namedArgs = ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty; 430var ctorArg = methodAttribute.ConstructorArguments[0]; 612TypedConstant constructorArg, 613ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments,
Microsoft.Gen.MetricsReports (7)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (7)
308foreach (var arg in attribute.ConstructorArguments) 315foreach (var item in arg.Values) 429ImmutableArray<KeyValuePair<string, TypedConstant>> namedArgs = ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty; 430var ctorArg = methodAttribute.ConstructorArguments[0]; 612TypedConstant constructorArg, 613ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments,
Microsoft.Interop.ComInterfaceGenerator (9)
Analyzers\GeneratedComInterfaceAttributeAnalyzer.cs (1)
56TypedConstant ctorArg0 = comInterfaceAttribute.ConstructorArguments[0];
GeneratedComInterfaceAttributeData.cs (2)
67if (args.TryGetValue(nameof(Options), out var options)) 74if (args.TryGetValue(nameof(ExceptionToUnmanagedMarshaller), out TypedConstant exceptionToUnmanagedMarshaller))
VirtualMethodPointerStubGenerator.cs (2)
273foreach (KeyValuePair<string, TypedConstant> arg in unmanagedCallConvAttribute.NamedArguments) 277foreach (TypedConstant callConv in arg.Value.Values)
VtableIndexStubGenerator.cs (4)
211if (namedArguments.TryGetValue(nameof(VirtualMethodIndexCompilationData.Direction), out TypedConstant directionValue)) 221if (namedArguments.TryGetValue(nameof(VirtualMethodIndexCompilationData.ImplicitThisParameter), out TypedConstant implicitThisValue)) 229if (namedArguments.TryGetValue(nameof(VirtualMethodIndexCompilationData.ExceptionMarshalling), out TypedConstant exceptionMarshallingValue)) 240if (namedArguments.TryGetValue(nameof(VirtualMethodIndexCompilationData.ExceptionMarshallingCustomType), out TypedConstant exceptionMarshallingCustomTypeValue))
Microsoft.Interop.LibraryImportGenerator (6)
Analyzers\LibraryImportDiagnosticsAnalyzer.cs (2)
296ImmutableDictionary<string, TypedConstant> namedArguments = ImmutableDictionary.CreateRange(attrData.NamedArguments); 299if (namedArguments.TryGetValue(nameof(LibraryImportCompilationData.EntryPoint), out TypedConstant entryPointValue))
LibraryImportGenerator.cs (4)
103foreach (KeyValuePair<string, TypedConstant> arg in unmanagedCallConvAttribute.NamedArguments) 108foreach (TypedConstant callConv in arg.Value.Values) 178ImmutableDictionary<string, TypedConstant> namedArguments = ImmutableDictionary.CreateRange(attrData.NamedArguments); 181if (namedArguments.TryGetValue(nameof(LibraryImportCompilationData.EntryPoint), out TypedConstant entryPointValue))
Microsoft.Interop.LibraryImportGenerator.Downlevel (4)
DownlevelLibraryImportDiagnosticsAnalyzer.cs (2)
300ImmutableDictionary<string, TypedConstant> namedArguments = ImmutableDictionary.CreateRange(attrData.NamedArguments); 303if (namedArguments.TryGetValue(nameof(LibraryImportCompilationData.EntryPoint), out TypedConstant entryPointValue))
DownlevelLibraryImportGenerator.cs (2)
164ImmutableDictionary<string, TypedConstant> namedArguments = ImmutableDictionary.CreateRange(attrData.NamedArguments); 167if (namedArguments.TryGetValue(nameof(LibraryImportCompilationData.EntryPoint), out TypedConstant entryPointValue))
Microsoft.Interop.SourceGeneration (12)
InteropAttributeData.cs (4)
55public static T WithValuesFromNamedArguments<T>(this T t, ImmutableDictionary<string, TypedConstant> namedArguments) where T : InteropAttributeCompilationData 62if (namedArguments.TryGetValue(nameof(InteropAttributeCompilationData.SetLastError), out TypedConstant setLastErrorValue)) 71if (namedArguments.TryGetValue(nameof(InteropAttributeCompilationData.StringMarshalling), out TypedConstant stringMarshallingValue)) 82if (namedArguments.TryGetValue(nameof(InteropAttributeCompilationData.StringMarshallingCustomType), out TypedConstant stringMarshallingCustomTypeValue))
MarshalAsParser.cs (5)
173ImmutableDictionary<string, TypedConstant> namedArguments = ImmutableDictionary.CreateRange(attributeData.NamedArguments); 176if (namedArguments.TryGetValue(nameof(MarshalAsAttribute.SizeConst), out TypedConstant sizeConstArg)) 180if (namedArguments.TryGetValue(nameof(MarshalAsAttribute.SizeParamIndex), out TypedConstant sizeParamIndexArg)) 188if (namedArguments.TryGetValue(nameof(MarshalAsAttribute.IidParameterIndex), out TypedConstant iidParameterIndexArg)) 218foreach (KeyValuePair<string, TypedConstant> namedArg in attributeData.NamedArguments)
MarshalUsingAttributeParser.cs (3)
66ImmutableDictionary<string, TypedConstant> namedArgs = ImmutableDictionary.CreateRange(attributeData.NamedArguments); 68int elementIndirectionDepth = namedArgs.TryGetValue(ManualTypeMarshallingHelper.MarshalUsingProperties.ElementIndirectionDepth, out TypedConstant value) ? (int)value.Value! : 0; 76foreach (KeyValuePair<string, TypedConstant> arg in attributeData.NamedArguments)
Roslyn.Diagnostics.Analyzers (8)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (2)
405ImmutableArray<TypedConstant> constructorArguments = default, 406ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments = default)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAttributeData.cs (6)
14ImmutableArray<TypedConstant> constructorArguments, 15ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments) : AttributeData 17private readonly ImmutableArray<TypedConstant> _constructorArguments = constructorArguments.NullToEmpty(); 18private readonly ImmutableArray<KeyValuePair<string, TypedConstant>> _namedArguments = namedArguments.NullToEmpty(); 22protected override ImmutableArray<TypedConstant> CommonConstructorArguments => _constructorArguments; 23protected override ImmutableArray<KeyValuePair<string, TypedConstant>> CommonNamedArguments => _namedArguments;
Roslyn.Diagnostics.CSharp.Analyzers (3)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (2)
86foreach (var argument in attribute.ConstructorArguments) 99ExpressionSyntax GenerateAttributeSyntax(TypedConstant constant)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (1)
25TypedConstant typedConstant)
Roslyn.Diagnostics.VisualBasic.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.vb (1)
18Public Function GenerateExpression(generator As SyntaxGenerator, typedConstant As TypedConstant) As ExpressionSyntax
System.Text.Json.SourceGeneration (12)
JsonSourceGenerator.Parser.cs (12)
367foreach (KeyValuePair<string, TypedConstant> namedArg in attributeData.NamedArguments) 381foreach (TypedConstant element in namedArg.Value.Values) 491foreach (TypedConstant element in namedArg.Value.Values) 554foreach (KeyValuePair<string, TypedConstant> namedArg in attributeData.NamedArguments) 902ImmutableArray<KeyValuePair<string, TypedConstant>> namedArgs = attributeData.NamedArguments; 949foreach (KeyValuePair<string, TypedConstant> namedArg in attributeData.NamedArguments) 975foreach (KeyValuePair<string, TypedConstant> namedArg in attributeData.NamedArguments) 2045ImmutableArray<KeyValuePair<string, TypedConstant>> namedArgs = attributeData.NamedArguments; 2065ImmutableArray<TypedConstant> ctorArgs = attributeData.ConstructorArguments; 2071ImmutableArray<TypedConstant> ctorArgs = attributeData.ConstructorArguments; 2077ImmutableArray<TypedConstant> ctorArgs = attributeData.ConstructorArguments; 2084ImmutableArray<TypedConstant> ctorArgs = attributeData.ConstructorArguments;
System.Text.RegularExpressions.Generator (1)
RegexGenerator.Parser.cs (1)
74ImmutableArray<TypedConstant> items = generatedRegexAttr.ConstructorArguments;