+2004-01-09 Zoltan Varga <vargaz@freemail.hu>
+
+ * custom-attr.cs: Add test for properties with array type.
+
2003-12-13 Patrik Torstensson <p@rxc.se>
* bug-42136.cs: invalid liveness analyse for locals
ival = blah;
}
}
+
+ public class My3Attribute : Attribute {
+ char[] array_val;
+
+ public char[] Prop {
+ get {
+ return array_val;
+ }
+ set {
+ array_val = value;
+ }
+ }
+ }
+
[My("testclass")]
[My2("testclass", 22)]
+ [My3(Prop = new char [] { 'A', 'B', 'C' })]
public class Test {
static public int Main() {
System.Reflection.MemberInfo info = typeof (Test);
for (int i = 0; i < attributes.Length; i ++) {
System.Console.WriteLine(attributes[i]);
}
- if (attributes.Length != 2)
+ if (attributes.Length != 3)
return 1;
- MyAttribute attr = (MyAttribute) attributes [0];
- if (attr.val != "testclass")
- return 2;
+ for (int i = 0; i < attributes.Length; ++i) {
+ if (attributes [i] is MyAttribute) {
+ if (((MyAttribute)attributes [i]).val != "testclass")
+ return 2;
+ }
+ if (attributes [i] is My3Attribute) {
+ if (new String (((My3Attribute)attributes [i]).Prop) != "ABC")
+ return 3;
+ }
+ }
return 0;
}
}