113 references to Primitive
ILLink.RoslynAnalyzer (1)
DataFlow\LocalDataFlowVisitor.cs (1)
883if (attributeArgument.Kind != TypedConstantKind.Primitive)
Microsoft.AspNetCore.App.Analyzers (1)
RouteEmbeddedLanguage\Infrastructure\RouteStringSyntaxDetector.cs (1)
358if (argument.Kind != TypedConstantKind.Primitive || argument.Value is not string argString)
Microsoft.AspNetCore.Mvc.Analyzers (1)
TopLevelParameterNameAnalyzer.cs (1)
164namedArgumentValue.Kind == TypedConstantKind.Primitive &&
Microsoft.AspNetCore.Mvc.Api.Analyzers (4)
ActualApiResponseMetadataFactory.cs (1)
250attribute.ConstructorArguments[0].Kind == TypedConstantKind.Primitive &&
SymbolApiResponseMetadataProvider.cs (3)
104if (attribute.ConstructorArguments[1].Kind != TypedConstantKind.Primitive || 194namedArgumentValue.Kind == TypedConstantKind.Primitive && 220if (argument.Kind == TypedConstantKind.Primitive && argument.Value is int statusCode)
Microsoft.CodeAnalysis (3)
MetadataReader\MetadataDecoder.cs (2)
1529TypedConstantKind.Primitive : 1549return (type.TypeKind == TypeKind.Enum) ? TypedConstantKind.Enum : TypedConstantKind.Primitive;
Symbols\TypedConstant.cs (1)
178return TypedConstantKind.Primitive;
Microsoft.CodeAnalysis.Analyzers (2)
MetaAnalyzers\CompilerExtensionStrictApiAnalyzer.cs (1)
203if (argument is { Kind: TypedConstantKind.Primitive, Type.SpecialType: SpecialType.System_String })
MetaAnalyzers\DiagnosticAnalyzerAttributeAnalyzer.cs (1)
149if (argument.Kind == TypedConstantKind.Primitive &&
Microsoft.CodeAnalysis.CodeStyle (4)
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
850attribute.ConstructorArguments is [_, { Kind: TypedConstantKind.Primitive, Value: string checkId }, ..]) 861Kind: TypedConstantKind.Primitive,
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (2)
902if (attribute.ConstructorArguments is [{ Kind: TypedConstantKind.Primitive, Type.SpecialType: SpecialType.System_String, Value: string value }]) 913Value: { Kind: TypedConstantKind.Primitive, Type.SpecialType: SpecialType.System_String, Value: string namedValue },
Microsoft.CodeAnalysis.CSharp (42)
Emitter\Model\PEAssemblyBuilder.cs (1)
381[new TypedConstant(Compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, markerName)],
Emitter\Model\PEModuleBuilder.cs (5)
1743var value = flagsBuilder.SelectAsArray((flag, byteType) => new TypedConstant(byteType, TypedConstantKind.Primitive, flag), byteType); 1765ImmutableArray.Create(new TypedConstant(byteType, TypedConstantKind.Primitive, nullableValue))); 1785ImmutableArray.Create(new TypedConstant(Compilation.GetSpecialType(SpecialType.System_Byte), TypedConstantKind.Primitive, value))); 1827var transformFlags = builder.SelectAsArray((flag, constantType) => new TypedConstant(constantType, TypedConstantKind.Primitive, flag), booleanType); 1927[new TypedConstant(Compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, markerName)]);
Emitter\NoPia\EmbeddedType.cs (2)
279ImmutableArray.Create(new TypedConstant(stringType, TypedConstantKind.Primitive, guidString), 280new TypedConstant(stringType, TypedConstantKind.Primitive,
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TemplateSymbol.cs (2)
224arguments: ImmutableArray.Create(new TypedConstant(Manager.System_String, TypedConstantKind.Primitive, displayString)), 227new TypedConstant(Manager.System_String, TypedConstantKind.Primitive, "<Anonymous Type>"))));
Symbols\Attributes\AttributeData.cs (2)
575Debug.Assert(ctorArgument.Kind == TypedConstantKind.Enum || ctorArgument.Kind == TypedConstantKind.Primitive); 600Debug.Assert(ctorArgument.Kind == TypedConstantKind.Enum || ctorArgument.Kind == TypedConstantKind.Primitive);
Symbols\Compilation_WellKnownMembers.cs (10)
477new TypedConstant(systemByte, TypedConstantKind.Primitive, scale), 478new TypedConstant(systemByte, TypedConstantKind.Primitive, (byte)(isNegative ? 128 : 0)), 479new TypedConstant(systemUnit32, TypedConstantKind.Primitive, high), 480new TypedConstant(systemUnit32, TypedConstantKind.Primitive, mid), 481new TypedConstant(systemUnit32, TypedConstantKind.Primitive, low) 487var ticks = new TypedConstant(GetSpecialType(SpecialType.System_Int64), TypedConstantKind.Primitive, value.Ticks); 860new KeyValuePair<WellKnownMember, TypedConstant>(WellKnownMember.System_AttributeUsageAttribute__AllowMultiple, new TypedConstant(boolType, TypedConstantKind.Primitive, allowMultiple)), 861new KeyValuePair<WellKnownMember, TypedConstant>(WellKnownMember.System_AttributeUsageAttribute__Inherited, new TypedConstant(boolType, TypedConstantKind.Primitive, inherited))); 891new TypedConstant(constantType, TypedConstantKind.Primitive, name), stringType); 938var result = flagsBuilder.SelectAsArray((flag, constantType) => new TypedConstant(constantType, TypedConstantKind.Primitive, flag), booleanType);
Symbols\MethodSymbol.cs (4)
1298new TypedConstant(declaringCompilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, PEModule.RequiredMembersMarker), // message 1299new TypedConstant(declaringCompilation.GetSpecialType(SpecialType.System_Boolean), TypedConstantKind.Primitive, true)) // error 1304ImmutableArray.Create(new TypedConstant(declaringCompilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, nameof(CompilerFeatureRequiredFeatures.RequiredMembers))) 1318[new TypedConstant(declaringCompilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, nameof(CompilerFeatureRequiredFeatures.ClosedClasses))]));
Symbols\Source\SourceAssemblySymbol.cs (5)
1835var typedConstantTrue = new TypedConstant(boolType, TypedConstantKind.Primitive, value: true); 1975var typedConstantNoStringInterning = new TypedConstant(int32Type, TypedConstantKind.Primitive, Cci.Constants.CompilationRelaxations_NoStringInterning); 1994var typedConstantTrue = new TypedConstant(boolType, TypedConstantKind.Primitive, value: true); 2028var typedConstant = new TypedConstant(stringType, TypedConstantKind.Primitive, _compilation.Options.CryptoKeyContainer); 2038var typedConstant = new TypedConstant(stringType, TypedConstantKind.Primitive, _compilation.Options.CryptoKeyFile);
Symbols\Source\SourceFixedFieldSymbol.cs (1)
49var item2 = new TypedConstant(intType, TypedConstantKind.Primitive, this.FixedSize);
Symbols\Source\SourceMethodSymbol.cs (1)
292ImmutableArray.Create(new TypedConstant(compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, nameof(CompilerFeatureRequiredFeatures.UserDefinedCompoundAssignmentOperators)))
Symbols\Source\SourceModuleSymbol.cs (3)
680var version = ImmutableArray.Create(new TypedConstant(compilation.GetSpecialType(SpecialType.System_Int32), TypedConstantKind.Primitive, 11)); 686var version = ImmutableArray.Create(new TypedConstant(compilation.GetSpecialType(SpecialType.System_Int32), TypedConstantKind.Primitive, CSharpCompilationOptions.UpdatedMemorySafetyRulesVersion)); 693new TypedConstant(compilation.GetSpecialType(SpecialType.System_Boolean), TypedConstantKind.Primitive, _assemblySymbol.InternalsAreVisible));
Symbols\Source\SourceNamedTypeSymbol.cs (4)
1766new TypedConstant(compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, PEModule.ByRefLikeMarker), // message 1767new TypedConstant(compilation.GetSpecialType(SpecialType.System_Boolean), TypedConstantKind.Primitive, true)), // error=true 1772ImmutableArray.Create(new TypedConstant(compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, nameof(CompilerFeatureRequiredFeatures.RefStructs))), 1785var defaultMemberNameConstant = new TypedConstant(compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, defaultMemberName);
Symbols\Source\SourceNamedTypeSymbol_Extension.cs (1)
890case TypedConstantKind.Primitive:
Symbols\Synthesized\SynthesizedInlineArrayTypeSymbol.cs (1)
213arguments: ImmutableArray.Create(new TypedConstant(compilation.GetSpecialType(SpecialType.System_Int32), TypedConstantKind.Primitive, _arrayLength)),
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
330{ Kind: TypedConstantKind.Primitive, Value: string methodName }
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (1)
29case TypedConstantKind.Primitive:
Microsoft.CodeAnalysis.CSharp.Features (1)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
330{ Kind: TypedConstantKind.Primitive, Value: string methodName }
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (1)
29case TypedConstantKind.Primitive:
Microsoft.CodeAnalysis.Features (5)
EmbeddedLanguages\EmbeddedLanguageDetector.cs (1)
533if (argument.Kind != TypedConstantKind.Primitive || argument.Value is not string argString)
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
850attribute.ConstructorArguments is [_, { Kind: TypedConstantKind.Primitive, Value: string checkId }, ..]) 861Kind: TypedConstantKind.Primitive,
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (2)
902if (attribute.ConstructorArguments is [{ Kind: TypedConstantKind.Primitive, Type.SpecialType: SpecialType.System_String, Value: string value }]) 913Value: { Kind: TypedConstantKind.Primitive, Type.SpecialType: SpecialType.System_String, Value: string namedValue },
Microsoft.CodeAnalysis.VisualBasic (30)
Emit\NoPia\EmbeddedType.vb (2)
219ImmutableArray.Create(New TypedConstant(stringType, TypedConstantKind.Primitive, guidString), 220New TypedConstant(stringType, TypedConstantKind.Primitive, UnderlyingNamedType.AdaptedNamedTypeSymbol.ToDisplayString(SymbolDisplayFormat.QualifiedNameOnlyFormat))),
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousDelegate_TemplateSymbol.vb (1)
181Dim 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\Attributes\AttributeData.vb (3)
438Debug.Assert(ctorArgument.Kind = TypedConstantKind.Enum OrElse ctorArgument.Kind = TypedConstantKind.Primitive) 465Debug.Assert(ctorArgument.Kind = TypedConstantKind.Enum OrElse ctorArgument.Kind = TypedConstantKind.Primitive) 483Debug.Assert(ctorArgument.Kind = TypedConstantKind.Enum OrElse ctorArgument.Kind = TypedConstantKind.Primitive)
Symbols\Source\SourceAssemblySymbol.vb (4)
1543Dim typedConstantNoStringInterning = New TypedConstant(int32Type, TypedConstantKind.Primitive, Cci.Constants.CompilationRelaxations_NoStringInterning) 1561Dim typedConstantTrue = New TypedConstant(boolType, TypedConstantKind.Primitive, True) 1616Dim typedConstant = New TypedConstant(stringType, TypedConstantKind.Primitive, _compilation.Options.CryptoKeyContainer) 1625Dim typedConstant = New TypedConstant(stringType, TypedConstantKind.Primitive, _compilation.Options.CryptoKeyFile)
Symbols\Source\SourceFieldSymbol.vb (1)
695New TypedConstant(specialTypeInt64, TypedConstantKind.Primitive, attributeValue.Ticks))))
Symbols\Source\SourceNamedTypeSymbol.vb (4)
2282If attrData.CommonConstructorArguments.Length = 1 AndAlso attrData.CommonConstructorArguments(0).Kind = TypedConstantKind.Primitive Then 2586New TypedConstant(stringType, TypedConstantKind.Primitive, DefaultPropertyName)))) 2601New TypedConstant(GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, _comClassData.ClassId)))) 2628New TypedConstant(GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, eventInterfaceName))))
Symbols\Source\SourceNamedTypeSymbol_ComClass.vb (6)
1002New TypedConstant(_comClass.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, id)))) 1010TypedConstantKind.Primitive, 1017TypedConstantKind.Primitive, 1024TypedConstantKind.Primitive, 1372TypedConstantKind.Primitive, 1878TypedConstantKind.Primitive,
Symbols\Source\SourceParameterSymbolBase.vb (1)
64TypedConstantKind.Primitive,
Symbols\Source\SourceWithEventsBackingFieldSymbol.vb (1)
76TypedConstantKind.Primitive,
Symbols\WellKnownMembers.vb (6)
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) 737Return New TypedConstant(constantType, TypedConstantKind.Primitive, name)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.vb (1)
20Case TypedConstantKind.Primitive, TypedConstantKind.Enum
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.vb (1)
20Case TypedConstantKind.Primitive, TypedConstantKind.Enum
Microsoft.Gen.MetadataExtractor (4)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (4)
266&& attributeData.ConstructorArguments[0].Kind == TypedConstantKind.Primitive) 293if (arg.Value.Kind == TypedConstantKind.Primitive && 298else if (arg.Value.Kind == TypedConstantKind.Primitive && 317if (item.Kind != TypedConstantKind.Primitive)
Microsoft.Gen.Metrics (4)
Parser.cs (4)
266&& attributeData.ConstructorArguments[0].Kind == TypedConstantKind.Primitive) 293if (arg.Value.Kind == TypedConstantKind.Primitive && 298else if (arg.Value.Kind == TypedConstantKind.Primitive && 317if (item.Kind != TypedConstantKind.Primitive)
Microsoft.Gen.MetricsReports (4)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (4)
266&& attributeData.ConstructorArguments[0].Kind == TypedConstantKind.Primitive) 293if (arg.Value.Kind == TypedConstantKind.Primitive && 298else if (arg.Value.Kind == TypedConstantKind.Primitive && 317if (item.Kind != TypedConstantKind.Primitive)
Roslyn.Diagnostics.CSharp.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (1)
29case TypedConstantKind.Primitive:
Roslyn.Diagnostics.VisualBasic.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.vb (1)
20Case TypedConstantKind.Primitive, TypedConstantKind.Enum