[Mono-bugs] [Bug 76849][Wis] Changed - Can't compile assembly that uses [Obsolete(IsError=true)]-marked types

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Dec 2 12:06:52 EST 2005


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 jonpryor at vt.edu.

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

--- shadow/76849	2005-12-02 10:57:43.000000000 -0500
+++ shadow/76849.tmp.13351	2005-12-02 12:06:52.000000000 -0500
@@ -1,13 +1,13 @@
 Bug#: 76849
 Product: Mono: Compilers
 Version: 1.1
 OS: other
 OS Details: 
-Status: RESOLVED   
-Resolution: FIXED
+Status: REOPENED   
+Resolution: 
 Severity: Unknown
 Priority: Wishlist
 Component: C#
 AssignedTo: marek.safar at seznam.cz                            
 ReportedBy: jonpryor at vt.edu               
 QAContact: mono-bugs at ximian.com
@@ -215,6 +215,51 @@
 		}
 	}
 
 
 ------- Additional Comments From marek.safar at seznam.cz  2005-12-02 10:57 -------
 Fixed in SVN.
+
+------- Additional Comments From jonpryor at vt.edu  2005-12-02 12:06 -------
+Static constructors of [Obsolete(IsError=true)] types should be able
+to reference & create instance of other [Obsolete(IsError=true)]
+types.  (The actual rules may be more lax, but this is my test case.)
+
+The following compiles with CSC and fails with mcs:
+
+	using System;
+	using System.Runtime.InteropServices;
+
+	[Obsolete ("Use Native.CdeclFunction", true)]
+	public class CdeclFunction {
+		public CdeclFunction (string s, string s2)
+		{
+		}
+
+		public object Invoke (object[] arguments)
+		{
+			return null;
+		}
+	}
+
+	[Obsolete ("Use Native.XPrintfFunctions", true)]
+	internal class XPrintfFunctions 
+	{
+		internal delegate object XPrintf (object[] arguments);
+
+		internal static XPrintf printf;
+
+		static XPrintfFunctions ()
+		{
+			CdeclFunction f = new CdeclFunction ("libc", "printf");
+			printf = new XPrintf (f.Invoke);
+		}
+	}
+
+	class Test {
+		public static void Main ()
+		{
+		}
+	}
+
+BTW, thank you for the quick turnaround on all this.  I owe you a
+beverage of your choice if we ever meet.


More information about the mono-bugs mailing list