190 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.CSharp (13)
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)
261if (value.Kind != TypedConstantKind.Array) 312if (value.Kind != TypedConstantKind.Array)
Symbols\Retargeting\RetargetingSymbolTranslator.cs (1)
1228if (oldConstant.Kind == TypedConstantKind.Array)
Symbols\Source\SourceComplexParameterSymbol.cs (1)
989if (arg.Kind != TypedConstantKind.Array && arg.ValueInternal == null)
Symbols\Source\SourceMethodSymbolWithAttributes.cs (2)
992{ Kind: not TypedConstantKind.Array, Value: int lineNumberOneBased }, 993{ Kind: not TypedConstantKind.Array, Value: int characterNumberOneBased }])
Symbols\TypedConstantExtensions.cs (1)
25if (constant.Kind == TypedConstantKind.Array)
Symbols\TypeSymbolExtensions.cs (3)
275kind = TypedConstantKind.Array; 297case TypedConstantKind.Array: 303if (kind == TypedConstantKind.Array || kind == TypedConstantKind.Enum)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (1)
39case 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); 9413attrs1[0].VerifyValue(0, TypedConstantKind.Array, value1); 9414attrs1[1].VerifyValue(0, TypedConstantKind.Array, value1); 9415attrs1[2].VerifyValue(0, TypedConstantKind.Array, value1); 9418attrs2[0].VerifyValue(0, TypedConstantKind.Array, (object[])null); 9420attrs2[2].VerifyValue(0, TypedConstantKind.Array, (object[])null); 9424attrs3[0].VerifyValue(0, TypedConstantKind.Array, value3); 9425attrs3[1].VerifyValue(0, TypedConstantKind.Array, value3); 9426attrs3[2].VerifyValue(0, TypedConstantKind.Array, value3); 9494attrs1[0].VerifyValue(0, TypedConstantKind.Array, value1); 9495attrs1[1].VerifyValue(0, TypedConstantKind.Array, value1); 9496attrs1[2].VerifyValue(0, TypedConstantKind.Array, value1); 9500attrs2[0].VerifyValue(0, TypedConstantKind.Array, (object[])null); 9502attrs2[2].VerifyValue(0, TypedConstantKind.Array, (object[])null); 9507attrs3[0].VerifyValue(0, TypedConstantKind.Array, value3); 9508attrs3[1].VerifyValue(0, TypedConstantKind.Array, value3); 9509attrs3[2].VerifyValue(0, TypedConstantKind.Array, value3); 9512attrs4[0].VerifyValue(0, TypedConstantKind.Array, new object[] { "A" }); 9578attrs1[0].VerifyValue(0, TypedConstantKind.Array, value1); 9579attrs1[1].VerifyValue(0, TypedConstantKind.Array, value1); 9580attrs1[2].VerifyValue(0, TypedConstantKind.Array, value1); 9583attrs2[0].VerifyValue(0, TypedConstantKind.Array, (object[])null); 9584attrs2[1].VerifyValue(0, TypedConstantKind.Array, (object[])null); 9585attrs2[2].VerifyValue(0, TypedConstantKind.Array, (string[])null); 9589attrs3[0].VerifyValue(0, TypedConstantKind.Array, value3); 9590attrs3[1].VerifyValue(0, TypedConstantKind.Array, value3); 9594attrs4[0].VerifyValue(0, TypedConstantKind.Array, value4); 9595attrs4[1].VerifyValue(0, TypedConstantKind.Array, value4); 9596attrs4[2].VerifyValue(0, TypedConstantKind.Array, value4); 9651attrs1[0].VerifyValue(0, TypedConstantKind.Array, value1); 9652attrs1[1].VerifyValue(0, TypedConstantKind.Array, value1); 9655attrs2[0].VerifyValue(0, TypedConstantKind.Array, (object[])null); 9657attrs2[2].VerifyValue(0, TypedConstantKind.Array, (object[])null); 9661attrs3[0].VerifyValue(0, TypedConstantKind.Array, value3); 9662attrs3[1].VerifyValue(0, TypedConstantKind.Array, value3); 9663attrs3[2].VerifyValue(0, TypedConstantKind.Array, value3); 9725attrs1[0].VerifyValue(0, TypedConstantKind.Array, value1); 9726attrs1[1].VerifyValue(0, TypedConstantKind.Array, value1); 9730attrs2[0].VerifyValue(0, TypedConstantKind.Array, (object[])null); 9732attrs2[2].VerifyValue(0, TypedConstantKind.Array, (object[])null); 9737attrs3[0].VerifyValue(0, TypedConstantKind.Array, value3); 9738attrs3[1].VerifyValue(0, TypedConstantKind.Array, value3); 9739attrs3[2].VerifyValue(0, TypedConstantKind.Array, value3); 9742attrs4[0].VerifyValue(0, TypedConstantKind.Array, new object[] { 1 }); 9805attrs1[0].VerifyValue(0, TypedConstantKind.Array, value1); 9806attrs1[1].VerifyValue(0, TypedConstantKind.Array, new object[] { value1 }); 9807attrs1[2].VerifyValue(0, TypedConstantKind.Array, value1); 9811attrs2[0].VerifyValue(0, TypedConstantKind.Array, value2); 9812attrs2[1].VerifyValue(0, TypedConstantKind.Array, value2); 9816attrs3[0].VerifyValue(0, TypedConstantKind.Array, value3); 9817attrs3[1].VerifyValue(0, TypedConstantKind.Array, value3); 9821attrs4[0].VerifyValue(0, TypedConstantKind.Array, value4); 9822attrs4[1].VerifyValue(0, TypedConstantKind.Array, value4); 9823attrs4[2].VerifyValue(0, TypedConstantKind.Array, value4); 9875attrs[0].VerifyValue(0, TypedConstantKind.Array, nullArray); 9877attrs[1].VerifyValue(0, TypedConstantKind.Array, emptyArray); 9879attrs[2].VerifyValue(0, TypedConstantKind.Array, nullArray); 9880attrs[2].VerifyNamedArgumentValue(0, fieldName, TypedConstantKind.Array, nullArray); 9882attrs[3].VerifyValue(0, TypedConstantKind.Array, emptyArray); 9883attrs[3].VerifyNamedArgumentValue(0, fieldName, TypedConstantKind.Array, nullArray); 9885attrs[4].VerifyValue(0, TypedConstantKind.Array, nullArray); 9886attrs[4].VerifyNamedArgumentValue(0, fieldName, TypedConstantKind.Array, emptyArray); 9888attrs[5].VerifyValue(0, TypedConstantKind.Array, emptyArray); 9889attrs[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 (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (1)
39case TypedConstantKind.Array:
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)
729If oldConstant.Kind = TypedConstantKind.Array Then
Symbols\Source\SourceMemberMethodSymbol.vb (1)
1013If arg.Kind <> TypedConstantKind.Array AndAlso CInt(arg.ValueInternal) = DESIGNERSERIALIZATIONVISIBILITYTYPE_CONTENT Then
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 (1)
427If arg.Kind <> TypedConstantKind.Array AndAlso
Symbols\TypedConstant.vb (1)
33If constant.Kind = TypedConstantKind.Array Then
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.vb (1)
23Case TypedConstantKind.Array
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (31)
Attributes\AttributeTests.vb (30)
657attrs(0).VerifyValue(0, TypedConstantKind.Array, {GetType(String)}) 661attrs(0).VerifyValue(Of Object())(0, TypedConstantKind.Array, {1, "two", GetType(String), 3.1415926}) 663attrs(0).VerifyValue(0, TypedConstantKind.Array, {New Object() {GetType(String)}}) 799attrs(0).VerifyValue(0, TypedConstantKind.Array, {"q"c, "c"c}) 807attrs(0).VerifyValue(Of ULong())(0, "AryField", TypedConstantKind.Array, New ULong() {0, 1, 12345657}) 853attrs(0).VerifyValue(Of Object)(0, TypedConstantKind.Array, New Object() {0, "", Nothing}) 856attrs(0).VerifyValue(Of Object())(0, "AryProp", TypedConstantKind.Array, New Object() {New Object() {"", GetType(IList(Of String))}}) 906attrs(0).VerifyValue(Of Object)(0, TypedConstantKind.Array, New Object() {1, Nothing, "Hi"}) 941attrs(0).VerifyValue(Of Char())(0, TypedConstantKind.Array, New Char() {" "c, Nothing}) 942attrs(0).VerifyValue(Of String())(1, TypedConstantKind.Array, New String() {""}) 952attrs(0).VerifyValue(Of Char())(0, TypedConstantKind.Array, New Char() {" "c, Nothing}) 953attrs(0).VerifyValue(Of String())(1, TypedConstantKind.Array, New String() {""}) 1171attrs(1).VerifyValue(Of Object)(0, TypedConstantKind.Array, New String() {"a", "b"}) 1173attrs(3).VerifyValue(Of Object)(0, "X", TypedConstantKind.Array, New String() {"a", "b"}) 4327methods(0).GetAttributes().Single().VerifyValue(0, TypedConstantKind.Array, New Integer() {1, 2, 3}) 4328methods(1).GetAttributes().Single().VerifyValue(0, TypedConstantKind.Array, New Object() {1, 2, 3}) 4329methods(2).GetAttributes().Single().VerifyValue(0, TypedConstantKind.Array, New String() {"A", "B", "C"}) 4330methods(3).GetAttributes().Single().VerifyValue(0, TypedConstantKind.Array, New Object() {"A", "B", "C"}) 4331methods(4).GetAttributes().Single().VerifyValue(0, TypedConstantKind.Array, New Object() {}) ' Value was invalid. 4332methods(5).GetAttributes().Single().VerifyValue(0, TypedConstantKind.Array, New Object() {DirectCast({1, 2, 3}, Object), DirectCast({"A", "B", "C"}, Object)}) 4398attrs(0).VerifyValue(0, TypedConstantKind.Array, nullArray) 4400attrs(1).VerifyValue(0, TypedConstantKind.Array, emptyArray) 4402attrs(2).VerifyValue(0, TypedConstantKind.Array, nullArray) 4403attrs(2).VerifyNamedArgumentValue(0, fieldName, TypedConstantKind.Array, nullArray) 4405attrs(3).VerifyValue(0, TypedConstantKind.Array, emptyArray) 4406attrs(3).VerifyNamedArgumentValue(0, fieldName, TypedConstantKind.Array, nullArray) 4408attrs(4).VerifyValue(0, TypedConstantKind.Array, nullArray) 4409attrs(4).VerifyNamedArgumentValue(0, fieldName, TypedConstantKind.Array, emptyArray) 4411attrs(5).VerifyValue(0, TypedConstantKind.Array, emptyArray) 4412attrs(5).VerifyNamedArgumentValue(0, fieldName, TypedConstantKind.Array, emptyArray)
Attributes\AttributeTests_Tuples.vb (1)
435Assert.Equal(TypedConstantKind.Array, arg.Kind)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (14)
SymbolsTests\Metadata\PE\LoadingAttributes.vb (14)
393a.VerifyValue(0, "IA", TypedConstantKind.Array, {1, 2}) 397a.VerifyValue(0, "EA", TypedConstantKind.Array, {0, 1}) 401a.VerifyValue(0, "SA", TypedConstantKind.Array, {"Yes", "No"}) 405a.VerifyValue(0, "OA", TypedConstantKind.Array, {"Yes", "No"}) 411a.VerifyValue(0, "TA", TypedConstantKind.Array, {c1, c3}) 540arg.VerifyValue(0, TypedConstantKind.Array, {1, 2}) 544arg.VerifyValue(0, TypedConstantKind.Array, {stringType}) 548arg.VerifyValue(0, TypedConstantKind.Array, New Object() {stringType}) 552arg.VerifyValue(0, TypedConstantKind.Array, {stringType}) 556arg.VerifyValue(0, TypedConstantKind.Array, New Object() {New Object() {stringType}}) 562arg.VerifyValue(0, TypedConstantKind.Array, New Object() {1, "two", stringType, 3.1415926}) 568VerifyValue(arg, 0, TypedConstantKind.Array, New Object() {1, New Object() {2, 3, 4}, 5}) 574VerifyValue(arg, 0, TypedConstantKind.Array, New Integer() {1, 2, 3}) 1101attrSym.VerifyValue(0, TypedConstantKind.Array, New SByte() {-1, 0, 1})
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (1)
Extensions.vb (1)
181Case TypedConstantKind.Array
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.vb (1)
23Case TypedConstantKind.Array
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.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)