[metadata] Fix leaks when handling a few attributes (#16675)
[mono-project.git] / mcs / tests / dtest-error-03.cs
blob0417292753ed3c6a6e02347766d9b00bf04465a2
1 using System;
2 using Microsoft.CSharp.RuntimeBinder;
3 using System.Dynamic;
4 using System.Runtime.CompilerServices;
6 public class C
10 public class Test
12 public static int Main ()
14 var getter = CallSite<Func<CallSite, object, object>>.Create (
15 Binder.GetMember (
16 CSharpBinderFlags.None, "n", null, new[] {
17 CSharpArgumentInfo.Create (CSharpArgumentInfoFlags.None, null) }));
19 try {
20 getter.Target (getter, new C ());
21 } catch (RuntimeBinderException e) {
22 if (e.Message == "'C' does not contain a definition for 'n'")
23 return 0;
25 return 2;
28 return 1;