update readme (#21797)
[mono-project.git] / mcs / errors / cs1674-3.cs
blobebc28e6dd9f1249e4aa300fe41953cf8600ea604
1 // CS1674: `NoIDispose': type used in a using statement must be implicitly convertible to `System.IDisposable'
2 // Line: 27
4 using System;
6 class MyDispose : IDisposable {
7 public bool disposed;
9 public void Dispose ()
11 disposed = true;
15 class NoIDispose {
16 static public MyDispose x;
18 public NoIDispose ()
22 static NoIDispose ()
24 x = new MyDispose ();
27 public static implicit operator MyDispose (NoIDispose a)
29 return x;
33 class Y {
34 static void B ()
36 using (NoIDispose a = new NoIDispose ()){