[Mono-bugs] [Bug 74186][Nor] New - [GMCS] Partial class with [Obsolete] and a method causes exception

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 29 Mar 2005 11:46:05 -0500 (EST)

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 alp@atoker.com.


--- shadow/74186	2005-03-29 11:46:04.000000000 -0500
+++ shadow/74186.tmp.7321	2005-03-29 11:46:04.000000000 -0500
@@ -0,0 +1,59 @@
+Bug#: 74186
+Product: Mono: Compilers
+Version: unspecified
+OS: unknown
+OS Details: 
+Status: NEW   
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: alp@atoker.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+Summary: [GMCS] Partial class with [Obsolete] and a method causes exception
+2test-17.cs compiles as there are no methods contained within class Test.
+However, if we add a method (Foo) to this test as below, gmcs crashes.
+This used to work fine so the bug is a regression. Might be related to #71632.
+alp@nova:~/Projects/mono-svn/mcs/tests$ cat 2test-19.cs
+using System;
+using System.Runtime.InteropServices;
+public partial class Test
+        void Foo () {}
+class X
+        static void Main ()
+        { }
+alp@nova:~/Projects/mono-svn/mcs/tests$ gmcs 2test-19.cs
+Unhandled Exception: System.NullReferenceException: Object reference not
+set to an instance of an object
+in <0x001e3> Mono.CSharp.DeclSpace:LookupType (System.String name, Boolean
+silent, Location loc)
+in <0x0008f> Mono.CSharp.Attribute:CheckAttributeType
+(Mono.CSharp.EmitContext ec)
+in <0x0001e> Mono.CSharp.Attribute:ResolveType (Mono.CSharp.EmitContext ec)
+in <0x00085> Mono.CSharp.Attributes:Search (System.Type t,
+Mono.CSharp.EmitContext ec)
+in <0x00085> Mono.CSharp.MemberCore:GetObsoleteAttribute
+(Mono.CSharp.DeclSpace ds)
+in <0x00096> Mono.CSharp.MethodData:Emit (Mono.CSharp.TypeContainer
+container, Mono.CSharp.Attributable kind)
+in <0x00022> Mono.CSharp.Method:Emit ()
+in <0x00595> Mono.CSharp.TypeContainer:EmitType ()
+in <0x003f8> Mono.CSharp.RootContext:EmitCode ()
+in <0x00c06> Mono.CSharp.Driver:MainDriver (System.String[] args)
+in <0x0001f> Mono.CSharp.Driver:Main (System.String[] args)