116 references to TypedConstant
Microsoft.CodeAnalysis (4)
MetadataReader\MetadataDecoder.cs (3)
2229return new TypedConstant(type, TypedConstantKind.Error, null); 2240return new TypedConstant(type, TypedConstantKind.Error, null); 2243return new TypedConstant(type, kind, value);
Symbols\TypedConstant.cs (1)
35: this(type, TypedConstantKind.Array, value: array.IsDefault ? null : (object)array)
Microsoft.CodeAnalysis.CSharp (45)
Binder\Binder_Attributes.cs (2)
1115return new TypedConstant(type, TypedConstantKind.Error, null); 1123return new TypedConstant(type, typedConstantKind, simpleValue);
Emitter\Model\PEModuleBuilder.cs (4)
1615var value = flagsBuilder.SelectAsArray((flag, byteType) => new TypedConstant(byteType, TypedConstantKind.Primitive, flag), byteType); 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);
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 (13)
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); 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 (1)
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 (14)
Symbols\TypedConstantTests.cs (14)
44TypedConstant common = new TypedConstant(_systemType, TypedConstantKind.Type, _namedType); 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 (37)
Binding\Binder_Attributes.vb (2)
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 (1)
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 (9)
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), 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 (2)
SymbolsTests\TypedConstantTests.vb (2)
34Dim common As TypedConstant = New TypedConstant(_systemType, TypedConstantKind.Type, _namedType) 47{New TypedConstant(_systemType, TypedConstantKind.Type, _namedType)}.AsImmutableOrNull())