122 references to Kind
ILLink.RoslynAnalyzer (1)
DataFlow\LocalDataFlowVisitor.cs (1)
762 if (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 (2)
TopLevelParameterNameAnalyzer.cs (2)
164namedArgumentValue.Kind == TypedConstantKind.Primitive && 187namedArgumentValue.Kind == TypedConstantKind.Type)
Microsoft.AspNetCore.Mvc.Api.Analyzers (9)
ActualApiResponseMetadataFactory.cs (1)
250attribute.ConstructorArguments[0].Kind == TypedConstantKind.Primitive &&
SymbolApiConventionMatcher.cs (2)
66attribute.ConstructorArguments[0].Kind != TypedConstantKind.Enum) 88attribute.ConstructorArguments[0].Kind != TypedConstantKind.Enum)
SymbolApiResponseMetadataProvider.cs (6)
55errorTypeAttribute.ConstructorArguments[0].Kind == TypedConstantKind.Type && 98if (attribute.ConstructorArguments[0].Kind != TypedConstantKind.Type || 104if (attribute.ConstructorArguments[1].Kind != TypedConstantKind.Primitive || 174attribute.ConstructorArguments[0].Kind != TypedConstantKind.Type || 194namedArgumentValue.Kind == TypedConstantKind.Primitive && 220if (argument.Kind == TypedConstantKind.Primitive && argument.Value is int statusCode)
Microsoft.CodeAnalysis (5)
Symbols\Attributes\UnmanagedCallersOnlyAttributeData.cs (2)
37&& value.Kind == TypedConstantKind.Array 38&& (value.Values.IsDefaultOrEmpty || value.Values.All(v => v.Kind == TypedConstantKind.Type));
Symbols\TypedConstant.cs (3)
97if (Kind == TypedConstantKind.Array) 115if (Kind != TypedConstantKind.Array) 215Hash.Combine(_type, (int)this.Kind));
Microsoft.CodeAnalysis.CodeStyle (3)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
833attribute.ConstructorArguments is [_, { Kind: TypedConstantKind.Primitive, Value: string checkId }, ..]) 844Kind: TypedConstantKind.Primitive,
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
692attribute.ConstructorArguments is [{ Kind: TypedConstantKind.Primitive, Type.SpecialType: SpecialType.System_String, Value: string value }])
Microsoft.CodeAnalysis.CSharp (26)
Binder\Binder_Attributes.cs (3)
723if (reorderedArgument.Kind == TypedConstantKind.Error) 727else if (reorderedArgument.Kind == TypedConstantKind.Array && 741Debug.Assert(hasErrors || reorderedArguments.All(arg => arg.Kind != TypedConstantKind.Error));
Emitter\Model\AttributeDataAdapter.cs (2)
30Debug.Assert(argument.Kind != TypedConstantKind.Error); 106switch (argument.Kind)
Symbols\Attributes\AttributeData.cs (6)
577Debug.Assert(ctorArgument.Kind == TypedConstantKind.Enum || ctorArgument.Kind == TypedConstantKind.Primitive); 579ClassInterfaceType interfaceType = ctorArgument.Kind == TypedConstantKind.Enum ? 602Debug.Assert(ctorArgument.Kind == TypedConstantKind.Enum || ctorArgument.Kind == TypedConstantKind.Primitive); 604ComInterfaceType interfaceType = ctorArgument.Kind == TypedConstantKind.Enum ?
Symbols\MethodSymbol.cs (1)
1012Debug.Assert(callConvTypedConstant.Kind == TypedConstantKind.Type);
Symbols\Retargeting\RetargetingSymbolTranslator.cs (3)
1228if (oldConstant.Kind == TypedConstantKind.Array) 1244if ((oldConstant.Kind == TypedConstantKind.Type) && (oldConstantValue != null)) 1256return new TypedConstant(newConstantType, oldConstant.Kind, newConstantValue);
Symbols\Source\SourceComplexParameterSymbol.cs (2)
980SpecialType specialType = arg.Kind == TypedConstantKind.Enum ? 989if (arg.Kind != TypedConstantKind.Array && arg.ValueInternal == null)
Symbols\Source\SourceMemberContainerSymbol.cs (1)
1432&& attr.CommonConstructorArguments[0].Kind == TypedConstantKind.Type)
Symbols\Source\SourceNamedTypeSymbol.cs (2)
1030Debug.Assert(attributeData.CommonConstructorArguments[0].Kind == TypedConstantKind.Type); 1336Debug.Assert(argument.Kind == TypedConstantKind.Type);
Symbols\TypedConstantExtensions.cs (6)
25if (constant.Kind == TypedConstantKind.Array) 30if (constant.Kind == TypedConstantKind.Type || constant.TypeInternal!.SpecialType == SpecialType.System_Object) 36if (constant.Kind == TypedConstantKind.Enum) 49Debug.Assert(constant.Kind == TypedConstantKind.Enum); 69Debug.Assert(constant.Kind == TypedConstantKind.Enum); 148Debug.Assert(constant.Kind == TypedConstantKind.Enum);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (1)
28switch (typedConstant.Kind)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (3)
Attributes\AttributeTests.cs (1)
654Assert.Equal(TypedConstantKind.Array, attributeData.ConstructorArguments.Single().Kind);
Attributes\AttributeTests_Dynamic.cs (2)
541Assert.Equal(TypedConstantKind.Array, argument.Kind); 550Assert.Equal(TypedConstantKind.Primitive, actualTransformFlag.Kind);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (8)
Symbols\TypedConstantTests.cs (8)
49Assert.Equal(common.Kind, lang.Kind); 53Assert.Equal(common.Kind, common2.Kind); 63Assert.Equal(commonArray.Kind, langArray.Kind); 67Assert.Equal(commonArray.Kind, commonArray2.Kind);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (4)
Extensions.cs (3)
406Assert.Equal(kind, arg.Kind); 415Assert.Equal(arg.Kind, kind); 424switch (arg.Kind)
TestAttributesVisitor.cs (1)
189if (value.Kind == TypedConstantKind.Array)
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (2)
Metadata\WinMdDumpTest.cs (2)
290switch (constant.Kind) 335throw ExceptionUtilities.UnexpectedValue(constant.Kind);
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (1)
28switch (typedConstant.Kind)
Microsoft.CodeAnalysis.Features (4)
EmbeddedLanguages\EmbeddedLanguageDetector.cs (1)
386if (argument.Kind != TypedConstantKind.Primitive || argument.Value is not string argString)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
833attribute.ConstructorArguments is [_, { Kind: TypedConstantKind.Primitive, Value: string checkId }, ..]) 844Kind: TypedConstantKind.Primitive,
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
692attribute.ConstructorArguments is [{ Kind: TypedConstantKind.Primitive, Type.SpecialType: SpecialType.System_String, Value: string value }])
Microsoft.CodeAnalysis.VisualBasic (25)
Emit\AttributeDataAdapter.vb (1)
70Select Case argument.Kind
Symbols\Attributes\AttributeData.vb (9)
438Debug.Assert(ctorArgument.Kind = TypedConstantKind.Enum OrElse ctorArgument.Kind = TypedConstantKind.Primitive) 440Dim interfaceType As ClassInterfaceType = If(ctorArgument.Kind = TypedConstantKind.Enum, 465Debug.Assert(ctorArgument.Kind = TypedConstantKind.Enum OrElse ctorArgument.Kind = TypedConstantKind.Primitive) 467interfaceType = If(ctorArgument.Kind = TypedConstantKind.Enum, 483Debug.Assert(ctorArgument.Kind = TypedConstantKind.Enum OrElse ctorArgument.Kind = TypedConstantKind.Primitive) 485Return If(ctorArgument.Kind = TypedConstantKind.Enum,
Symbols\Retargeting\RetargetingSymbolTranslator.vb (3)
729If oldConstant.Kind = TypedConstantKind.Array Then 741If (oldConstant.Kind = TypedConstantKind.Type) AndAlso (oldConstantValue IsNot Nothing) Then 749Return New TypedConstant(newConstantType, oldConstant.Kind, newConstantValue)
Symbols\Source\SourceNamedTypeSymbol.vb (1)
2220Debug.Assert(argument.Kind = TypedConstantKind.Type)
Symbols\Source\SourceNamedTypeSymbol_ComClass.vb (5)
41Dim strVal As String = If(args(0).Kind <> TypedConstantKind.Array, TryCast(args(0).ValueInternal, String), Nothing) 48strVal = If(args(1).Kind <> TypedConstantKind.Array, TryCast(args(1).ValueInternal, String), Nothing) 54strVal = If(args(2).Kind <> TypedConstantKind.Array, TryCast(args(2).ValueInternal, String), Nothing) 311Dim value As Object = If(typedValue.Kind <> TypedConstantKind.Array, typedValue.ValueInternal, Nothing) 485Dim value As Object = If(typedValue.Kind <> TypedConstantKind.Array, typedValue.ValueInternal, Nothing)
Symbols\Source\SourceParameterSymbol.vb (2)
421Dim specialType = If(arg.Kind = TypedConstantKind.Enum, 427If arg.Kind <> TypedConstantKind.Array AndAlso
Symbols\TypedConstant.vb (4)
33If constant.Kind = TypedConstantKind.Array Then 37If constant.Kind = TypedConstantKind.Type OrElse constant.TypeInternal.SpecialType = SpecialType.System_Object Then 41If constant.Kind = TypedConstantKind.Enum Then 51Debug.Assert(constant.Kind = TypedConstantKind.Enum)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.vb (1)
19Select Case typedConstant.Kind
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (8)
SymbolsTests\TypedConstantTests.vb (8)
40Assert.Equal(common.Kind, lang.Kind) 44Assert.Equal(common.Kind, common2.Kind) 53Assert.Equal(commonArray.Kind, langArray.Kind) 57Assert.Equal(commonArray.Kind, commonArray2.Kind)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (1)
Extensions.vb (1)
180Select Case arg.Kind
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.vb (1)
19Select Case typedConstant.Kind
Microsoft.Extensions.Logging.Generators (3)
LoggerMessageGenerator.Parser.cs (3)
140if (typedConstant.Kind == TypedConstantKind.Error) 196if (typedConstant.Kind == TypedConstantKind.Error) 854private static object GetItem(TypedConstant arg) => arg.Kind == TypedConstantKind.Array ? arg.Values : arg.Value;
Microsoft.Extensions.Options.SourceGeneration (2)
Parser.cs (2)
509if (argument.Kind == TypedConstantKind.Array) 522if (namedArgument.Value.Kind == TypedConstantKind.Array)
Microsoft.Gen.Metrics (5)
Parser.cs (5)
261&& attributeData.ConstructorArguments[0].Kind == TypedConstantKind.Primitive) 287if (arg.Value.Kind == TypedConstantKind.Primitive && 300if (arg.Kind != TypedConstantKind.Array) 307if (item.Kind != TypedConstantKind.Primitive) 423&& methodAttribute.ConstructorArguments[0].Kind == TypedConstantKind.Type)
Microsoft.Gen.MetricsReports (5)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (5)
261&& attributeData.ConstructorArguments[0].Kind == TypedConstantKind.Primitive) 287if (arg.Value.Kind == TypedConstantKind.Primitive && 300if (arg.Kind != TypedConstantKind.Array) 307if (item.Kind != TypedConstantKind.Primitive) 423&& methodAttribute.ConstructorArguments[0].Kind == TypedConstantKind.Type)
System.Text.RegularExpressions.Generator (1)
RegexGenerator.Parser.cs (1)
69if (generatedRegexAttr.ConstructorArguments.Any(ca => ca.Kind == TypedConstantKind.Error))