a575963da9
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
29 lines
412 B
C#
29 lines
412 B
C#
// Compiler options: -warnaserror
|
|
|
|
using System;
|
|
using System.Reflection;
|
|
|
|
class A : Attribute
|
|
{
|
|
}
|
|
|
|
class X ([field:A] int value)
|
|
{
|
|
public int f = value;
|
|
|
|
public int P {
|
|
get {
|
|
return value;
|
|
}
|
|
}
|
|
|
|
public static int Main ()
|
|
{
|
|
var attr = (A)typeof (X).GetField("value", BindingFlags.NonPublic | BindingFlags.Instance).GetCustomAttribute (typeof (A));
|
|
if (attr == null)
|
|
return 1;
|
|
|
|
return 0;
|
|
}
|
|
}
|