[Mono-bugs] [Bug 81923][Nor] New - Using statement should not look for implicit operators as they cannot implement IDisposable

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Jun 21 09:12:54 EDT 2007


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by marek.safar at seznam.cz.

http://bugzilla.ximian.com/show_bug.cgi?id=81923

--- shadow/81923	2007-06-21 09:12:54.000000000 -0400
+++ shadow/81923.tmp.27193	2007-06-21 09:12:54.000000000 -0400
@@ -0,0 +1,63 @@
+Bug#: 81923
+Product: Mono: Compilers
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: marek.safar at seznam.cz               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Using statement should not look for implicit operators as they cannot implement IDisposable
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+using System;
+
+class MyDispose : IDisposable {
+	public void Dispose ()
+	{
+	}
+}
+
+class NoIDispose {
+	static public MyDispose x = new MyDispose ();
+	
+	public static implicit operator MyDispose (NoIDispose a)
+	{
+		return x;
+	}
+}
+
+class C
+{
+	static void Main ()
+	{
+		using (NoIDispose a = new NoIDispose ())
+		{
+		}
+	}
+	
+}
+
+
+Actual Results:
+
+No error.
+
+Expected Results:
+
+CS1674
+
+How often does this happen? 
+
+
+Additional Information:


More information about the mono-bugs mailing list