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
);
26 throw new ApplicationException (string.Format ("`{0}' != `{1}'", expected
, line
));
31 public static void Main ()
33 var c
= new CallerLineNumberTest ();
37 Action a
= () => TraceStatic (37);