[metadata] Fix leaks when handling a few attributes (#16675)
[mono-project.git] / mcs / tests / gtest-optional-23.cs
blob21fd3c26ea6bbefd09c2da372079e6eed71dbc0a
1 using System;
2 using System.Runtime.CompilerServices;
4 class CallerLineNumberTest
6 object field = TraceStatic (6);
8 CallerLineNumberTest ()
9 : this (TraceStatic (9))
13 CallerLineNumberTest (object arg)
17 static void TraceStatic2([CallerLineNumber] double line = -1, [CallerLineNumber] decimal line2 = -1)
21 public static object TraceStatic(int expected, [CallerLineNumber] int line = -1)
23 Console.WriteLine (line);
25 if (expected != line)
26 throw new ApplicationException (string.Format ("`{0}' != `{1}'", expected, line));
28 return line;
31 public static void Main ()
33 var c = new CallerLineNumberTest ();
34 TraceStatic (34);
35 TraceStatic2 ();
37 Action a = () => TraceStatic (37);
38 a ();