X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Ftests%2Ftest-primary-ctor-05.cs;h=ded85daa0e1755caa600c5087741e00a4fdb01e3;hb=56f1d451006c9194af19b7a5bf9c37d65ed8051c;hp=503e944c558087b8d986298845547eb8f1d49bdc;hpb=8b1ca21e8feaabebc9dc3643ebf94b2a99162c8e;p=mono.git diff --git a/mcs/tests/test-primary-ctor-05.cs b/mcs/tests/test-primary-ctor-05.cs index 503e944c558..ded85daa0e1 100644 --- a/mcs/tests/test-primary-ctor-05.cs +++ b/mcs/tests/test-primary-ctor-05.cs @@ -1,4 +1,4 @@ -// Compiler options: -warnaserror +// Compiler options: -warnaserror -langversion:experimental using System; using System.Reflection; @@ -7,21 +7,19 @@ class A : Attribute { } -class X ([field:A] int value) +[method:A] +class X (int value) { public int f = value; - public int P { - get { - return value; - } - } + public int P { get; } = value; public static int Main () { - var attr = (A)typeof (X).GetField("value", BindingFlags.NonPublic | BindingFlags.Instance).GetCustomAttribute (typeof (A)); + var x = typeof (X); + var attr = x.GetConstructors ()[0].GetCustomAttribute (typeof (A)) as A; if (attr == null) - return 1; + return 2; return 0; }