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

43 lines
448 B
C#

using System;
class R<T, U>
where T : System.IDisposable
where U : T
{
public void M (U u)
{
using (u) {
}
}
}
struct S<T, U>
where T : System.IDisposable
where U : struct, T
{
public void M (U u)
{
using (u) {
}
}
}
class X : IDisposable
{
public void Dispose ()
{
}
public static void Main ()
{
new R<X, X> ().M (new X ());
new S<Y, Y> ().M (new Y ());
}
}
struct Y : IDisposable
{
public void Dispose ()
{
}
}