2006-12-05 Chris Toshok <toshok@ximian.com>
[mcs.git] / tests / test-454.cs
blob9032303ae42bb46d940dcbf48d4e0cb2875690dc
1 // string array initializer is allowed as a parameter type.
2 using System;
4 class FooAttribute : Attribute
6 public string [] StringValues;
7 public object [] ObjectValues;
8 public Type [] Types;
10 public FooAttribute ()
15 [Foo (StringValues = new string [] {"foo", "bar", "baz"},
16 ObjectValues = new object [] {1, 'A', "B"},
17 Types = new Type [] {typeof (int), typeof (Type)}
19 class Test
21 public static void Main ()
23 FooAttribute foo = (FooAttribute) typeof (Test)
24 .GetCustomAttributes (false) [0];
25 if (foo.StringValues [0] != "foo"
26 || foo.StringValues [1] != "bar"
27 || foo.StringValues [2] != "baz"
28 || 1 != (int) foo.ObjectValues [0]
29 || 'A' != (char) foo.ObjectValues [1]
30 || "B" != (string) foo.ObjectValues [2]
31 || foo.Types [0] != typeof (int)
32 || foo.Types [1] != typeof (Type)
34 throw new ApplicationException ();