Merge pull request #4185 from BrzVlad/fix-arm64-finally-abort
[mono.git] / mcs / tests / test-primary-ctor-05.cs
index 503e944c558087b8d986298845547eb8f1d49bdc..ded85daa0e1755caa600c5087741e00a4fdb01e3 100644 (file)
@@ -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;
        }