Fix lookup for all SourceLink mappings, prefer local file over SourceLink
[mono-project.git] / mono / tests / bug-10834.cs
blob26b07d7611960f3c17c484f0659804d17a79d266
1 using System;
2 using System.Reflection;
4 namespace Repro {
5 class Program
7 static bool Check (Type t)
9 Console.WriteLine ($"--- {t}");
11 var m = t.GetMethod ("M1");
12 Console.WriteLine (m);
14 foreach(var p in m.GetParameters ())
15 Console.WriteLine ($"{p}: {p.ParameterType} / {p.GetRequiredCustomModifiers().Length}");
17 Console.WriteLine ();
18 return m.GetParameters()[0].GetRequiredCustomModifiers().Length == 1;
21 static int Main(string[] args)
23 if (!Check (typeof (C<>)))
24 return 1;
25 if (!Check (typeof (C<S1>)))
26 return 2;
28 var o = new Bug ();
29 int res = o.M1 (new S1 ());
30 Console.WriteLine (res);
31 if (res != 0)
32 return 3;
33 Console.WriteLine ("All good");
34 return 0;
37 abstract class C<U>
39 public abstract int M1<T>(in T arg) where T : U, I1;
42 class Bug : C<S1>
44 public override int M1<T2> (in T2 arg)
46 Console.WriteLine ("C<S1>::M1");
47 arg.M3();
48 return arg.M4();
52 interface I1
54 void M3();
55 int M4();
58 public struct S1: I1
60 public int field;
61 public void M3 ()
63 Console.WriteLine ("S1:M3");
64 field = 42;
67 public int M4() {
68 Console.WriteLine ("S1:M4 {0}", field);
70 return field;