Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / test-partial-34.cs
1 using System;
2 using CustomAttributes;
3
4 partial class A
5 {
6         // Partial methods w/o attributes.
7         partial void PartialMethodWith_NoAttr_NoDefn(string s);
8         partial void PartialMethodWith_NoAttr_Decl(string s);
9
10         // Partial methods w/o a definition.
11         [AttributeA("ANoDef")]
12         partial void PartialMethodWith_AAttr_NoDefn(string s);
13         partial void PartialMethodWith_BAttr_NoDefn([AttributeB("BNoDef")]string s);
14
15         // Attributes only on declaration.
16         [AttributeA("ADecl")]
17         partial void PartialMethodWith_AAttr_Decl(string s);
18         partial void PartialMethodWith_BAttr_Decl([AttributeB("BDecl")]string s);
19
20         // Attributes only on definition.
21         partial void PartialMethodWith_AAttr_Defn(string s);
22         partial void PartialMethodWith_BAttr_Defn(string s);
23
24         // Different Attribute on definition.
25         [AttributeA("WithABAttr")]
26         partial void PartialMethodWith_ABAttr(string s);
27         partial void PartialMethodWith_BAAttr([AttributeB("WithBAAttr")]string s);
28 }
29
30 partial class A
31 {
32         // Partial methods w/o attributes.
33         partial void PartialMethodWith_NoAttr_Decl(string s) { }
34
35         // Attributes only on declaration.
36         partial void PartialMethodWith_AAttr_Decl(string s) { }
37         partial void PartialMethodWith_BAttr_Decl(string s) { }
38
39         // Attributes only on definition.
40         [AttributeA("ADefn")]
41         partial void PartialMethodWith_AAttr_Defn(string s) { }
42         partial void PartialMethodWith_BAttr_Defn([AttributeB("BDefn")]string s)
43         {
44         }
45
46         // Different Attribute on definition.
47         [AttributeB("ABAttr")]
48         partial void PartialMethodWith_ABAttr(string s) { }
49         partial void PartialMethodWith_BAAttr([AttributeA("BAAttr")]string s) { }
50 }
51
52 namespace CustomAttributes {
53         [AttributeUsage(AttributeTargets.All, AllowMultiple=true)]
54         public class AttributeA : Attribute {
55                 public AttributeA(String a) {}
56         }
57
58         [AttributeUsage(AttributeTargets.All, AllowMultiple=true)]
59         public class AttributeB : Attribute {
60                 public AttributeB(String a) {}
61         }
62 }
63
64 class X
65 {
66         public static void Main ()
67         {
68         }
69 }