New test.
[mono.git] / mcs / errors / cs0246-15.cs
1 // cs0246-15.cs: The type or namespace name `InvalidTypeBlah' could not be found. Are you missing a using directive or an assembly reference?
2 // Line: 17
3
4 //
5 // This test is here to test that the compiler does not crash after it
6 // reports the error due to an invalid type being referenced in the 
7 // delegate
8 //
9 using System;
10
11 public class AnonDelegateTest 
12 {
13         public delegate void TestDelegate(AnonDelegateTest something, string b);
14
15         public static void Main()
16         {
17                 AnonDelegateTest test = new AnonDelegateTest();
18                 
19                 // Incorrect; mcs throws unhandled exception here
20                 test.Call(delegate(InvalidTypeBlah something, string b) {
21                         Console.WriteLine(b);
22                 });
23         }
24
25         public void Call(TestDelegate d)
26         {
27                 d(this, "Hello");
28         }
29 }
30
31