Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

42 lines
546 B
C#

// CS1674: `NoIDispose': type used in a using statement must be implicitly convertible to `System.IDisposable'
// Line: 27
using System;
class MyDispose : IDisposable {
public bool disposed;
public void Dispose ()
{
disposed = true;
}
}
class NoIDispose {
static public MyDispose x;
public NoIDispose ()
{
}
static NoIDispose ()
{
x = new MyDispose ();
}
public static implicit operator MyDispose (NoIDispose a)
{
return x;
}
}
class Y {
static void B ()
{
using (NoIDispose a = new NoIDispose ()){
}
}
}