3c1f479b9d
Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
27 lines
394 B
C#
27 lines
394 B
C#
// 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;
|
|
}
|
|
}
|