152 references to Array
Microsoft.CodeAnalysis (6)
Symbols\Attributes\UnmanagedCallersOnlyAttributeData.cs (1)
37&& value.Kind == TypedConstantKind.Array
Symbols\TypedConstant.cs (5)
25Debug.Assert(kind == TypedConstantKind.Array || !(value is ImmutableArray<TypedConstant>)); 35: this(type, TypedConstantKind.Array, value: array.IsDefault ? null : (object)array) 97if (Kind == TypedConstantKind.Array) 115if (Kind != TypedConstantKind.Array) 183return TypedConstantKind.Array;
Microsoft.CodeAnalysis.Analyzers (2)
MetaAnalyzers\CompilerExtensionStrictApiAnalyzer.cs (1)
184if (arg.Kind == TypedConstantKind.Array)
MetaAnalyzers\DiagnosticAnalyzerAttributeAnalyzer.cs (1)
110if (arg.Kind == TypedConstantKind.Array)
Microsoft.CodeAnalysis.BannedApiAnalyzers (1)
RestrictedInternalsVisibleToAnalyzer.cs (1)
160if (assemblyAttribute.ConstructorArguments[1].Kind != TypedConstantKind.Array ||
Microsoft.CodeAnalysis.CSharp (14)
Binder\Binder_Attributes.cs (2)
727else if (reorderedArgument.Kind == TypedConstantKind.Array && 1052else if (typedConstantKind == TypedConstantKind.Array)
Emitter\Model\AttributeDataAdapter.cs (1)
108case TypedConstantKind.Array:
Symbols\Attributes\AttributeData.cs (2)
259if (value.Kind != TypedConstantKind.Array) 310if (value.Kind != TypedConstantKind.Array)
Symbols\Retargeting\RetargetingSymbolTranslator.cs (1)
1228if (oldConstant.Kind == TypedConstantKind.Array)
Symbols\Source\SourceComplexParameterSymbol.cs (1)
993if (arg.Kind != TypedConstantKind.Array && arg.ValueInternal == null)
Symbols\Source\SourceMethodSymbolWithAttributes.cs (2)
1008{ Kind: not TypedConstantKind.Array, Value: int lineNumberOneBased }, 1009{ Kind: not TypedConstantKind.Array, Value: int characterNumberOneBased }])
Symbols\Source\SourceNamedTypeSymbol_Extension.cs (1)
907case TypedConstantKind.Array:
Symbols\TypedConstantExtensions.cs (1)
25if (constant.Kind == TypedConstantKind.Array)
Symbols\TypeSymbolExtensions.cs (3)
276kind = TypedConstantKind.Array; 298case TypedConstantKind.Array: 304if (kind == TypedConstantKind.Array || kind == TypedConstantKind.Enum)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (1)
104if (existingSyntax?.ArgumentList != null && constant.Kind is not TypedConstantKind.Array && constant.Value is string stringValue)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (1)
38case TypedConstantKind.Array:
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (88)
Attributes\AttributeTests.cs (86)
654Assert.Equal(TypedConstantKind.Array, attributeData.ConstructorArguments.Single().Kind); 1029Assert.Equal(TypedConstantKind.Array, arguments0[2].Kind); 1036Assert.Equal(TypedConstantKind.Array, arguments1[2].Kind); 1716attrs.First().VerifyValue(0, TypedConstantKind.Array, new object[] { typeof(string) }); 1721attrs.First().VerifyValue(0, TypedConstantKind.Array, new object[] { 1, "two", typeof(string), 3.1415926 }); 1724attrs.First().VerifyValue(0, TypedConstantKind.Array, new object[] { new object[] { typeof(string) } }); 3122attrs[0].VerifyValue(0, TypedConstantKind.Array, new char[] { 'q', 'c' }); 3135attrs[0].VerifyNamedArgumentValue<ulong[]>(0, "AryField", TypedConstantKind.Array, new ulong[] { 0, 1, 12345657 }); 3177attrs.First().VerifyValue<object>(0, TypedConstantKind.Array, new object[] { 0, "", null }); 3180attrs.First().VerifyNamedArgumentValue<object[]>(0, "AryProp", TypedConstantKind.Array, new object[] { new object[] { "", typeof(IList<string>) } }); 3219attrs.First().VerifyValue<object>(0, TypedConstantKind.Array, new object[] { 1, null, "Hi" }); 3451attrs.First().VerifyValue<char[]>(0, TypedConstantKind.Array, new char[] { ' ' }); 3452attrs.First().VerifyValue<string[]>(1, TypedConstantKind.Array, new string[] { "" }); 3464attrs.First().VerifyValue<char[]>(0, TypedConstantKind.Array, new char[] { ' ' }); 3465attrs.First().VerifyValue<string[]>(1, TypedConstantKind.Array, new string[] { "" }); 3534attr.VerifyValue<int[]>(1, TypedConstantKind.Array, new int[] { 4, 5, 6 }); 3541attr.VerifyValue<int[]>(1, TypedConstantKind.Array, new int[] { }); 3548attr.VerifyValue<int[]>(1, TypedConstantKind.Array, null); 3590attrs.First().VerifyValue<char[]>(0, TypedConstantKind.Array, new char[] { ' ' }); 3591attrs.First().VerifyValue<string[]>(1, TypedConstantKind.Array, new string[] { "whatever" }); 3603attrs.First().VerifyValue<char[]>(0, TypedConstantKind.Array, new char[] { ' ' }); 3604attrs.First().VerifyValue<string[]>(1, TypedConstantKind.Array, new string[] { "whatever" }); 3684attrs.First().VerifyValue(0, TypedConstantKind.Array, (object[])null); 9415attrs1[0].VerifyValue(0, TypedConstantKind.Array, value1); 9416attrs1[1].VerifyValue(0, TypedConstantKind.Array, value1); 9417attrs1[2].VerifyValue(0, TypedConstantKind.Array, value1); 9420attrs2[0].VerifyValue(0, TypedConstantKind.Array, (object[])null); 9422attrs2[2].VerifyValue(0, TypedConstantKind.Array, (object[])null); 9426attrs3[0].VerifyValue(0, TypedConstantKind.Array, value3); 9427attrs3[1].VerifyValue(0, TypedConstantKind.Array, value3); 9428attrs3[2].VerifyValue(0, TypedConstantKind.Array, value3); 9496attrs1[0].VerifyValue(0, TypedConstantKind.Array, value1); 9497attrs1[1].VerifyValue(0, TypedConstantKind.Array, value1); 9498attrs1[2].VerifyValue(0, TypedConstantKind.Array, value1); 9502attrs2[0].VerifyValue(0, TypedConstantKind.Array, (object[])null); 9504attrs2[2].VerifyValue(0, TypedConstantKind.Array, (object[])null); 9509attrs3[0].VerifyValue(0, TypedConstantKind.Array, value3); 9510attrs3[1].VerifyValue(0, TypedConstantKind.Array, value3); 9511attrs3[2].VerifyValue(0, TypedConstantKind.Array, value3); 9514attrs4[0].VerifyValue(0, TypedConstantKind.Array, new object[] { "A" }); 9580attrs1[0].VerifyValue(0, TypedConstantKind.Array, value1); 9581attrs1[1].VerifyValue(0, TypedConstantKind.Array, value1); 9582attrs1[2].VerifyValue(0, TypedConstantKind.Array, value1); 9585attrs2[0].VerifyValue(0, TypedConstantKind.Array, (object[])null); 9586attrs2[1].VerifyValue(0, TypedConstantKind.Array, (object[])null); 9587attrs2[2].VerifyValue(0, TypedConstantKind.Array, (string[])null); 9591attrs3[0].VerifyValue(0, TypedConstantKind.Array, value3); 9592attrs3[1].VerifyValue(0, TypedConstantKind.Array, value3); 9596attrs4[0].VerifyValue(0, TypedConstantKind.Array, value4); 9597attrs4[1].VerifyValue(0, TypedConstantKind.Array, value4); 9598attrs4[2].VerifyValue(0, TypedConstantKind.Array, value4); 9653attrs1[0].VerifyValue(0, TypedConstantKind.Array, value1); 9654attrs1[1].VerifyValue(0, TypedConstantKind.Array, value1); 9657attrs2[0].VerifyValue(0, TypedConstantKind.Array, (object[])null); 9659attrs2[2].VerifyValue(0, TypedConstantKind.Array, (object[])null); 9663attrs3[0].VerifyValue(0, TypedConstantKind.Array, value3); 9664attrs3[1].VerifyValue(0, TypedConstantKind.Array, value3); 9665attrs3[2].VerifyValue(0, TypedConstantKind.Array, value3); 9727attrs1[0].VerifyValue(0, TypedConstantKind.Array, value1); 9728attrs1[1].VerifyValue(0, TypedConstantKind.Array, value1); 9732attrs2[0].VerifyValue(0, TypedConstantKind.Array, (object[])null); 9734attrs2[2].VerifyValue(0, TypedConstantKind.Array, (object[])null); 9739attrs3[0].VerifyValue(0, TypedConstantKind.Array, value3); 9740attrs3[1].VerifyValue(0, TypedConstantKind.Array, value3); 9741attrs3[2].VerifyValue(0, TypedConstantKind.Array, value3); 9744attrs4[0].VerifyValue(0, TypedConstantKind.Array, new object[] { 1 }); 9807attrs1[0].VerifyValue(0, TypedConstantKind.Array, value1); 9808attrs1[1].VerifyValue(0, TypedConstantKind.Array, new object[] { value1 }); 9809attrs1[2].VerifyValue(0, TypedConstantKind.Array, value1); 9813attrs2[0].VerifyValue(0, TypedConstantKind.Array, value2); 9814attrs2[1].VerifyValue(0, TypedConstantKind.Array, value2); 9818attrs3[0].VerifyValue(0, TypedConstantKind.Array, value3); 9819attrs3[1].VerifyValue(0, TypedConstantKind.Array, value3); 9823attrs4[0].VerifyValue(0, TypedConstantKind.Array, value4); 9824attrs4[1].VerifyValue(0, TypedConstantKind.Array, value4); 9825attrs4[2].VerifyValue(0, TypedConstantKind.Array, value4); 9877attrs[0].VerifyValue(0, TypedConstantKind.Array, nullArray); 9879attrs[1].VerifyValue(0, TypedConstantKind.Array, emptyArray); 9881attrs[2].VerifyValue(0, TypedConstantKind.Array, nullArray); 9882attrs[2].VerifyNamedArgumentValue(0, fieldName, TypedConstantKind.Array, nullArray); 9884attrs[3].VerifyValue(0, TypedConstantKind.Array, emptyArray); 9885attrs[3].VerifyNamedArgumentValue(0, fieldName, TypedConstantKind.Array, nullArray); 9887attrs[4].VerifyValue(0, TypedConstantKind.Array, nullArray); 9888attrs[4].VerifyNamedArgumentValue(0, fieldName, TypedConstantKind.Array, emptyArray); 9890attrs[5].VerifyValue(0, TypedConstantKind.Array, emptyArray); 9891attrs[5].VerifyNamedArgumentValue(0, fieldName, TypedConstantKind.Array, emptyArray);
Attributes\AttributeTests_Dynamic.cs (1)
541Assert.Equal(TypedConstantKind.Array, argument.Kind);
Attributes\AttributeTests_Tuples.cs (1)
638Assert.Equal(TypedConstantKind.Array, arg.Kind);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (14)
Symbols\Metadata\PE\LoadingAttributes.cs (14)
328a.VerifyNamedArgumentValue(0, "IA", TypedConstantKind.Array, new int[] { 1, 2 }); 332a.VerifyNamedArgumentValue(0, "EA", TypedConstantKind.Array, new int[] { 0, 1 }); 336a.VerifyNamedArgumentValue(0, "SA", TypedConstantKind.Array, new string[] { "Yes", "No" }); 340a.VerifyNamedArgumentValue(0, "OA", TypedConstantKind.Array, new string[] { "Yes", "No" }); 346a.VerifyNamedArgumentValue(0, "TA", TypedConstantKind.Array, new TypeSymbol[] { c1, c3 }); 477arg.VerifyValue(0, TypedConstantKind.Array, new int[] { 1, 2 }); 481arg.VerifyValue(0, TypedConstantKind.Array, new object[] { stringType }); 485arg.VerifyValue(0, TypedConstantKind.Array, new object[] { stringType }); 489arg.VerifyValue(0, TypedConstantKind.Array, new object[] { stringType }); 493arg.VerifyValue(0, TypedConstantKind.Array, new object[] { new object[] { stringType } }); 499arg.VerifyValue(0, TypedConstantKind.Array, new object[] { 1, "two", stringType, 3.1415926 }); 505arg.VerifyValue(0, TypedConstantKind.Array, new object[] { 1, new object[] { 2, 3, 4 }, 5 }); 511arg.VerifyValue(0, TypedConstantKind.Array, new int[] { 1, 2, 3 }); 1005attrSym.VerifyValue(0, TypedConstantKind.Array, new sbyte[] { -1, 0, 1 });
Microsoft.CodeAnalysis.CSharp.Test.Utilities (2)
Extensions.cs (1)
426case TypedConstantKind.Array:
TestAttributesVisitor.cs (1)
189if (value.Kind == TypedConstantKind.Array)
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (1)
Metadata\WinMdDumpTest.cs (1)
292case TypedConstantKind.Array:
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (1)
104if (existingSyntax?.ArgumentList != null && constant.Kind is not TypedConstantKind.Array && constant.Value is string stringValue)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (1)
38case TypedConstantKind.Array:
Microsoft.CodeAnalysis.Features (1)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
6924TypedConstantKind.Array => x.Values.IsDefault || x.Values.SequenceEqual(y.Values, Instance),
Microsoft.CodeAnalysis.VisualBasic (11)
Binding\Binder_Attributes.vb (1)
886If kind = TypedConstantKind.Array Then
Emit\AttributeDataAdapter.vb (1)
71Case TypedConstantKind.Array
Symbols\Retargeting\RetargetingSymbolTranslator.vb (1)
726If oldConstant.Kind = TypedConstantKind.Array Then
Symbols\Source\SourceMemberMethodSymbol.vb (1)
1014If arg.Kind <> TypedConstantKind.Array AndAlso CInt(arg.ValueInternal) = DESIGNERSERIALIZATIONVISIBILITYTYPE_CONTENT Then
Symbols\Source\SourceNamedTypeSymbol_ComClass.vb (5)
43Dim strVal As String = If(args(0).Kind <> TypedConstantKind.Array, TryCast(args(0).ValueInternal, String), Nothing) 50strVal = If(args(1).Kind <> TypedConstantKind.Array, TryCast(args(1).ValueInternal, String), Nothing) 56strVal = If(args(2).Kind <> TypedConstantKind.Array, TryCast(args(2).ValueInternal, String), Nothing) 313Dim value As Object = If(typedValue.Kind <> TypedConstantKind.Array, typedValue.ValueInternal, Nothing) 487Dim value As Object = If(typedValue.Kind <> TypedConstantKind.Array, typedValue.ValueInternal, Nothing)
Symbols\Source\SourceParameterSymbol.vb (1)
427If arg.Kind <> TypedConstantKind.Array AndAlso
Symbols\TypedConstant.vb (1)
33If constant.Kind = TypedConstantKind.Array Then
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Parser.cs (1)
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.MetadataExtractor (1)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (1)
300if (arg.Kind != TypedConstantKind.Array)
Microsoft.Gen.Metrics (1)
Parser.cs (1)
300if (arg.Kind != TypedConstantKind.Array)
Microsoft.Gen.MetricsReports (1)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (1)
300if (arg.Kind != TypedConstantKind.Array)
Roslyn.Diagnostics.CSharp.Analyzers (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (1)
104if (existingSyntax?.ArgumentList != null && constant.Kind is not TypedConstantKind.Array && constant.Value is string stringValue)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (1)
38case TypedConstantKind.Array: