132 instantiations of TypedConstant
Microsoft.CodeAnalysis (4)
MetadataReader\MetadataDecoder.cs (4)
2229return new TypedConstant(type, TypedConstantKind.Error, null); 2233return new TypedConstant(type, array); 2240return new TypedConstant(type, TypedConstantKind.Error, null); 2243return new TypedConstant(type, kind, value);
Microsoft.CodeAnalysis.CSharp (55)
Binder\Binder_Attributes.cs (7)
748reorderedArguments[^1] = new TypedConstant(paramArray.Type, ImmutableArray<TypedConstant>.Empty); 779return new TypedConstant(parameter.Type, ImmutableArray.Create(constructorArgsArray[currentArgumentIndex])); 788return new TypedConstant(parameter.Type, ImmutableArray<TypedConstant>.Empty); 811return new TypedConstant(parameter.Type, values.AsImmutableOrNull()); 1115return new TypedConstant(type, TypedConstantKind.Error, null); 1119return new TypedConstant(type, arrayValue); 1123return new TypedConstant(type, typedConstantKind, simpleValue);
Emitter\Model\PEModuleBuilder.cs (6)
1615var value = flagsBuilder.SelectAsArray((flag, byteType) => new TypedConstant(byteType, TypedConstantKind.Primitive, flag), byteType); 1618ImmutableArray.Create(new TypedConstant(byteArrayType, value))); 1637ImmutableArray.Create(new TypedConstant(byteType, TypedConstantKind.Primitive, nullableValue))); 1657ImmutableArray.Create(new TypedConstant(Compilation.GetSpecialType(SpecialType.System_Byte), TypedConstantKind.Primitive, value))); 1699var transformFlags = builder.SelectAsArray((flag, constantType) => new TypedConstant(constantType, TypedConstantKind.Primitive, flag), booleanType); 1701var arguments = ImmutableArray.Create(new TypedConstant(boolArray, transformFlags));
Emitter\NoPia\EmbeddedType.cs (2)
280ImmutableArray.Create(new TypedConstant(stringType, TypedConstantKind.Primitive, guidString), 281new TypedConstant(stringType, TypedConstantKind.Primitive,
Emitter\NoPia\EmbeddedTypesManager.cs (1)
148ImmutableArray.Create(new TypedConstant(ctor.Parameters[0].Type, TypedConstantKind.Type, ctor.ContainingAssembly.GetSpecialType(SpecialType.System_Object))),
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.FieldSymbol.cs (1)
155new TypedConstant(manager.System_Diagnostics_DebuggerBrowsableState, TypedConstantKind.Enum, DebuggerBrowsableState.Never))));
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TemplateSymbol.cs (2)
220arguments: ImmutableArray.Create(new TypedConstant(Manager.System_String, TypedConstantKind.Primitive, displayString)), 223new TypedConstant(Manager.System_String, TypedConstantKind.Primitive, "<Anonymous Type>"))));
Symbols\Compilation_WellKnownMembers.cs (15)
467new TypedConstant(systemByte, TypedConstantKind.Primitive, scale), 468new TypedConstant(systemByte, TypedConstantKind.Primitive, (byte)(isNegative ? 128 : 0)), 469new TypedConstant(systemUnit32, TypedConstantKind.Primitive, high), 470new TypedConstant(systemUnit32, TypedConstantKind.Primitive, mid), 471new TypedConstant(systemUnit32, TypedConstantKind.Primitive, low) 477var ticks = new TypedConstant(GetSpecialType(SpecialType.System_Int64), TypedConstantKind.Primitive, value.Ticks); 492ImmutableArray.Create(new TypedConstant( 735var typedConstantDebugMode = new TypedConstant(debuggingModesType, TypedConstantKind.Enum, constantVal); 762var arguments = ImmutableArray.Create(new TypedConstant(boolArray, transformFlags)); 779var args = ImmutableArray.Create(new TypedConstant(stringArray, names)); 788new TypedConstant(attributeTargetsType, TypedConstantKind.Enum, targets)); 790new KeyValuePair<WellKnownMember, TypedConstant>(WellKnownMember.System_AttributeUsageAttribute__AllowMultiple, new TypedConstant(boolType, TypedConstantKind.Primitive, allowMultiple)), 791new KeyValuePair<WellKnownMember, TypedConstant>(WellKnownMember.System_AttributeUsageAttribute__Inherited, new TypedConstant(boolType, TypedConstantKind.Primitive, inherited))); 821new TypedConstant(constantType, TypedConstantKind.Primitive, name), stringType); 868var result = flagsBuilder.SelectAsArray((flag, constantType) => new TypedConstant(constantType, TypedConstantKind.Primitive, flag), booleanType);
Symbols\MethodSymbol.cs (3)
1230new TypedConstant(declaringCompilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, PEModule.RequiredMembersMarker), // message 1231new TypedConstant(declaringCompilation.GetSpecialType(SpecialType.System_Boolean), TypedConstantKind.Primitive, true)) // error 1236ImmutableArray.Create(new TypedConstant(declaringCompilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, nameof(CompilerFeatureRequiredFeatures.RequiredMembers)))
Symbols\Retargeting\RetargetingSymbolTranslator.cs (2)
1271return new TypedConstant(newConstantType, newArray); 1293return new TypedConstant(newConstantType, oldConstant.Kind, newConstantValue);
Symbols\Source\SourceAssemblySymbol.cs (6)
1819var typedConstantRequestMinimum = new TypedConstant(securityActionType, TypedConstantKind.Enum, constantValue); 1825var typedConstantTrue = new TypedConstant(boolType, TypedConstantKind.Primitive, value: true); 1957var typedConstantNoStringInterning = new TypedConstant(int32Type, TypedConstantKind.Primitive, Cci.Constants.CompilationRelaxations_NoStringInterning); 1976var typedConstantTrue = new TypedConstant(boolType, TypedConstantKind.Primitive, value: true); 2010var typedConstant = new TypedConstant(stringType, TypedConstantKind.Primitive, _compilation.Options.CryptoKeyContainer); 2020var typedConstant = new TypedConstant(stringType, TypedConstantKind.Primitive, _compilation.Options.CryptoKeyFile);
Symbols\Source\SourceFixedFieldSymbol.cs (2)
47var item1 = new TypedConstant(systemType, TypedConstantKind.Type, ((PointerTypeSymbol)this.Type).PointedAtType); 48var item2 = new TypedConstant(intType, TypedConstantKind.Primitive, this.FixedSize);
Symbols\Source\SourceMemberMethodSymbol.cs (1)
933var arg = new TypedConstant(compilation.GetWellKnownType(WellKnownType.System_Type),
Symbols\Source\SourceModuleSymbol.cs (2)
592var version = ImmutableArray.Create(new TypedConstant(compilation.GetSpecialType(SpecialType.System_Int32), TypedConstantKind.Primitive, 11)); 599new TypedConstant(compilation.GetSpecialType(SpecialType.System_Boolean), TypedConstantKind.Primitive, _assemblySymbol.InternalsAreVisible));
Symbols\Source\SourceNamedTypeSymbol.cs (5)
1580new TypedConstant(compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, PEModule.ByRefLikeMarker), // message 1581new TypedConstant(compilation.GetSpecialType(SpecialType.System_Boolean), TypedConstantKind.Primitive, true)), // error=true 1586ImmutableArray.Create(new TypedConstant(compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, nameof(CompilerFeatureRequiredFeatures.RefStructs))), 1599var defaultMemberNameConstant = new TypedConstant(compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, defaultMemberName); 1635ImmutableArray.Create(new TypedConstant(compilation.GetWellKnownType(WellKnownType.System_Type), TypedConstantKind.Type, originalType)),
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
Attributes\AttributeTests_Synthesized.cs (1)
1970new TypedConstant(comp.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, "unused"))));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (15)
Symbols\TypedConstantTests.cs (15)
44TypedConstant common = new TypedConstant(_systemType, TypedConstantKind.Type, _namedType); 56TypedConstant commonArray = new TypedConstant(_arrayType, 57new[] { new TypedConstant(_systemType, TypedConstantKind.Type, _namedType) }.AsImmutableOrNull()); 77new TypedConstant(_intType, TypedConstantKind.Primitive, 1), 78new TypedConstant(_intType, TypedConstantKind.Primitive, 1)); 84new TypedConstant(_stringType, TypedConstantKind.Primitive, s1), 85new TypedConstant(_stringType, TypedConstantKind.Primitive, s2)); 88new TypedConstant(_stringType, TypedConstantKind.Primitive, null), 89new TypedConstant(_stringType, TypedConstantKind.Primitive, null)); 92new TypedConstant(_enumString1, TypedConstantKind.Primitive, null), 93new TypedConstant(_enumString2, TypedConstantKind.Primitive, null)); 96new TypedConstant(_stringType, TypedConstantKind.Primitive, null), 97new TypedConstant(_stringType, TypedConstantKind.Error, null)); 100new TypedConstant(_stringType, TypedConstantKind.Primitive, null), 101new TypedConstant(_systemType, TypedConstantKind.Primitive, null));
Microsoft.CodeAnalysis.UnitTests (12)
CommonTypedConstantTests.cs (12)
42new TypedConstant(_intType, TypedConstantKind.Primitive, 1), 43new TypedConstant(_intType, TypedConstantKind.Primitive, 1)); 49new TypedConstant(_stringType, TypedConstantKind.Primitive, s1), 50new TypedConstant(_stringType, TypedConstantKind.Primitive, s2)); 53new TypedConstant(_stringType, TypedConstantKind.Primitive, null), 54new TypedConstant(_stringType, TypedConstantKind.Primitive, null)); 57new TypedConstant(_enumString1, TypedConstantKind.Primitive, null), 58new TypedConstant(_enumString2, TypedConstantKind.Primitive, null)); 61new TypedConstant(_stringType, TypedConstantKind.Primitive, null), 62new TypedConstant(_stringType, TypedConstantKind.Error, null)); 65new TypedConstant(_stringType, TypedConstantKind.Primitive, null), 66new TypedConstant(_enumString1, TypedConstantKind.Primitive, null));
Microsoft.CodeAnalysis.VisualBasic (41)
Binding\Binder_Attributes.vb (4)
877Return New TypedConstant(type, array) 885Return New TypedConstant(type, Nothing) 888Return New TypedConstant(type, kind, value) 893Return New TypedConstant(type, TypedConstantKind.Error, Nothing)
Emit\NoPia\EmbeddedType.vb (2)
220ImmutableArray.Create(New TypedConstant(stringType, TypedConstantKind.Primitive, guidString), 221New TypedConstant(stringType, TypedConstantKind.Primitive, UnderlyingNamedType.AdaptedNamedTypeSymbol.ToDisplayString(SymbolDisplayFormat.QualifiedNameOnlyFormat))),
Emit\NoPia\EmbeddedTypesManager.vb (1)
109ImmutableArray.Create(New TypedConstant(ctor.Parameters(0).Type, TypedConstantKind.Type, ctor.ContainingAssembly.GetSpecialType(SpecialType.System_Object))),
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousDelegate_TemplateSymbol.vb (1)
180Dim 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\Retargeting\RetargetingSymbolTranslator.vb (2)
740Return New TypedConstant(newConstantType, newArray) 756Return New TypedConstant(newConstantType, oldConstant.Kind, newConstantValue)
Symbols\Source\SourceAssemblySymbol.vb (5)
1503Dim typedConstantNoStringInterning = New TypedConstant(int32Type, TypedConstantKind.Primitive, Cci.Constants.CompilationRelaxations_NoStringInterning) 1521Dim typedConstantTrue = New TypedConstant(boolType, TypedConstantKind.Primitive, True) 1559Dim typedConstantDebugMode = New TypedConstant(int32Type, TypedConstantKind.Enum, CInt(debuggingMode)) 1576Dim typedConstant = New TypedConstant(stringType, TypedConstantKind.Primitive, _compilation.Options.CryptoKeyContainer) 1585Dim typedConstant = New TypedConstant(stringType, TypedConstantKind.Primitive, _compilation.Options.CryptoKeyFile)
Symbols\Source\SourceFieldSymbol.vb (1)
675New TypedConstant(specialTypeInt64, TypedConstantKind.Primitive, attributeValue.Ticks))))
Symbols\Source\SourceNamedTypeSymbol.vb (5)
2481New TypedConstant(stringType, TypedConstantKind.Primitive, DefaultPropertyName)))) 2496New TypedConstant(GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, _comClassData.ClassId)))) 2502New TypedConstant(GetSpecialType(SpecialType.System_Int32), TypedConstantKind.Enum, CInt(ClassInterfaceType.None))))) 2523New TypedConstant(GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, eventInterfaceName)))) 2549ImmutableArray.Create(New TypedConstant(compilation.GetWellKnownType(WellKnownType.System_Type), TypedConstantKind.Type, originalType)),
Symbols\Source\SourceNamedTypeSymbol_ComClass.vb (6)
994New TypedConstant(_comClass.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, id)))) 1001New TypedConstant(_comClass.GetSpecialType(SpecialType.System_Int16), 1008ImmutableArray.Create(New TypedConstant(_comClass.GetSpecialType(SpecialType.System_Boolean), 1015ImmutableArray.Create(New TypedConstant(_comClass.GetSpecialType(SpecialType.System_String), 1348ImmutableArray.Create(New TypedConstant(_interface.ComClass.GetSpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32), 1844ImmutableArray.Create(New TypedConstant(_interface.ComClass.GetSpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32),
Symbols\Source\SourceParameterSymbol.vb (1)
284Dim newArgs = ImmutableArray.Create(New TypedConstant(oldTypedConstant.TypeInternal, oldTypedConstant.Kind, correctedParameterName))
Symbols\Source\SourceParameterSymbolBase.vb (1)
63ImmutableArray.Create(New TypedConstant(compilation.GetSpecialType(SpecialType.System_Int64),
Symbols\Source\SourceWithEventsBackingFieldSymbol.vb (1)
75ImmutableArray.Create(New TypedConstant(compilation.GetSpecialType(SpecialType.System_String),
Symbols\WellKnownMembers.vb (10)
220Dim arg = New TypedConstant(GetWellKnownType(WellKnownType.System_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) 260ImmutableArray.Create(New TypedConstant(GetWellKnownType(WellKnownType.System_Diagnostics_DebuggerBrowsableState), 276ImmutableArray.Create(New TypedConstant(GetWellKnownType(WellKnownType.System_ComponentModel_EditorBrowsableState), 712Dim args = ImmutableArray.Create(New TypedConstant(stringArray, names)) 737Return New TypedConstant(constantType, TypedConstantKind.Primitive, name)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (1)
Attributes\AttributeTests_Synthesized.vb (1)
1829New TypedConstant(comp.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, "unused"))))
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (3)
SymbolsTests\TypedConstantTests.vb (3)
34Dim common As TypedConstant = New TypedConstant(_systemType, TypedConstantKind.Type, _namedType) 46Dim commonArray As TypedConstant = New TypedConstant(_arrayType, 47{New TypedConstant(_systemType, TypedConstantKind.Type, _namedType)}.AsImmutableOrNull())
410 references to TypedConstant
Microsoft.CodeAnalysis (54)
MetadataReader\MetadataDecoder.cs (23)
108(KeyValuePair<string, TypedConstant> nameValuePair, bool isProperty, SerializationTypeCode typeCode, SerializationTypeCode elementTypeCode) DecodeCustomAttributeNamedArgumentOrThrow(ref BlobReader argReader); 1481private TypedConstant DecodeCustomAttributeFixedArgumentOrThrow(ref BlobReader sigReader, ref BlobReader argReader) 1498private TypedConstant DecodeCustomAttributeElementOrThrow(ref BlobReader argReader, SerializationTypeCode typeCode, TypeSymbol type) 1518private TypedConstant DecodeCustomAttributeElementArrayOrThrow(ref BlobReader argReader, SerializationTypeCode elementTypeCode, TypeSymbol elementType, TypeSymbol arrayType) 1521TypedConstant[] values; 1529values = Array.Empty<TypedConstant>(); 1533values = new TypedConstant[count]; 1545private TypedConstant DecodeCustomAttributePrimitiveElementOrThrow(ref BlobReader argReader, SerializationTypeCode typeCode, TypeSymbol type) 1615public (KeyValuePair<string, TypedConstant> nameValuePair, bool isProperty, SerializationTypeCode typeCode, SerializationTypeCode elementTypeCode) DecodeCustomAttributeNamedArgumentOrThrow(ref BlobReader argReader) 1638TypedConstant value = typeCode == SerializationTypeCode.SZArray 1642return (new KeyValuePair<string, TypedConstant>(name, value), kind == CustomAttributeNamedArgumentKind.Property, typeCode, elementTypeCode); 1682out TypedConstant[] positionalArgs, 1683out KeyValuePair<string, TypedConstant>[] namedArgs) 1687positionalArgs = Array.Empty<TypedConstant>(); 1688namedArgs = Array.Empty<KeyValuePair<string, TypedConstant>>(); 1727positionalArgs = new TypedConstant[paramCount]; 1739namedArgs = new KeyValuePair<string, TypedConstant>[namedParamCount]; 1752positionalArgs = Array.Empty<TypedConstant>(); 1753namedArgs = Array.Empty<KeyValuePair<String, TypedConstant>>(); 2225private static TypedConstant CreateArrayTypedConstant(TypeSymbol type, ImmutableArray<TypedConstant> array) 2236private static TypedConstant CreateTypedConstant(TypeSymbol type, TypedConstantKind kind, object value) 2246private static TypedConstant CreateTypedConstant(TypeSymbol type, TypedConstantKind kind, bool value)
MetadataReader\PEModule.cs (2)
1202(KeyValuePair<string, TypedConstant> nameValuePair, bool isProperty, SerializationTypeCode typeCode, SerializationTypeCode elementTypeCode) namedArgValues = 1235Func<string, TypedConstant, bool, (bool IsCallConvs, ImmutableHashSet<INamedTypeSymbolInternal>? CallConvs)> unmanagedCallersOnlyDecoder)
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; } 165private static T? DecodeNamedArgument<T>(ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments, string name, SpecialType specialType, T? defaultValue = default) 171private static int IndexOfNamedArgument(ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments, string name) 200ImmutableArray<TypedConstant> args = this.CommonConstructorArguments; 270ImmutableArray<TypedConstant> args = this.CommonConstructorArguments; 520internal static AttributeUsageInfo DecodeAttributeUsageAttribute(TypedConstant positionalArg, ImmutableArray<KeyValuePair<string, TypedConstant>> namedArgs)
Symbols\Attributes\CommonAttributeDataComparer.cs (3)
52private static int GetHashCodeForConstructorArguments(ImmutableArray<TypedConstant> constructorArguments) 56foreach (var arg in constructorArguments) 64private static int GetHashCodeForNamedArguments(ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments)
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. 109public ImmutableArray<TypedConstant> Values 123return (ImmutableArray<TypedConstant>)_value!; 200return obj is TypedConstant && Equals((TypedConstant)obj); 203public 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.CodeStyle.Fixes (8)
CodeGenerationAttributeData.cs (6)
15private readonly ImmutableArray<TypedConstant> _constructorArguments; 16private readonly ImmutableArray<KeyValuePair<string, TypedConstant>> _namedArguments; 20protected override ImmutableArray<TypedConstant> CommonConstructorArguments => _constructorArguments; 21protected override ImmutableArray<KeyValuePair<string, TypedConstant>> CommonNamedArguments => _namedArguments; 26ImmutableArray<TypedConstant> constructorArguments, 27ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments)
CodeGenerationSymbolFactory.cs (2)
407ImmutableArray<TypedConstant> constructorArguments = default, 408ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments = default)
Microsoft.CodeAnalysis.CSharp (172)
Binder\Binder_Attributes.cs (37)
302ImmutableArray<TypedConstant> rewrittenArguments; 681private ImmutableArray<TypedConstant> GetRewrittenAttributeConstructorArguments( 683ImmutableArray<TypedConstant> constructorArgsArray, 700var reorderedArguments = new TypedConstant[parameterCount]; 706TypedConstant reorderedArgument; 748reorderedArguments[^1] = new TypedConstant(paramArray.Type, ImmutableArray<TypedConstant>.Empty); 757private static TypedConstant GetParamArrayArgument( 759ImmutableArray<TypedConstant> constructorArgsArray, 773if (TryGetNormalParamValue(parameter, constructorArgsArray, currentArgumentIndex, conversions, out var namedValue)) 788return new TypedConstant(parameter.Type, ImmutableArray<TypedConstant>.Empty); 793TryGetNormalParamValue(parameter, constructorArgsArray, currentArgumentIndex, conversions, out var lastValue)) 803var values = new TypedConstant[paramArrayArgCount]; 814private static bool TryGetNormalParamValue(ParameterSymbol parameter, ImmutableArray<TypedConstant> constructorArgsArray, 815int argIndex, Conversions conversions, out TypedConstant result) 817TypedConstant argument = constructorArgsArray[argIndex]; 856public ImmutableArray<TypedConstant> VisitArguments(ImmutableArray<BoundExpression> arguments, BindingDiagnosticBag diagnostics, ref bool attrHasErrors, bool parentHasErrors = false) 858var validatedArguments = ImmutableArray<TypedConstant>.Empty; 863var builder = ArrayBuilder<TypedConstant>.GetInstance(numArguments); 877public ImmutableArray<KeyValuePair<string, TypedConstant>> VisitNamedArguments(ImmutableArray<BoundAssignmentOperator> arguments, BindingDiagnosticBag diagnostics, ref bool attrHasErrors) 879ArrayBuilder<KeyValuePair<string, TypedConstant>>? builder = null; 888builder = ArrayBuilder<KeyValuePair<string, TypedConstant>>.GetInstance(); 897return ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty; 903private KeyValuePair<String, TypedConstant>? VisitNamedArgument(BoundAssignmentOperator assignment, BindingDiagnosticBag diagnostics, ref bool attrHasErrors) 905KeyValuePair<String, TypedConstant>? visitedArgument = null; 911visitedArgument = new KeyValuePair<String, TypedConstant>(fa.FieldSymbol.Name, VisitExpression(assignment.Right, diagnostics, ref attrHasErrors, assignment.HasAnyErrors)); 916visitedArgument = new KeyValuePair<String, TypedConstant>(pa.PropertySymbol.Name, VisitExpression(assignment.Right, diagnostics, ref attrHasErrors, assignment.HasAnyErrors)); 930private TypedConstant VisitExpression(BoundExpression node, BindingDiagnosticBag diagnostics, ref bool attrHasErrors, bool curArgumentHasErrors) 940private TypedConstant VisitExpression(BoundExpression node, TypedConstantKind typedConstantKind, BindingDiagnosticBag diagnostics, ref bool attrHasErrors, bool curArgumentHasErrors) 970private TypedConstant VisitConversion(BoundConversion node, BindingDiagnosticBag diagnostics, ref bool attrHasErrors, bool curArgumentHasErrors) 1000private static TypedConstant VisitTypeOfExpression(BoundTypeOfOperator node, BindingDiagnosticBag diagnostics, ref bool attrHasErrors, bool curArgumentHasErrors) 1036private TypedConstant VisitArrayCreation(BoundArrayCreation node, BindingDiagnosticBag diagnostics, ref bool attrHasErrors, bool curArgumentHasErrors) 1049ImmutableArray<TypedConstant> initializer; 1054initializer = ImmutableArray<TypedConstant>.Empty; 1060initializer = ImmutableArray<TypedConstant>.Empty; 1077private static TypedConstant CreateTypedConstant(BoundExpression node, TypedConstantKind typedConstantKind, BindingDiagnosticBag diagnostics, ref bool attrHasErrors, bool curArgumentHasErrors, 1078object? simpleValue = null, ImmutableArray<TypedConstant> arrayValue = default(ImmutableArray<TypedConstant>))
Compiler\ClsComplianceChecker.cs (3)
596foreach (TypedConstant argument in attribute.ConstructorArguments) 613TypedConstant argument = pair.Value; 1201ImmutableArray<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 (20)
198ImmutableArray<TypedConstant>.Empty, 199ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty); 202internal override SynthesizedAttributeData SynthesizeNullableAttribute(WellKnownMember member, ImmutableArray<TypedConstant> arguments) 210ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty); 216internal override SynthesizedAttributeData SynthesizeNullableContextAttribute(ImmutableArray<TypedConstant> arguments) 223ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty); 229internal override SynthesizedAttributeData SynthesizeNullablePublicOnlyAttribute(ImmutableArray<TypedConstant> arguments) 236ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty); 242internal override SynthesizedAttributeData SynthesizeNativeIntegerAttribute(WellKnownMember member, ImmutableArray<TypedConstant> arguments) 250ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty); 262ImmutableArray<TypedConstant>.Empty, 263ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty); 269internal override SynthesizedAttributeData SynthesizeRefSafetyRulesAttribute(ImmutableArray<TypedConstant> arguments) 276ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty); 288ImmutableArray<TypedConstant>.Empty, 289ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty); 301ImmutableArray<TypedConstant>.Empty, 302ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty); 314ImmutableArray<TypedConstant>.Empty, 315ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty);
Emitter\Model\PEModuleBuilder.cs (6)
1640internal virtual SynthesizedAttributeData SynthesizeNullableAttribute(WellKnownMember member, ImmutableArray<TypedConstant> arguments) 1660internal virtual SynthesizedAttributeData SynthesizeNullableContextAttribute(ImmutableArray<TypedConstant> arguments) 1693attribute = SynthesizeNativeIntegerAttribute(WellKnownMember.System_Runtime_CompilerServices_NativeIntegerAttribute__ctor, ImmutableArray<TypedConstant>.Empty); 1709internal virtual SynthesizedAttributeData SynthesizeNativeIntegerAttribute(WellKnownMember member, ImmutableArray<TypedConstant> arguments) 1740internal virtual SynthesizedAttributeData SynthesizeRefSafetyRulesAttribute(ImmutableArray<TypedConstant> arguments) 1754internal virtual SynthesizedAttributeData SynthesizeNullablePublicOnlyAttribute(ImmutableArray<TypedConstant> arguments)
Emitter\NoPia\EmbeddedType.cs (3)
263return new SynthesizedAttributeData(ctor, ImmutableArray<TypedConstant>.Empty, ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty); 283ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty);
Emitter\NoPia\EmbeddedTypesManager.cs (3)
139ImmutableArray.Create<TypedConstant>(attrData.CommonConstructorArguments[0], attrData.CommonConstructorArguments[0]), 140ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty); 149ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty);
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TemplateSymbol.cs (1)
221namedArguments: ImmutableArray.Create(new KeyValuePair<WellKnownMember, TypedConstant>(
Symbols\Attributes\AttributeData.cs (12)
65public new IEnumerable<TypedConstant> ConstructorArguments 73public new IEnumerable<KeyValuePair<string, TypedConstant>> NamedArguments 174foreach (var constructorArgument in this.CommonConstructorArguments) 275var value = arguments.Attribute.CommonConstructorArguments[0]; 293foreach (var member in value.Values) 325var value = arguments.Attribute.CommonConstructorArguments[1]; 344foreach (var member in value.Values) 388TypedConstant firstArg = ctorArgs.First(); 402private DeclarativeSecurityAction DecodeSecurityAction(TypedConstant typedValue, Symbol targetSymbol, AttributeSyntax? nodeOpt, BindingDiagnosticBag diagnostics, out bool hasErrors) 490private static Location GetSecurityAttributeActionSyntaxLocation(AttributeSyntax? nodeOpt, TypedConstant typedValue, out object displayString) 596TypedConstant ctorArgument = this.CommonConstructorArguments[0]; 622TypedConstant ctorArgument = this.CommonConstructorArguments[0];
Symbols\Attributes\PEAttributeData.cs (8)
23private ImmutableArray<TypedConstant> _lazyConstructorArguments; 24private ImmutableArray<KeyValuePair<string, TypedConstant>> _lazyNamedArguments; 56protected internal override ImmutableArray<TypedConstant> CommonConstructorArguments 65protected internal override ImmutableArray<KeyValuePair<string, TypedConstant>> CommonNamedArguments 102TypedConstant[]? lazyConstructorArguments = null; 103KeyValuePair<string, TypedConstant>[]? lazyNamedArguments = null; 113ImmutableArray.Create<TypedConstant>(lazyConstructorArguments)); 116ImmutableArray.Create<KeyValuePair<string, TypedConstant>>(lazyNamedArguments));
Symbols\Attributes\RetargetingAttributeData.cs (2)
19ImmutableArray<TypedConstant> constructorArguments, 21ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments,
Symbols\Attributes\SourceAttributeData.cs (8)
22private readonly ImmutableArray<TypedConstant> _constructorArguments; 24private readonly ImmutableArray<KeyValuePair<string, TypedConstant>> _namedArguments; 33ImmutableArray<TypedConstant> constructorArguments, 35ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments, 61constructorArguments: ImmutableArray<TypedConstant>.Empty, 63namedArguments: ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty, 172protected internal sealed override ImmutableArray<TypedConstant> CommonConstructorArguments 177protected internal sealed override ImmutableArray<KeyValuePair<string, TypedConstant>> CommonNamedArguments
Symbols\Compilation_WellKnownMembers.cs (15)
387ImmutableArray<TypedConstant> arguments = default, 388ImmutableArray<KeyValuePair<WellKnownMember, TypedConstant>> namedArguments = default, 402arguments = ImmutableArray<TypedConstant>.Empty; 405ImmutableArray<KeyValuePair<string, TypedConstant>> namedStringArguments; 408namedStringArguments = ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty; 412var builder = new ArrayBuilder<KeyValuePair<string, TypedConstant>>(namedArguments.Length); 424builder.Add(new KeyValuePair<string, TypedConstant>( 448arguments: ImmutableArray<TypedConstant>.Empty, 449namedArguments: ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty); 477var ticks = new TypedConstant(GetSpecialType(SpecialType.System_Int64), TypedConstantKind.Primitive, value.Ticks); 735var typedConstantDebugMode = new TypedConstant(debuggingModesType, TypedConstantKind.Enum, constantVal); 790new KeyValuePair<WellKnownMember, TypedConstant>(WellKnownMember.System_AttributeUsageAttribute__AllowMultiple, new TypedConstant(boolType, TypedConstantKind.Primitive, allowMultiple)), 791new KeyValuePair<WellKnownMember, TypedConstant>(WellKnownMember.System_AttributeUsageAttribute__Inherited, new TypedConstant(boolType, TypedConstantKind.Primitive, inherited))); 810public static ImmutableArray<TypedConstant> Encode(TypeSymbol type, TypeSymbol stringType) 861internal static ImmutableArray<TypedConstant> Encode(TypeSymbol type, RefKind refKind, int customModifiersCount, TypeSymbol booleanType)
Symbols\Metadata\PE\PENamedTypeSymbol.cs (2)
2386TypedConstant[] positionalArgs; 2387KeyValuePair<string, TypedConstant>[] namedArgs;
Symbols\MethodSymbol.cs (2)
981TypedConstant value, 1000foreach (var callConvTypedConstant in value.Values)
Symbols\Retargeting\RetargetingSymbolTranslator.cs (19)
1212ImmutableArray<TypedConstant> oldAttributeCtorArguments = oldAttribute.CommonConstructorArguments; 1213ImmutableArray<TypedConstant> newAttributeCtorArguments = RetargetAttributeConstructorArguments(oldAttributeCtorArguments); 1215ImmutableArray<KeyValuePair<string, TypedConstant>> oldAttributeNamedArguments = oldAttribute.CommonNamedArguments; 1216ImmutableArray<KeyValuePair<string, TypedConstant>> newAttributeNamedArguments = RetargetAttributeNamedArguments(oldAttributeNamedArguments); 1232private ImmutableArray<TypedConstant> RetargetAttributeConstructorArguments(ImmutableArray<TypedConstant> constructorArguments) 1234ImmutableArray<TypedConstant> retargetedArguments = constructorArguments; 1239var newArguments = ArrayBuilder<TypedConstant>.GetInstance(constructorArguments.Length); 1241foreach (TypedConstant oldArgument in constructorArguments) 1243TypedConstant retargetedArgument = RetargetTypedConstant(oldArgument, ref argumentsHaveChanged); 1258private TypedConstant RetargetTypedConstant(TypedConstant oldConstant, ref bool typedConstantChanged) 1301private ImmutableArray<KeyValuePair<string, TypedConstant>> RetargetAttributeNamedArguments(ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments) 1308var newArguments = ArrayBuilder<KeyValuePair<string, TypedConstant>>.GetInstance(namedArguments.Length); 1310foreach (KeyValuePair<string, TypedConstant> oldArgument in namedArguments) 1312TypedConstant oldConstant = oldArgument.Value; 1314TypedConstant newConstant = RetargetTypedConstant(oldConstant, ref typedConstantChanged); 1318newArguments.Add(new KeyValuePair<string, TypedConstant>(oldArgument.Key, newConstant));
Symbols\Source\SourceAssemblySymbol.cs (9)
1819var typedConstantRequestMinimum = new TypedConstant(securityActionType, TypedConstantKind.Enum, constantValue); 1825var typedConstantTrue = new TypedConstant(boolType, TypedConstantKind.Primitive, value: true); 1830ImmutableArray.Create(new KeyValuePair<WellKnownMember, TypedConstant>( 1957var typedConstantNoStringInterning = new TypedConstant(int32Type, TypedConstantKind.Primitive, Cci.Constants.CompilationRelaxations_NoStringInterning); 1976var typedConstantTrue = new TypedConstant(boolType, TypedConstantKind.Primitive, value: true); 1980ImmutableArray<TypedConstant>.Empty, 1981ImmutableArray.Create(new KeyValuePair<WellKnownMember, TypedConstant>( 2010var typedConstant = new TypedConstant(stringType, TypedConstantKind.Primitive, _compilation.Options.CryptoKeyContainer); 2020var typedConstant = new TypedConstant(stringType, TypedConstantKind.Primitive, _compilation.Options.CryptoKeyFile);
Symbols\Source\SourceComplexParameterSymbol.cs (4)
960var arg = attribute.CommonConstructorArguments[0]; 1252TypedConstant constructorArgument = arguments.Attribute.CommonConstructorArguments[0]; 1284foreach (var nestedArgument in constructorArgument.Values) 1315(int Ordinal, ParameterSymbol? Parameter)? decodeName(TypedConstant constant, ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments)
Symbols\Source\SourceFixedFieldSymbol.cs (3)
47var item1 = new TypedConstant(systemType, TypedConstantKind.Type, ((PointerTypeSymbol)this.Type).PointedAtType); 48var item2 = new TypedConstant(intType, TypedConstantKind.Primitive, this.FixedSize); 51ImmutableArray.Create<TypedConstant>(item1, item2)));
Symbols\Source\SourceMemberMethodSymbol.cs (1)
933var arg = new TypedConstant(compilation.GetWellKnownType(WellKnownType.System_Type),
Symbols\Source\SourceNamedTypeSymbol.cs (2)
1257TypedConstant argument = attribute.CommonConstructorArguments[0]; 1599var defaultMemberNameConstant = new TypedConstant(compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, defaultMemberName);
Symbols\Source\SynthesizedAttributeData.cs (2)
16internal SynthesizedAttributeData(MethodSymbol wellKnownMember, ImmutableArray<TypedConstant> arguments, ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments)
Symbols\TypedConstantExtensions.cs (4)
18public static string ToCSharpString(this TypedConstant constant) 47private static string DisplayEnumConstant(TypedConstant constant) 67private static string DisplayUnsignedEnumConstant(TypedConstant constant, SpecialType specialType, ulong constantToDecode, string typeName) 146private static string DisplaySignedEnumConstant(TypedConstant constant, SpecialType specialType, long constantToDecode, string typeName)
Symbols\TypeSymbolExtensions.cs (1)
273var typedConstantKind = TypedConstant.GetTypedConstantKind(type, compilation);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
ExpressionGenerator.cs (1)
25SyntaxGenerator generator, TypedConstant typedConstant)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (5)
CodeGen\CodeGenAsyncIteratorTests.cs (1)
858var argument = attribute.ConstructorArguments.Single();
CodeGen\CodeGenFunctionPointersTests.cs (2)
11757var arg = attr.ConstructorArguments.Single(); 11789var arg = attr.ConstructorArguments.Single();
CodeGen\CodeGenLocalFunctionTests.cs (1)
5331var arg = attrs1[1].ConstructorArguments.Single();
Emit\OptionalArgumentsTests.cs (1)
227var argument = attribute.ConstructorArguments.Last();
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (7)
Attributes\AttributeTests.cs (1)
4603var ca = goo.GetAttributes().First().CommonConstructorArguments.First();
Attributes\AttributeTests_Dynamic.cs (3)
540TypedConstant argument = dynamicAttribute.CommonConstructorArguments.Single(); 543ImmutableArray<TypedConstant> actualTransformFlags = argument.Values; 548TypedConstant actualTransformFlag = actualTransformFlags[i];
Attributes\AttributeTests_Synthesized.cs (1)
1968namedArguments: ImmutableArray.Create(new KeyValuePair<WellKnownMember, TypedConstant>(
Attributes\AttributeTests_Tuples.cs (2)
637var arg = tupleAttr.CommonConstructorArguments.Single(); 645private static string TypedConstantString(TypedConstant constant)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (3)
Semantics\BindingTests.cs (3)
2571var i = a.ConstructorArguments.Single(); 2601var i = a.ConstructorArguments.Single(); 2631var i = a.ConstructorArguments.Single();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (12)
Symbols\Metadata\PE\LoadingAttributes.cs (2)
549foreach (var pa in sa.CommonConstructorArguments) 570private static void CheckNamedArg(KeyValuePair<string, string> expected, KeyValuePair<string, TypedConstant> actual)
Symbols\TypedConstantTests.cs (10)
44TypedConstant common = new TypedConstant(_systemType, TypedConstantKind.Type, _namedType); 45TypedConstant lang = (TypedConstant)common; 46TypedConstant common2 = lang; 56TypedConstant commonArray = new TypedConstant(_arrayType, 59TypedConstant langArray = (TypedConstant)commonArray; 60TypedConstant commonArray2 = langArray; 74EqualityTesting.AssertEqual(default(TypedConstant), default(TypedConstant));
Microsoft.CodeAnalysis.CSharp.Test.Utilities (7)
Extensions.cs (5)
368var arg = attr.CommonConstructorArguments[i]; 377var arg = namedArg.Value; 382internal static bool IsEqual(TypedConstant arg, object expected) 497private static bool AreEqual(ImmutableArray<TypedConstant> tc, object o) 518var c = tc[i];
TestAttributesVisitor.cs (2)
175static void printValues(StringBuilder builder, ImmutableArray<TypedConstant> values) 187static void printValue(StringBuilder builder, TypedConstant value)
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (3)
Metadata\WinMdDumpTest.cs (3)
253foreach (var arg in attribute.ConstructorArguments) 288private static void AppendConstant(StringBuilder result, TypedConstant constant) 296foreach (var item in constant.Values)
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
3375public override SyntaxNode TypedConstantExpression(TypedConstant value)
ExpressionGenerator.cs (1)
25SyntaxGenerator generator, TypedConstant typedConstant)
Microsoft.CodeAnalysis.Features (9)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (8)
6022private sealed class TypedConstantComparer : IEqualityComparer<TypedConstant> 6026public bool Equals(TypedConstant x, TypedConstant y) 6036public int GetHashCode(TypedConstant obj) 6040private sealed class NamedArgumentComparer : IEqualityComparer<KeyValuePair<string, TypedConstant>> 6044public bool Equals(KeyValuePair<string, TypedConstant> x, KeyValuePair<string, TypedConstant> y) 6048public int GetHashCode(KeyValuePair<string, TypedConstant> obj)
EmbeddedLanguages\EmbeddedLanguageDetector.cs (1)
359var argument = attribute.ConstructorArguments[0];
Microsoft.CodeAnalysis.UnitTests (2)
CommonTypedConstantTests.cs (2)
39EqualityTesting.AssertEqual(default(TypedConstant), default(TypedConstant));
Microsoft.CodeAnalysis.VisualBasic (99)
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) 681Public Function VisitPositionalArguments(arguments As ImmutableArray(Of BoundExpression), diag As BindingDiagnosticBag) As ImmutableArray(Of TypedConstant) 685Private Function VisitArguments(arguments As ImmutableArray(Of BoundExpression), diag As BindingDiagnosticBag) As ImmutableArray(Of TypedConstant) 686Dim builder As ArrayBuilder(Of TypedConstant) = Nothing 689builder = ArrayBuilder(Of TypedConstant).GetInstance() 695Return ImmutableArray(Of TypedConstant).Empty 701Public Function VisitNamedArguments(arguments As ImmutableArray(Of BoundExpression), diag As BindingDiagnosticBag) As ImmutableArray(Of KeyValuePair(Of String, TypedConstant)) 702Dim builder As ArrayBuilder(Of KeyValuePair(Of String, TypedConstant)) = Nothing 709builder = ArrayBuilder(Of KeyValuePair(Of String, TypedConstant)).GetInstance() 717Return ImmutableArray(Of KeyValuePair(Of String, TypedConstant)).Empty 723Private Function VisitNamedArgument(argument As BoundExpression, diag As BindingDiagnosticBag) As Nullable(Of KeyValuePair(Of String, TypedConstant)) 731Return New KeyValuePair(Of String, TypedConstant)(left.FieldSymbol.Name, VisitExpression(assignment.Right, diag)) 735Return New KeyValuePair(Of String, TypedConstant)(left.PropertySymbol.Name, VisitExpression(assignment.Right, diag)) 743Public Function VisitExpression(node As BoundExpression, diagBag As BindingDiagnosticBag) As TypedConstant 826Private Function VisitGetType(node As BoundGetType, diagBag As BindingDiagnosticBag) As TypedConstant 848Private Function VisitArrayCreation(node As BoundArrayCreation, diag As BindingDiagnosticBag) As TypedConstant 851Dim values As ImmutableArray(Of TypedConstant) = Nothing 876Private Shared Function CreateTypedConstant(type As ArrayTypeSymbol, array As ImmutableArray(Of TypedConstant)) As TypedConstant 880Private Function CreateTypedConstant(type As TypeSymbol, value As Object) As TypedConstant 881Dim kind = TypedConstant.GetTypedConstantKind(type, _binder.Compilation) 891Private 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)
205Return New SynthesizedAttributeData(ctor, ImmutableArray(Of TypedConstant).Empty, ImmutableArray(Of KeyValuePair(Of String, TypedConstant)).Empty) 222ImmutableArray(Of KeyValuePair(Of String, TypedConstant)).Empty)
Emit\NoPia\EmbeddedTypesManager.vb (2)
101ImmutableArray(Of KeyValuePair(Of String, TypedConstant)).Empty) 110ImmutableArray(Of KeyValuePair(Of String, TypedConstant)).Empty)
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousDelegate_TemplateSymbol.vb (1)
184ImmutableArray.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)) 236Dim firstArg As TypedConstant = Me.CommonConstructorArguments.FirstOrDefault() 281typedValue As TypedConstant, 440Dim ctorArgument As TypedConstant = Me.CommonConstructorArguments(0) 467Dim ctorArgument As TypedConstant = Me.CommonConstructorArguments(0) 485Dim 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 (2)
21ByVal constructorArguments As ImmutableArray(Of TypedConstant), 22ByVal namedArguments As ImmutableArray(Of KeyValuePair(Of String, TypedConstant)),
Symbols\Attributes\SourceAttributeData.vb (7)
24Private ReadOnly _constructorArguments As ImmutableArray(Of TypedConstant) 25Private ReadOnly _namedArguments As ImmutableArray(Of KeyValuePair(Of String, TypedConstant)) 33ByVal constructorArgs As ImmutableArray(Of TypedConstant), 34ByVal namedArgs As ImmutableArray(Of KeyValuePair(Of String, TypedConstant)), 43Me._namedArguments = If(namedArgs.IsDefault, ImmutableArray.Create(Of KeyValuePair(Of String, TypedConstant))(), namedArgs) 66Protected Overrides ReadOnly Property CommonConstructorArguments As ImmutableArray(Of TypedConstant) 72Protected Overrides ReadOnly Property CommonNamedArguments As ImmutableArray(Of KeyValuePair(Of String, TypedConstant))
Symbols\Metadata\PE\PENamedTypeSymbol.vb (2)
1448Dim positionalArgs As TypedConstant() = Nothing 1449Dim namedArgs As KeyValuePair(Of String, TypedConstant)() = Nothing
Symbols\Retargeting\RetargetingSymbolTranslator.vb (14)
708Private Function RetargetAttributeConstructorArguments(constructorArguments As ImmutableArray(Of TypedConstant)) As ImmutableArray(Of TypedConstant) 713Dim newArguments = ArrayBuilder(Of TypedConstant).GetInstance(constructorArguments.Length) 715For Each oldArgument As TypedConstant In constructorArguments 716Dim retargetedArgument As TypedConstant = RetargetTypedConstant(oldArgument, argumentsHaveChanged) 730Private Function RetargetTypedConstant(oldConstant As TypedConstant, ByRef typedConstantChanged As Boolean) As TypedConstant 762Private Function RetargetAttributeNamedArguments(namedArguments As ImmutableArray(Of KeyValuePair(Of String, TypedConstant))) As ImmutableArray(Of KeyValuePair(Of String, TypedConstant)) 767Dim newArguments = ArrayBuilder(Of KeyValuePair(Of String, TypedConstant)).GetInstance(namedArguments.Length) 769For Each oldArgument As KeyValuePair(Of String, TypedConstant) In namedArguments 770Dim oldConstant As TypedConstant = oldArgument.Value 772Dim newConstant As TypedConstant = RetargetTypedConstant(oldConstant, typedConstantChanged) 775newArguments.Add(New KeyValuePair(Of String, TypedConstant)(oldArgument.Key, newConstant))
Symbols\Source\SourceAssemblySymbol.vb (2)
1525ImmutableArray(Of TypedConstant).Empty, 1526ImmutableArray.Create(New KeyValuePair(Of WellKnownMember, TypedConstant)(
Symbols\Source\SourceNamedTypeSymbol.vb (1)
2208Dim argument As TypedConstant = attrData.CommonConstructorArguments(0)
Symbols\Source\SourceNamedTypeSymbol_ComClass.vb (3)
38Dim args As ImmutableArray(Of TypedConstant) = attrData.CommonConstructorArguments 310Dim typedValue As TypedConstant = attrData(comVisible).CommonConstructorArguments(0) 484Dim typedValue As TypedConstant = attrData(dispIdIndex).CommonConstructorArguments(0)
Symbols\SynthesizedSymbols\SynthesizedAttributeData.vb (6)
20arguments As ImmutableArray(Of TypedConstant), 21namedArgs As ImmutableArray(Of KeyValuePair(Of String, TypedConstant))) 41Optional arguments As ImmutableArray(Of TypedConstant) = Nothing, 42Optional namedArguments As ImmutableArray(Of KeyValuePair(Of String, TypedConstant)) = Nothing) As SynthesizedAttributeData 54arguments = ImmutableArray(Of TypedConstant).Empty 58namedArguments = ImmutableArray(Of KeyValuePair(Of String, TypedConstant)).Empty
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.Emit.UnitTests (2)
Attributes\AttributeTests_Synthesized.vb (1)
1827namedArguments:=ImmutableArray.Create(New KeyValuePair(Of WellKnownMember, TypedConstant)(
Attributes\AttributeTests_Tuples.vb (1)
442Private Shared Function TypedConstantString(constant As TypedConstant) As String
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (10)
SymbolsTests\TypedConstantTests.vb (10)
34Dim common As TypedConstant = New TypedConstant(_systemType, TypedConstantKind.Type, _namedType) 35Dim lang As TypedConstant = CType(common, TypedConstant) 36Dim common2 As TypedConstant = lang 46Dim commonArray As TypedConstant = New TypedConstant(_arrayType, 48Dim langArray As TypedConstant = CType(commonArray, TypedConstant) 49Dim commonArray2 As TypedConstant = langArray 59Assert.Equal(common2, CType(lang, TypedConstant)) 60Assert.IsType(Of Microsoft.CodeAnalysis.TypedConstant)(common2)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (2)
Extensions.vb (2)
178Private Function IsEqual(Of T)(ByVal arg As TypedConstant, ByVal expected As T) As Boolean 278Private Function AreEqual(tc As ImmutableArray(Of TypedConstant), o As Object) As Boolean
Microsoft.CodeAnalysis.VisualBasic.Workspaces (2)
CodeGeneration\ExpressionGenerator.vb (1)
18Public Function GenerateExpression(generator As SyntaxGenerator, typedConstant As TypedConstant) As ExpressionSyntax
CodeGeneration\VisualBasicSyntaxGenerator.vb (1)
162Public Overrides Function TypedConstantExpression(value As TypedConstant) As SyntaxNode
Microsoft.CodeAnalysis.Workspaces (10)
CodeGenerationAttributeData.cs (6)
15private readonly ImmutableArray<TypedConstant> _constructorArguments; 16private readonly ImmutableArray<KeyValuePair<string, TypedConstant>> _namedArguments; 20protected override ImmutableArray<TypedConstant> CommonConstructorArguments => _constructorArguments; 21protected override ImmutableArray<KeyValuePair<string, TypedConstant>> CommonNamedArguments => _namedArguments; 26ImmutableArray<TypedConstant> constructorArguments, 27ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments)
CodeGenerationSymbolFactory.cs (2)
407ImmutableArray<TypedConstant> constructorArguments = default, 408ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments = default)
Editing\SyntaxGenerator.cs (1)
1796public abstract SyntaxNode TypedConstantExpression(TypedConstant value);
FindSymbols\FindReferences\DependentProjectsFinder.cs (1)
241var typeNameConstant = attr.ConstructorArguments.FirstOrDefault();