Merge pull request #5675 from mono/glib-debug-symbols
[mono.git] / mcs / tests / gtest-optional-23.cs
1 using System;
2 using System.Runtime.CompilerServices;
3
4 class CallerLineNumberTest
5 {
6         object field = TraceStatic (6);
7         
8         CallerLineNumberTest ()
9                 : this (TraceStatic (9))
10         {
11         }
12         
13         CallerLineNumberTest (object arg)
14         {
15         }
16         
17         static void TraceStatic2([CallerLineNumber] double line = -1, [CallerLineNumber] decimal line2 = -1)
18         {
19         }
20         
21         public static object TraceStatic(int expected, [CallerLineNumber] int line = -1)
22         {
23                 Console.WriteLine (line);
24                 
25                 if (expected != line)
26                         throw new ApplicationException (string.Format ("`{0}' !=  `{1}'", expected, line));
27                 
28                 return line;
29         }
30         
31         public static void Main ()
32         {
33                 var c = new CallerLineNumberTest ();
34                 TraceStatic (34);
35                 TraceStatic2 ();
36                 
37                 Action a = () => TraceStatic (37);
38                 a ();
39         }
40 }