You've already forked linux-packaging-mono
Imported Upstream version 4.2.0.179
Former-commit-id: 4610231f55806d2a05ed69e5ff3faa7336cc1479
This commit is contained in:
committed by
Jo Shields
parent
aa7da660d6
commit
c042cd0c52
69
mcs/tests/test-partial-34.cs
Normal file
69
mcs/tests/test-partial-34.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using CustomAttributes;
|
||||
|
||||
partial class A
|
||||
{
|
||||
// Partial methods w/o attributes.
|
||||
partial void PartialMethodWith_NoAttr_NoDefn(string s);
|
||||
partial void PartialMethodWith_NoAttr_Decl(string s);
|
||||
|
||||
// Partial methods w/o a definition.
|
||||
[AttributeA("ANoDef")]
|
||||
partial void PartialMethodWith_AAttr_NoDefn(string s);
|
||||
partial void PartialMethodWith_BAttr_NoDefn([AttributeB("BNoDef")]string s);
|
||||
|
||||
// Attributes only on declaration.
|
||||
[AttributeA("ADecl")]
|
||||
partial void PartialMethodWith_AAttr_Decl(string s);
|
||||
partial void PartialMethodWith_BAttr_Decl([AttributeB("BDecl")]string s);
|
||||
|
||||
// Attributes only on definition.
|
||||
partial void PartialMethodWith_AAttr_Defn(string s);
|
||||
partial void PartialMethodWith_BAttr_Defn(string s);
|
||||
|
||||
// Different Attribute on definition.
|
||||
[AttributeA("WithABAttr")]
|
||||
partial void PartialMethodWith_ABAttr(string s);
|
||||
partial void PartialMethodWith_BAAttr([AttributeB("WithBAAttr")]string s);
|
||||
}
|
||||
|
||||
partial class A
|
||||
{
|
||||
// Partial methods w/o attributes.
|
||||
partial void PartialMethodWith_NoAttr_Decl(string s) { }
|
||||
|
||||
// Attributes only on declaration.
|
||||
partial void PartialMethodWith_AAttr_Decl(string s) { }
|
||||
partial void PartialMethodWith_BAttr_Decl(string s) { }
|
||||
|
||||
// Attributes only on definition.
|
||||
[AttributeA("ADefn")]
|
||||
partial void PartialMethodWith_AAttr_Defn(string s) { }
|
||||
partial void PartialMethodWith_BAttr_Defn([AttributeB("BDefn")]string s)
|
||||
{
|
||||
}
|
||||
|
||||
// Different Attribute on definition.
|
||||
[AttributeB("ABAttr")]
|
||||
partial void PartialMethodWith_ABAttr(string s) { }
|
||||
partial void PartialMethodWith_BAAttr([AttributeA("BAAttr")]string s) { }
|
||||
}
|
||||
|
||||
namespace CustomAttributes {
|
||||
[AttributeUsage(AttributeTargets.All, AllowMultiple=true)]
|
||||
public class AttributeA : Attribute {
|
||||
public AttributeA(String a) {}
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.All, AllowMultiple=true)]
|
||||
public class AttributeB : Attribute {
|
||||
public AttributeB(String a) {}
|
||||
}
|
||||
}
|
||||
|
||||
class X
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user