132 instantiations of TypedConstant
Microsoft.CodeAnalysis (4)
Microsoft.CodeAnalysis.CSharp (55)
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));
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\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\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)
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)
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\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\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)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (3)
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)
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)
Microsoft.CodeAnalysis.CodeStyle.Fixes (8)
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>))
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);
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\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);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (5)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (7)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (3)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (12)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (7)
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (3)
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
Microsoft.CodeAnalysis.Features (9)
Microsoft.CodeAnalysis.UnitTests (2)
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
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)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (10)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (2)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (2)
Microsoft.CodeAnalysis.Workspaces (10)