Bump API snapshot submodule
[mono.git] / mcs / errors / cs1674-3.cs
1 // CS1674: `NoIDispose': type used in a using statement must be implicitly convertible to `System.IDisposable'
2 // Line: 27
3
4 using System;
5
6 class MyDispose : IDisposable {
7         public bool disposed;
8         
9         public void Dispose ()
10         {
11                 disposed = true;
12         }
13 }
14
15 class NoIDispose {
16         static public MyDispose x;
17
18         public NoIDispose ()
19         {
20         }
21         
22         static NoIDispose ()
23         {
24                 x = new MyDispose ();
25         }
26         
27         public static implicit operator MyDispose (NoIDispose a)
28         {
29                 return x;
30         }
31 }
32
33 class Y {
34         static void B ()
35         {
36                 using (NoIDispose a = new NoIDispose ()){
37                 }
38         }
39         
40 }
41