[tuner] handle the case with multiple "preserve" attributes
[mono-project.git] / mcs / tests / gtest-optional-17.cs
blobd2782d7cb2557d65f3922fb0b082f8373b5479a8
1 using System;
2 using System.Reflection;
3 using System.Runtime.InteropServices;
5 struct BI
7 public static implicit operator BI (int i)
9 return new BI ();
13 class C
15 public static void M ([DefaultParameterValue (1 + 3)]BI step)
19 public static void M2 ([DefaultParameterValue (1)] object o)
23 public static int Main ()
25 var m = typeof (C).GetMethod ("M");
26 var p = m.GetParameters ()[0];
28 Console.WriteLine (p.Attributes);
29 if (p.Attributes != ParameterAttributes.HasDefault)
30 return 2;
32 if ((int) p.DefaultValue != 4)
33 return 1;
35 Console.WriteLine (p.DefaultValue);
36 return 0;