329 references to Primitive
Microsoft.CodeAnalysis (3)
MetadataReader\MetadataDecoder.cs (2)
1590
TypedConstantKind.
Primitive
:
1610
return (type.TypeKind == TypeKind.Enum) ? TypedConstantKind.Enum : TypedConstantKind.
Primitive
;
Symbols\TypedConstant.cs (1)
176
return TypedConstantKind.
Primitive
;
Microsoft.CodeAnalysis.CodeStyle (3)
AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
828
attribute.ConstructorArguments is [_, { Kind: TypedConstantKind.
Primitive
, Value: string checkId }, ..])
839
Kind: TypedConstantKind.
Primitive
,
AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
590
attribute.ConstructorArguments is [{ Kind: TypedConstantKind.
Primitive
, Type.SpecialType: SpecialType.System_String, Value: string value }])
Microsoft.CodeAnalysis.CSharp (35)
Emitter\Model\PEModuleBuilder.cs (4)
1615
var value = flagsBuilder.SelectAsArray((flag, byteType) => new TypedConstant(byteType, TypedConstantKind.
Primitive
, flag), byteType);
1637
ImmutableArray.Create(new TypedConstant(byteType, TypedConstantKind.
Primitive
, nullableValue)));
1657
ImmutableArray.Create(new TypedConstant(Compilation.GetSpecialType(SpecialType.System_Byte), TypedConstantKind.
Primitive
, value)));
1699
var transformFlags = builder.SelectAsArray((flag, constantType) => new TypedConstant(constantType, TypedConstantKind.
Primitive
, flag), booleanType);
Emitter\NoPia\EmbeddedType.cs (2)
280
ImmutableArray.Create(new TypedConstant(stringType, TypedConstantKind.
Primitive
, guidString),
281
new TypedConstant(stringType, TypedConstantKind.
Primitive
,
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TemplateSymbol.cs (2)
220
arguments: ImmutableArray.Create(new TypedConstant(Manager.System_String, TypedConstantKind.
Primitive
, displayString)),
223
new TypedConstant(Manager.System_String, TypedConstantKind.
Primitive
, "<Anonymous Type>"))));
Symbols\Attributes\AttributeData.cs (2)
597
Debug.Assert(ctorArgument.Kind == TypedConstantKind.Enum || ctorArgument.Kind == TypedConstantKind.
Primitive
);
623
Debug.Assert(ctorArgument.Kind == TypedConstantKind.Enum || ctorArgument.Kind == TypedConstantKind.
Primitive
);
Symbols\Compilation_WellKnownMembers.cs (10)
467
new TypedConstant(systemByte, TypedConstantKind.
Primitive
, scale),
468
new TypedConstant(systemByte, TypedConstantKind.
Primitive
, (byte)(isNegative ? 128 : 0)),
469
new TypedConstant(systemUnit32, TypedConstantKind.
Primitive
, high),
470
new TypedConstant(systemUnit32, TypedConstantKind.
Primitive
, mid),
471
new TypedConstant(systemUnit32, TypedConstantKind.
Primitive
, low)
477
var ticks = new TypedConstant(GetSpecialType(SpecialType.System_Int64), TypedConstantKind.
Primitive
, value.Ticks);
790
new KeyValuePair<WellKnownMember, TypedConstant>(WellKnownMember.System_AttributeUsageAttribute__AllowMultiple, new TypedConstant(boolType, TypedConstantKind.
Primitive
, allowMultiple)),
791
new KeyValuePair<WellKnownMember, TypedConstant>(WellKnownMember.System_AttributeUsageAttribute__Inherited, new TypedConstant(boolType, TypedConstantKind.
Primitive
, inherited)));
821
new TypedConstant(constantType, TypedConstantKind.
Primitive
, name), stringType);
868
var result = flagsBuilder.SelectAsArray((flag, constantType) => new TypedConstant(constantType, TypedConstantKind.
Primitive
, flag), booleanType);
Symbols\MethodSymbol.cs (3)
1230
new TypedConstant(declaringCompilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.
Primitive
, PEModule.RequiredMembersMarker), // message
1231
new TypedConstant(declaringCompilation.GetSpecialType(SpecialType.System_Boolean), TypedConstantKind.
Primitive
, true)) // error
1236
ImmutableArray.Create(new TypedConstant(declaringCompilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.
Primitive
, nameof(CompilerFeatureRequiredFeatures.RequiredMembers)))
Symbols\Source\SourceAssemblySymbol.cs (5)
1825
var typedConstantTrue = new TypedConstant(boolType, TypedConstantKind.
Primitive
, value: true);
1957
var typedConstantNoStringInterning = new TypedConstant(int32Type, TypedConstantKind.
Primitive
, Cci.Constants.CompilationRelaxations_NoStringInterning);
1976
var typedConstantTrue = new TypedConstant(boolType, TypedConstantKind.
Primitive
, value: true);
2010
var typedConstant = new TypedConstant(stringType, TypedConstantKind.
Primitive
, _compilation.Options.CryptoKeyContainer);
2020
var typedConstant = new TypedConstant(stringType, TypedConstantKind.
Primitive
, _compilation.Options.CryptoKeyFile);
Symbols\Source\SourceFixedFieldSymbol.cs (1)
48
var item2 = new TypedConstant(intType, TypedConstantKind.
Primitive
, this.FixedSize);
Symbols\Source\SourceModuleSymbol.cs (2)
592
var version = ImmutableArray.Create(new TypedConstant(compilation.GetSpecialType(SpecialType.System_Int32), TypedConstantKind.
Primitive
, 11));
599
new TypedConstant(compilation.GetSpecialType(SpecialType.System_Boolean), TypedConstantKind.
Primitive
, _assemblySymbol.InternalsAreVisible));
Symbols\Source\SourceNamedTypeSymbol.cs (4)
1580
new TypedConstant(compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.
Primitive
, PEModule.ByRefLikeMarker), // message
1581
new TypedConstant(compilation.GetSpecialType(SpecialType.System_Boolean), TypedConstantKind.
Primitive
, true)), // error=true
1586
ImmutableArray.Create(new TypedConstant(compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.
Primitive
, nameof(CompilerFeatureRequiredFeatures.RefStructs))),
1599
var defaultMemberNameConstant = new TypedConstant(compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.
Primitive
, defaultMemberName);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
ExpressionGenerator.cs (1)
29
case TypedConstantKind.
Primitive
:
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (107)
Attributes\AttributeTests.cs (73)
491
attrs[0].VerifyValue(0, TypedConstantKind.
Primitive
, "Roslyn.Compilers.UnitTests");
493
attrs[1].VerifyValue(0, TypedConstantKind.
Primitive
, "Roslyn.Compilers.CSharp");
495
attrs[2].VerifyValue(0, TypedConstantKind.
Primitive
, "Roslyn.Compilers.CSharp.UnitTests");
497
attrs[3].VerifyValue(0, TypedConstantKind.
Primitive
, "Roslyn.Compilers.CSharp.Test.Utilities");
499
attrs[4].VerifyValue(0, TypedConstantKind.
Primitive
, "Roslyn.Compilers.VisualBasic");
1401
a.VerifyValue(0, TypedConstantKind.
Primitive
, "");
1405
a.VerifyValue(0, TypedConstantKind.
Primitive
, true);
1413
a.VerifyValue(0, TypedConstantKind.
Primitive
, "MyKey.snk");
1417
a.VerifyValue(0, TypedConstantKind.
Primitive
, "Key Name");
1421
a.VerifyValue(0, TypedConstantKind.
Primitive
, "1.2.*");
1425
a.VerifyValue(0, TypedConstantKind.
Primitive
, "4.3.2.100");
1482
attrs.First().VerifyValue<object>(0, TypedConstantKind.
Primitive
, null);
1568
attrs.First().VerifyValue(0, TypedConstantKind.
Primitive
, true);
1673
attrs.First().VerifyNamedArgumentValue<object>(0, "O", TypedConstantKind.
Primitive
, null);
3068
attrs[1].VerifyNamedArgumentValue<ushort>(0, "UShortField", TypedConstantKind.
Primitive
, 1234);
3079
attrs[0].VerifyNamedArgumentValue<uint>(0, "UIntField", TypedConstantKind.
Primitive
, 1230);
3093
attrs[0].VerifyValue<object>(0, TypedConstantKind.
Primitive
, null);
3094
attrs[0].VerifyValue<long>(1, TypedConstantKind.
Primitive
, 256);
3095
attrs[0].VerifyValue<float>(2, TypedConstantKind.
Primitive
, 0);
3096
attrs[0].VerifyValue<short>(3, TypedConstantKind.
Primitive
, -1);
3100
attrs[1].VerifyValue<long>(1, TypedConstantKind.
Primitive
, 265);
3101
attrs[1].VerifyValue<float>(2, TypedConstantKind.
Primitive
, -0.0001f);
3102
attrs[1].VerifyValue<short>(3, TypedConstantKind.
Primitive
, 2);
3140
attrs.First().VerifyValue<byte>(1, TypedConstantKind.
Primitive
, 255);
3141
attrs.First().VerifyValue<sbyte>(2, TypedConstantKind.
Primitive
, -128);
3182
attrs.First().VerifyNamedArgumentValue<object>(0, "ObjectField", TypedConstantKind.
Primitive
, 2);
3493
attr.VerifyValue<string>(0, TypedConstantKind.
Primitive
, "MultipleArgumentsToParamsParameter");
3500
attr.VerifyValue<string>(0, TypedConstantKind.
Primitive
, "NoArgumentsToParamsParameter");
3507
attr.VerifyValue<string>(0, TypedConstantKind.
Primitive
, "NullArgumentToParamsParameter");
4047
attr.VerifyNamedArgumentValue(0, "Inherited", TypedConstantKind.
Primitive
, false);
4048
attr.VerifyNamedArgumentValue(1, "AllowMultiple", TypedConstantKind.
Primitive
, true);
4098
attrs.First().VerifyValue(0, TypedConstantKind.
Primitive
, 4);
4099
attrs.First().VerifyValue(1, TypedConstantKind.
Primitive
, 5);
4101
attrs.First().VerifyNamedArgumentValue(0, "X", TypedConstantKind.
Primitive
, 6);
4141
attrs.First().VerifyValue(0, TypedConstantKind.
Primitive
, 3);
4142
attrs.First().VerifyValue(1, TypedConstantKind.
Primitive
, 4);
4143
attrs.First().VerifyValue(2, TypedConstantKind.
Primitive
, 5);
4145
attrs.First().VerifyNamedArgumentValue(0, "X", TypedConstantKind.
Primitive
, 6);
4187
attrs.First().VerifyValue(0, TypedConstantKind.
Primitive
, 2);
4188
attrs.First().VerifyValue(1, TypedConstantKind.
Primitive
, 1);
4230
attrs.First().VerifyValue(0, TypedConstantKind.
Primitive
, 3);
4231
attrs.First().VerifyValue(1, TypedConstantKind.
Primitive
, 4);
4232
attrs.First().VerifyValue(2, TypedConstantKind.
Primitive
, 5);
4234
attrs.First().VerifyNamedArgumentValue(0, "X", TypedConstantKind.
Primitive
, 6);
4276
attr.VerifyValue<int>(0, TypedConstantKind.
Primitive
, 2);
4479
attrs.First().VerifyValue(0, TypedConstantKind.
Primitive
, 2);
4485
attrs.First().VerifyValue(0, TypedConstantKind.
Primitive
, 2);
4672
enumerator.Current.VerifyNamedArgumentValue(0, "X", TypedConstantKind.
Primitive
, new bool());
4674
enumerator.Current.VerifyNamedArgumentValue(0, "X", TypedConstantKind.
Primitive
, new sbyte());
4676
enumerator.Current.VerifyNamedArgumentValue(0, "X", TypedConstantKind.
Primitive
, new byte());
4678
enumerator.Current.VerifyNamedArgumentValue(0, "X", TypedConstantKind.
Primitive
, new short());
4680
enumerator.Current.VerifyNamedArgumentValue(0, "X", TypedConstantKind.
Primitive
, new ushort());
4682
enumerator.Current.VerifyNamedArgumentValue(0, "X", TypedConstantKind.
Primitive
, new int());
4684
enumerator.Current.VerifyNamedArgumentValue(0, "X", TypedConstantKind.
Primitive
, new uint());
4686
enumerator.Current.VerifyNamedArgumentValue(0, "X", TypedConstantKind.
Primitive
, new char());
4688
enumerator.Current.VerifyNamedArgumentValue(0, "X", TypedConstantKind.
Primitive
, new float());
4690
enumerator.Current.VerifyNamedArgumentValue(0, "X", TypedConstantKind.
Primitive
, new Single());
4692
enumerator.Current.VerifyNamedArgumentValue(0, "X", TypedConstantKind.
Primitive
, new double());
4957
attr.VerifyValue<object>(0, TypedConstantKind.
Primitive
, null);
4963
attr.VerifyValue<int>(0, TypedConstantKind.
Primitive
, 1);
5018
attr.VerifyValue<object>(0, TypedConstantKind.
Primitive
, null);
5022
attr.VerifyValue<object>(0, TypedConstantKind.
Primitive
, null);
5030
attr.VerifyValue<object>(0, TypedConstantKind.
Primitive
, null);
5034
attr.VerifyValue<object>(0, TypedConstantKind.
Primitive
, null);
5320
attributes[0].VerifyValue(0, TypedConstantKind.
Primitive
, value);
9121
attrs2[1].VerifyValue(0, TypedConstantKind.
Primitive
, (object)null);
9203
attrs2[1].VerifyValue(0, TypedConstantKind.
Primitive
, (object)null);
9215
attrs4[1].VerifyValue(0, TypedConstantKind.
Primitive
, "A");
9216
attrs4[2].VerifyValue(0, TypedConstantKind.
Primitive
, "A");
9358
attrs2[1].VerifyValue(0, TypedConstantKind.
Primitive
, (object)null);
9433
attrs2[1].VerifyValue(0, TypedConstantKind.
Primitive
, (object)null);
9445
attrs4[1].VerifyValue(0, TypedConstantKind.
Primitive
, 1);
9446
attrs4[2].VerifyValue(0, TypedConstantKind.
Primitive
, 1);
Attributes\AttributeTests_Dynamic.cs (1)
550
Assert.Equal(TypedConstantKind.
Primitive
, actualTransformFlag.Kind);
Attributes\AttributeTests_Security.cs (1)
63
typeAttribute.VerifyNamedArgumentValue(0, "MayLeakOnAbort", TypedConstantKind.
Primitive
, true);
Attributes\AttributeTests_Synthesized.cs (3)
70
attribute.VerifyValue(0, TypedConstantKind.
Primitive
, expectedArgValue);
82
attribute.VerifyNamedArgumentValue<bool>(0, "WrapNonExceptionThrows", TypedConstantKind.
Primitive
, true);
1970
new TypedConstant(comp.GetSpecialType(SpecialType.System_String), TypedConstantKind.
Primitive
, "unused"))));
Attributes\AttributeTests_WellKnownAttributes.cs (29)
140
attrSym.VerifyValue(0, TypedConstantKind.
Primitive
, 1);
164
attrSym.VerifyValue(0, TypedConstantKind.
Primitive
, "ABCDEF5D-2448-447A-B786-64682CBEF123");
176
attrSym.VerifyValue(0, TypedConstantKind.
Primitive
, false);
177
attrSym.VerifyNamedArgumentValue(0, "ThrowOnUnmappableChar", TypedConstantKind.
Primitive
, true);
266
attrSym.VerifyValue(0, TypedConstantKind.
Primitive
, false);
272
attrSym.VerifyNamedArgumentValue(0, "BestFitMapping", TypedConstantKind.
Primitive
, true);
274
attrSym.VerifyNamedArgumentValue(2, "SetLastError", TypedConstantKind.
Primitive
, true);
275
attrSym.VerifyNamedArgumentValue(3, "ThrowOnUnmappableChar", TypedConstantKind.
Primitive
, true);
285
attrSym.VerifyValue(0, TypedConstantKind.
Primitive
, "ProgId");
289
attrSym.VerifyValue(0, TypedConstantKind.
Primitive
, 123);
292
attrSym.VerifyValue(0, TypedConstantKind.
Primitive
, 1);
306
attrSym.VerifyValue(0, TypedConstantKind.
Primitive
, true);
309
attrSym.VerifyValue(1, TypedConstantKind.
Primitive
, "EGoo, InteropAttribute, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null");
321
attrSym.VerifyValue(0, TypedConstantKind.
Primitive
, "message");
322
attrSym.VerifyValue(1, TypedConstantKind.
Primitive
, false);
416
attrSym.VerifyValue(0, TypedConstantKind.
Primitive
, 99uL);
424
attrSym.VerifyValue(0, TypedConstantKind.
Primitive
, "Ref");
435
attrSym.VerifyValue(0, TypedConstantKind.
Primitive
, 0f);
455
attrSym.VerifyValue(2, TypedConstantKind.
Primitive
, 100);
471
attrSym.VerifyNamedArgumentValue(0, "Size", TypedConstantKind.
Primitive
, 16);
472
attrSym.VerifyNamedArgumentValue(1, "Pack", TypedConstantKind.
Primitive
, 8);
482
attrSym.VerifyValue(0, TypedConstantKind.
Primitive
, 0);
2399
attrSym.VerifyValue(0, TypedConstantKind.
Primitive
, "unmanaged.dll");
2402
attrSym.VerifyNamedArgumentValue(1, "SetLastError", TypedConstantKind.
Primitive
, true);
2407
attrSym.VerifyValue(0, TypedConstantKind.
Primitive
, "user32.dll");
2410
attrSym.VerifyNamedArgumentValue(1, "ExactSpelling", TypedConstantKind.
Primitive
, false);
2411
attrSym.VerifyNamedArgumentValue(2, "EntryPoint", TypedConstantKind.
Primitive
, "MessageBox");
5069
attrSym.VerifyNamedArgumentValue(0, "AllowMultiple", TypedConstantKind.
Primitive
, true);
5075
attrSym.VerifyNamedArgumentValue(0, "AllowMultiple", TypedConstantKind.
Primitive
, false);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (80)
Symbols\Metadata\PE\LoadingAttributes.cs (68)
61
aBoolInst.VerifyValue(0, TypedConstantKind.
Primitive
, true);
64
aByteInst.VerifyValue(0, TypedConstantKind.
Primitive
, Convert.ToByte(1));
67
aCharInst.VerifyValue(0, TypedConstantKind.
Primitive
, 'a');
70
aSingleInst.VerifyValue(0, TypedConstantKind.
Primitive
, 3.14159f);
73
aDoubleInst.VerifyValue(0, TypedConstantKind.
Primitive
, 3.1415926);
76
aInt16Inst.VerifyValue(0, TypedConstantKind.
Primitive
, (Int16)16);
79
aInt32Inst.VerifyValue(0, TypedConstantKind.
Primitive
, 32);
82
aInt64Inst.VerifyValue(0, TypedConstantKind.
Primitive
, 64L);
85
aObjectInst.VerifyValue(0, TypedConstantKind.
Primitive
, "object");
88
aStringInst.VerifyValue(0, TypedConstantKind.
Primitive
, "assembly");
133
aBoolInst.VerifyValue(0, TypedConstantKind.
Primitive
, true);
136
aByteInst.VerifyValue(0, TypedConstantKind.
Primitive
, Convert.ToByte(1));
139
aCharInst.VerifyValue(0, TypedConstantKind.
Primitive
, 'a');
142
aSingleInst.VerifyValue(0, TypedConstantKind.
Primitive
, 3.14159f);
145
aDoubleInst.VerifyValue(0, TypedConstantKind.
Primitive
, 3.1415926);
148
aInt16Inst.VerifyValue(0, TypedConstantKind.
Primitive
, (Int16)16);
151
aInt32Inst.VerifyValue(0, TypedConstantKind.
Primitive
, 32);
154
aInt64Inst.VerifyValue(0, TypedConstantKind.
Primitive
, 64L);
157
aObjectInst.VerifyValue(0, TypedConstantKind.
Primitive
, "object");
160
aStringInst.VerifyValue(0, TypedConstantKind.
Primitive
, "module");
205
c1.GetAttributes().First().VerifyValue(0, TypedConstantKind.
Primitive
, "C1");
208
innerC1.GetAttributes().First().VerifyValue(0, TypedConstantKind.
Primitive
, "InnerC1");
215
innerC2.GetAttributes().First().VerifyValue(0, TypedConstantKind.
Primitive
, "InnerC2");
218
field1.GetAttributes().First().VerifyValue(0, TypedConstantKind.
Primitive
, "field1");
221
property1.GetAttributes().First().VerifyValue(0, TypedConstantKind.
Primitive
, "Property1");
224
sub1.GetAttributes().First().VerifyValue(0, TypedConstantKind.
Primitive
, "Sub1");
227
sub1P1.GetAttributes().First().VerifyValue(0, TypedConstantKind.
Primitive
, "p1");
230
function1.GetAttributes().First().VerifyValue(0, TypedConstantKind.
Primitive
, "Function1");
269
a.VerifyNamedArgumentValue(0, "B", TypedConstantKind.
Primitive
, true);
272
a.VerifyNamedArgumentValue(0, "B", TypedConstantKind.
Primitive
, Convert.ToByte(1));
275
a.VerifyNamedArgumentValue(0, "C", TypedConstantKind.
Primitive
, 'b');
281
a.VerifyNamedArgumentValue(0, "S", TypedConstantKind.
Primitive
, 3.14159f);
284
a.VerifyNamedArgumentValue(0, "D", TypedConstantKind.
Primitive
, 3.1415926);
287
a.VerifyNamedArgumentValue(0, "I", TypedConstantKind.
Primitive
, (Int16)16);
290
a.VerifyNamedArgumentValue(0, "I", TypedConstantKind.
Primitive
, 32);
293
a.VerifyNamedArgumentValue(0, "I", TypedConstantKind.
Primitive
, 64L);
385
c1.GetAttributes().First().VerifyValue(0, TypedConstantKind.
Primitive
, "C1");
606
a.VerifyValue(0, TypedConstantKind.
Primitive
, "InteropAttributes");
609
a.VerifyValue(1, TypedConstantKind.
Primitive
, 2);
612
a.VerifyValue(0, TypedConstantKind.
Primitive
, "1234C65D-1234-447A-B786-64682CBEF136");
615
a.VerifyValue(0, TypedConstantKind.
Primitive
, false);
616
a.VerifyNamedArgumentValue(0, "ThrowOnUnmappableChar", TypedConstantKind.
Primitive
, true);
619
a.VerifyValue(0, TypedConstantKind.
Primitive
, false);
630
a.VerifyValue(2, TypedConstantKind.
Primitive
, 3);
637
a.VerifyValue(0, TypedConstantKind.
Primitive
, true);
644
a.VerifyValue(0, TypedConstantKind.
Primitive
, 8);
647
a.VerifyNamedArgumentValue(0, "WrapNonExceptionThrows", TypedConstantKind.
Primitive
, true);
694
attrSym.VerifyValue(0, TypedConstantKind.
Primitive
, "ABCDEF5D-2448-447A-B786-64682CBEF123");
747
attrSym.VerifyValue(0, TypedConstantKind.
Primitive
, false);
757
attrSym.VerifyNamedArgumentValue(0, "BestFitMapping", TypedConstantKind.
Primitive
, true);
759
attrSym.VerifyNamedArgumentValue(2, "SetLastError", TypedConstantKind.
Primitive
, true);
760
attrSym.VerifyNamedArgumentValue(3, "ThrowOnUnmappableChar", TypedConstantKind.
Primitive
, true);
797
attrSym.VerifyValue(0, TypedConstantKind.
Primitive
, "message");
798
attrSym.VerifyValue(1, TypedConstantKind.
Primitive
, false);
858
attrSym.VerifyValue(0, TypedConstantKind.
Primitive
, "MyIndex");
863
mem.GetAttributes().First().VerifyValue(0, TypedConstantKind.
Primitive
, 10);
897
attrSym.VerifyValue(0, TypedConstantKind.
Primitive
, 1);
927
attrSym.VerifyNamedArgumentValue(0, "UShortField", TypedConstantKind.
Primitive
, Convert.ToUInt16(321));
968
attrSym.VerifyValue(0, TypedConstantKind.
Primitive
, 3.1415926);
977
attrSym.VerifyValue(0, TypedConstantKind.
Primitive
, 'q');
978
attrSym.VerifyValue(1, TypedConstantKind.
Primitive
, Convert.ToByte(2));
990
attrSym.VerifyValue(0, TypedConstantKind.
Primitive
, "555");
1183
attr1.VerifyValue(0, TypedConstantKind.
Primitive
, "4.0.30319.18408");
1187
attr1.VerifyValue(0, TypedConstantKind.
Primitive
, "4.0.30319.18408");
1243
attr.VerifyValue(0, TypedConstantKind.
Primitive
, "genericUriParserOptions");
1244
attr.VerifyNamedArgumentValue(1, "IsRequired", TypedConstantKind.
Primitive
, true);
1276
attr.VerifyValue(0, TypedConstantKind.
Primitive
, "DataCategory_Mapping");
1279
attr.VerifyValue(0, TypedConstantKind.
Primitive
, "DataAdapter_MissingMappingAction");
Symbols\Retargeting\RetargetCustomAttributes.cs (1)
155
attribute.VerifyNamedArgumentValue(1, "TargetTypeName", TypedConstantKind.
Primitive
, "IntArrayType");
Symbols\TypedConstantTests.cs (11)
77
new TypedConstant(_intType, TypedConstantKind.
Primitive
, 1),
78
new TypedConstant(_intType, TypedConstantKind.
Primitive
, 1));
84
new TypedConstant(_stringType, TypedConstantKind.
Primitive
, s1),
85
new TypedConstant(_stringType, TypedConstantKind.
Primitive
, s2));
88
new TypedConstant(_stringType, TypedConstantKind.
Primitive
, null),
89
new TypedConstant(_stringType, TypedConstantKind.
Primitive
, null));
92
new TypedConstant(_enumString1, TypedConstantKind.
Primitive
, null),
93
new TypedConstant(_enumString2, TypedConstantKind.
Primitive
, null));
96
new TypedConstant(_stringType, TypedConstantKind.
Primitive
, null),
100
new TypedConstant(_stringType, TypedConstantKind.
Primitive
, null),
101
new TypedConstant(_systemType, TypedConstantKind.
Primitive
, null));
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (1)
Metadata\WinMdDumpTest.cs (1)
316
case TypedConstantKind.
Primitive
:
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
ExpressionGenerator.cs (1)
29
case TypedConstantKind.
Primitive
:
Microsoft.CodeAnalysis.Features (4)
AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
828
attribute.ConstructorArguments is [_, { Kind: TypedConstantKind.
Primitive
, Value: string checkId }, ..])
839
Kind: TypedConstantKind.
Primitive
,
AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
590
attribute.ConstructorArguments is [{ Kind: TypedConstantKind.
Primitive
, Type.SpecialType: SpecialType.System_String, Value: string value }])
EmbeddedLanguages\EmbeddedLanguageDetector.cs (1)
360
if (argument.Kind != TypedConstantKind.
Primitive
|| argument.Value is not string argString)
Microsoft.CodeAnalysis.UnitTests (11)
CommonTypedConstantTests.cs (11)
42
new TypedConstant(_intType, TypedConstantKind.
Primitive
, 1),
43
new TypedConstant(_intType, TypedConstantKind.
Primitive
, 1));
49
new TypedConstant(_stringType, TypedConstantKind.
Primitive
, s1),
50
new TypedConstant(_stringType, TypedConstantKind.
Primitive
, s2));
53
new TypedConstant(_stringType, TypedConstantKind.
Primitive
, null),
54
new TypedConstant(_stringType, TypedConstantKind.
Primitive
, null));
57
new TypedConstant(_enumString1, TypedConstantKind.
Primitive
, null),
58
new TypedConstant(_enumString2, TypedConstantKind.
Primitive
, null));
61
new TypedConstant(_stringType, TypedConstantKind.
Primitive
, null),
65
new TypedConstant(_stringType, TypedConstantKind.
Primitive
, null),
66
new TypedConstant(_enumString1, TypedConstantKind.
Primitive
, null));
Microsoft.CodeAnalysis.VisualBasic (30)
Emit\NoPia\EmbeddedType.vb (2)
220
ImmutableArray.Create(New TypedConstant(stringType, TypedConstantKind.
Primitive
, guidString),
221
New TypedConstant(stringType, TypedConstantKind.
Primitive
, UnderlyingNamedType.AdaptedNamedTypeSymbol.ToDisplayString(SymbolDisplayFormat.QualifiedNameOnlyFormat))),
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousDelegate_TemplateSymbol.vb (1)
180
Dim value As New TypedConstant(Manager.System_String, TypedConstantKind.
Primitive
, "<generated method>")
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType_TemplateSymbol.vb (1)
184
ImmutableArray.Create(New TypedConstant(Manager.System_String, TypedConstantKind.
Primitive
, builder.ToStringAndFree())))
Symbols\Attributes\AttributeData.vb (3)
441
Debug.Assert(ctorArgument.Kind = TypedConstantKind.Enum OrElse ctorArgument.Kind = TypedConstantKind.
Primitive
)
468
Debug.Assert(ctorArgument.Kind = TypedConstantKind.Enum OrElse ctorArgument.Kind = TypedConstantKind.
Primitive
)
486
Debug.Assert(ctorArgument.Kind = TypedConstantKind.Enum OrElse ctorArgument.Kind = TypedConstantKind.
Primitive
)
Symbols\Source\SourceAssemblySymbol.vb (4)
1503
Dim typedConstantNoStringInterning = New TypedConstant(int32Type, TypedConstantKind.
Primitive
, Cci.Constants.CompilationRelaxations_NoStringInterning)
1521
Dim typedConstantTrue = New TypedConstant(boolType, TypedConstantKind.
Primitive
, True)
1576
Dim typedConstant = New TypedConstant(stringType, TypedConstantKind.
Primitive
, _compilation.Options.CryptoKeyContainer)
1585
Dim typedConstant = New TypedConstant(stringType, TypedConstantKind.
Primitive
, _compilation.Options.CryptoKeyFile)
Symbols\Source\SourceFieldSymbol.vb (1)
675
New TypedConstant(specialTypeInt64, TypedConstantKind.
Primitive
, attributeValue.Ticks))))
Symbols\Source\SourceNamedTypeSymbol.vb (4)
2193
If attrData.CommonConstructorArguments.Length = 1 AndAlso attrData.CommonConstructorArguments(0).Kind = TypedConstantKind.
Primitive
Then
2481
New TypedConstant(stringType, TypedConstantKind.
Primitive
, DefaultPropertyName))))
2496
New TypedConstant(GetSpecialType(SpecialType.System_String), TypedConstantKind.
Primitive
, _comClassData.ClassId))))
2523
New TypedConstant(GetSpecialType(SpecialType.System_String), TypedConstantKind.
Primitive
, eventInterfaceName))))
Symbols\Source\SourceNamedTypeSymbol_ComClass.vb (6)
994
New TypedConstant(_comClass.GetSpecialType(SpecialType.System_String), TypedConstantKind.
Primitive
, id))))
1002
TypedConstantKind.
Primitive
,
1009
TypedConstantKind.
Primitive
,
1016
TypedConstantKind.
Primitive
,
1349
TypedConstantKind.
Primitive
,
1845
TypedConstantKind.
Primitive
,
Symbols\Source\SourceParameterSymbolBase.vb (1)
64
TypedConstantKind.
Primitive
,
Symbols\Source\SourceWithEventsBackingFieldSymbol.vb (1)
76
TypedConstantKind.
Primitive
,
Symbols\WellKnownMembers.vb (6)
245
New TypedConstant(specialTypeByte, TypedConstantKind.
Primitive
, scale),
246
New TypedConstant(specialTypeByte, TypedConstantKind.
Primitive
, CByte(If(isNegative, 128, 0))),
247
New TypedConstant(specialTypeUInt32, TypedConstantKind.
Primitive
, high),
248
New TypedConstant(specialTypeUInt32, TypedConstantKind.
Primitive
, mid),
249
New TypedConstant(specialTypeUInt32, TypedConstantKind.
Primitive
, low)
737
Return New TypedConstant(constantType, TypedConstantKind.
Primitive
, name)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (51)
Attributes\AttributeTests.vb (32)
214
attrs(0).VerifyValue(0, TypedConstantKind.
Primitive
, "Roslyn.Compilers.UnitTests")
215
attrs(1).VerifyValue(0, TypedConstantKind.
Primitive
, "Roslyn.Compilers.CSharp")
216
attrs(2).VerifyValue(0, TypedConstantKind.
Primitive
, "Roslyn.Compilers.CSharp.UnitTests")
217
attrs(3).VerifyValue(0, TypedConstantKind.
Primitive
, "Roslyn.Compilers.CSharp.Test.Utilities")
218
attrs(4).VerifyValue(0, TypedConstantKind.
Primitive
, "Roslyn.Compilers.VisualBasic")
271
Assert.Equal(TypedConstantKind.
Primitive
, a.CommonConstructorArguments(0).Kind)
276
Assert.Equal(TypedConstantKind.
Primitive
, a.CommonConstructorArguments(0).Kind)
286
Assert.Equal(TypedConstantKind.
Primitive
, a.CommonConstructorArguments(0).Kind)
291
Assert.Equal(TypedConstantKind.
Primitive
, a.CommonConstructorArguments(0).Kind)
296
Assert.Equal(TypedConstantKind.
Primitive
, a.CommonConstructorArguments(0).Kind)
301
Assert.Equal(TypedConstantKind.
Primitive
, a.CommonConstructorArguments(0).Kind)
357
attrs(0).VerifyValue(0, TypedConstantKind.
Primitive
, 4)
652
attrs(0).VerifyValue(Of Object)(0, "O", TypedConstantKind.
Primitive
, Nothing)
777
attrs(1).VerifyValue(Of UShort)(0, "UShortField", TypedConstantKind.
Primitive
, 1234)
781
attrs(4).VerifyValue(Of UShort)(0, "UShortField", TypedConstantKind.
Primitive
, 1234)
793
attrs(0).VerifyValue(0, "UIntField", TypedConstantKind.
Primitive
, 1230)
802
attrs(0).VerifyValue(Of Object)(0, TypedConstantKind.
Primitive
, Nothing)
803
attrs(0).VerifyValue(Of Long)(1, TypedConstantKind.
Primitive
, 256)
804
attrs(0).VerifyValue(Of Single)(2, TypedConstantKind.
Primitive
, 0)
805
attrs(0).VerifyValue(Of Short)(3, TypedConstantKind.
Primitive
, -1)
809
attrs(1).VerifyValue(Of Long)(1, TypedConstantKind.
Primitive
, 265)
810
attrs(1).VerifyValue(Of Single)(2, TypedConstantKind.
Primitive
, -0.0001F)
811
attrs(1).VerifyValue(Of Short)(3, TypedConstantKind.
Primitive
, 2)
853
attrs(0).VerifyValue(Of Byte)(1, TypedConstantKind.
Primitive
, 255)
854
attrs(0).VerifyValue(Of SByte)(2, TypedConstantKind.
Primitive
, -128)
906
attrs(0).VerifyValue(Of Object)(0, "ObjectField", TypedConstantKind.
Primitive
, 2)
1012
attrs(0).VerifyValue(Of Object)(0, TypedConstantKind.
Primitive
, "f1 return type")
1016
attrs(0).VerifyValue(Of Object)(0, TypedConstantKind.
Primitive
, "p1 return type")
1021
attrs(0).VerifyValue(Of Object)(0, TypedConstantKind.
Primitive
, "p2 return type")
1025
attrs(0).VerifyValue(Of Object)(0, TypedConstantKind.
Primitive
, "f2 returns an integer")
1169
attrs(0).VerifyValue(Of Object)(0, TypedConstantKind.
Primitive
, 1)
1171
attrs(2).VerifyValue(Of Object)(0, "X", TypedConstantKind.
Primitive
, 1)
Attributes\AttributeTests_Synthesized.vb (3)
727
attribute.VerifyValue(Of Integer)(0, TypedConstantKind.
Primitive
, expectedArgValue)
738
attribute.VerifyNamedArgumentValue(Of Boolean)(0, "WrapNonExceptionThrows", TypedConstantKind.
Primitive
, True)
1829
New TypedConstant(comp.GetSpecialType(SpecialType.System_String), TypedConstantKind.
Primitive
, "unused"))))
Attributes\AttributeTests_WellKnownAttributes.vb (10)
365
attrSym.VerifyValue(0, TypedConstantKind.
Primitive
, 99UL)
373
attrSym.VerifyValue(0, TypedConstantKind.
Primitive
, "Ref")
383
attrSym.VerifyValue(0, TypedConstantKind.
Primitive
, 0.0F)
397
attrSym.VerifyValue(0, TypedConstantKind.
Primitive
, 123456)
403
attrSym.VerifyValue(2, TypedConstantKind.
Primitive
, 100)
419
attrSym.VerifyValue(0, "Size", TypedConstantKind.
Primitive
, 16)
420
attrSym.VerifyValue(1, "Pack", TypedConstantKind.
Primitive
, 8)
430
attrSym.VerifyValue(0, TypedConstantKind.
Primitive
, 0)
980
Assert.Equal(TypedConstantKind.
Primitive
, attrSym.CommonNamedArguments(1).Value.Kind)
3625
typeAttribute.VerifyNamedArgumentValue(0, "MayLeakOnAbort", TypedConstantKind.
Primitive
, True)
Emit\CompilationEmitTests.vb (6)
3292
typeAttribute.VerifyNamedArgumentValue(0, "RemotingConfiguration", TypedConstantKind.
Primitive
, True)
3302
typeAttribute.VerifyNamedArgumentValue(0, "UnmanagedCode", TypedConstantKind.
Primitive
, True)
3322
typeAttribute.VerifyNamedArgumentValue(0, "Role", TypedConstantKind.
Primitive
, "User1")
3332
typeAttribute.VerifyNamedArgumentValue(0, "Role", TypedConstantKind.
Primitive
, "User2")
3347
methodAttribute.VerifyNamedArgumentValue(0, "Role", TypedConstantKind.
Primitive
, "User3")
3357
methodAttribute.VerifyNamedArgumentValue(0, "Role", TypedConstantKind.
Primitive
, "User4")
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (1)
SymbolsTests\Retargeting\RetargetingCustomAttributes.vb (1)
147
attribute.VerifyValue(1, "TargetTypeName", TypedConstantKind.
Primitive
, "IntArrayType")
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
CodeGeneration\ExpressionGenerator.vb (1)
20
Case TypedConstantKind.
Primitive
, TypedConstantKind.Enum