79 references to TypedConstant
Microsoft.CodeAnalysis (4)
MetadataReader\MetadataDecoder.cs (3)
2146return new TypedConstant(type, TypedConstantKind.Error, null); 2157return new TypedConstant(type, TypedConstantKind.Error, null); 2160return new TypedConstant(type, kind, value);
Symbols\TypedConstant.cs (1)
35: this(type, TypedConstantKind.Array, value: array.IsDefault ? null : (object)array)
Microsoft.CodeAnalysis.CSharp (48)
Binder\Binder_Attributes.cs (3)
893return new TypedConstant(spread.Expression.Type, TypedConstantKind.Error, value: null); 1050return new TypedConstant(type, TypedConstantKind.Error, null); 1058return new TypedConstant(type, typedConstantKind, simpleValue);
Emitter\Model\PEModuleBuilder.cs (4)
1580var value = flagsBuilder.SelectAsArray((flag, byteType) => new TypedConstant(byteType, TypedConstantKind.Primitive, flag), byteType); 1602ImmutableArray.Create(new TypedConstant(byteType, TypedConstantKind.Primitive, nullableValue))); 1622ImmutableArray.Create(new TypedConstant(Compilation.GetSpecialType(SpecialType.System_Byte), TypedConstantKind.Primitive, value))); 1664var transformFlags = builder.SelectAsArray((flag, constantType) => new TypedConstant(constantType, TypedConstantKind.Primitive, flag), booleanType);
Emitter\NoPia\EmbeddedType.cs (2)
279ImmutableArray.Create(new TypedConstant(stringType, TypedConstantKind.Primitive, guidString), 280new TypedConstant(stringType, TypedConstantKind.Primitive,
Emitter\NoPia\EmbeddedTypesManager.cs (1)
147ImmutableArray.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)
473new TypedConstant(systemByte, TypedConstantKind.Primitive, scale), 474new TypedConstant(systemByte, TypedConstantKind.Primitive, (byte)(isNegative ? 128 : 0)), 475new TypedConstant(systemUnit32, TypedConstantKind.Primitive, high), 476new TypedConstant(systemUnit32, TypedConstantKind.Primitive, mid), 477new TypedConstant(systemUnit32, TypedConstantKind.Primitive, low) 483var ticks = new TypedConstant(GetSpecialType(SpecialType.System_Int64), TypedConstantKind.Primitive, value.Ticks); 498ImmutableArray.Create(new TypedConstant( 765var typedConstantDebugMode = new TypedConstant(debuggingModesType, TypedConstantKind.Enum, constantVal); 818new TypedConstant(attributeTargetsType, TypedConstantKind.Enum, targets)); 820new KeyValuePair<WellKnownMember, TypedConstant>(WellKnownMember.System_AttributeUsageAttribute__AllowMultiple, new TypedConstant(boolType, TypedConstantKind.Primitive, allowMultiple)), 821new KeyValuePair<WellKnownMember, TypedConstant>(WellKnownMember.System_AttributeUsageAttribute__Inherited, new TypedConstant(boolType, TypedConstantKind.Primitive, inherited))); 851new TypedConstant(constantType, TypedConstantKind.Primitive, name), stringType); 898var result = flagsBuilder.SelectAsArray((flag, constantType) => new TypedConstant(constantType, TypedConstantKind.Primitive, flag), booleanType);
Symbols\MethodSymbol.cs (3)
1285new TypedConstant(declaringCompilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, PEModule.RequiredMembersMarker), // message 1286new TypedConstant(declaringCompilation.GetSpecialType(SpecialType.System_Boolean), TypedConstantKind.Primitive, true)) // error 1291ImmutableArray.Create(new TypedConstant(declaringCompilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, nameof(CompilerFeatureRequiredFeatures.RequiredMembers)))
Symbols\Retargeting\RetargetingSymbolTranslator.cs (1)
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); 1973var typedConstantNoStringInterning = new TypedConstant(int32Type, TypedConstantKind.Primitive, Cci.Constants.CompilationRelaxations_NoStringInterning); 1992var typedConstantTrue = new TypedConstant(boolType, TypedConstantKind.Primitive, value: true); 2026var typedConstant = new TypedConstant(stringType, TypedConstantKind.Primitive, _compilation.Options.CryptoKeyContainer); 2036var 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)
143var arg = new TypedConstant(compilation.GetWellKnownType(WellKnownType.System_Type), 231ImmutableArray.Create(new TypedConstant(compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, nameof(CompilerFeatureRequiredFeatures.UserDefinedCompoundAssignmentOperators)))
Symbols\Source\SourceModuleSymbol.cs (2)
650var version = ImmutableArray.Create(new TypedConstant(compilation.GetSpecialType(SpecialType.System_Int32), TypedConstantKind.Primitive, 11)); 657new TypedConstant(compilation.GetSpecialType(SpecialType.System_Boolean), TypedConstantKind.Primitive, _assemblySymbol.InternalsAreVisible));
Symbols\Source\SourceNamedTypeSymbol.cs (5)
1718new TypedConstant(compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, PEModule.ByRefLikeMarker), // message 1719new TypedConstant(compilation.GetSpecialType(SpecialType.System_Boolean), TypedConstantKind.Primitive, true)), // error=true 1724ImmutableArray.Create(new TypedConstant(compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, nameof(CompilerFeatureRequiredFeatures.RefStructs))), 1737var defaultMemberNameConstant = new TypedConstant(compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, defaultMemberName); 1773ImmutableArray.Create(new TypedConstant(compilation.GetWellKnownType(WellKnownType.System_Type), TypedConstantKind.Type, originalType)),
Symbols\Synthesized\SynthesizedInlineArrayTypeSymbol.cs (1)
208arguments: ImmutableArray.Create(new TypedConstant(compilation.GetSpecialType(SpecialType.System_Int32), TypedConstantKind.Primitive, _arrayLength)),
Microsoft.CodeAnalysis.CSharp.Emit3.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));