linux-packaging-mono/mcs/tests/test-primary-ctor-05.cs

27 lines
394 B
C#
Raw Normal View History

// Compiler options: -warnaserror -langversion:experimental
using System;
using System.Reflection;
class A : Attribute
{
}
[method:A]
class X (int value)
{
public int f = value;
public int P { get; } = value;
public static int Main ()
{
var x = typeof (X);
var attr = x.GetConstructors ()[0].GetCustomAttribute (typeof (A)) as A;
if (attr == null)
return 2;
return 0;
}
}