Bug 317556 (MONO74186) - [GMCS] Partial class with [Obsolete] and a method causes exception
Summary: [GMCS] Partial class with [Obsolete] and a method causes exception
Status: RESOLVED FIXED
Alias: MONO74186
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-29 18:46 UTC by Alp Toker
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 19:11:47 UTC


---- Reported by alp@atoker.com 2005-03-29 11:46:04 MST ----

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;

[Obsolete]
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)



---- Additional Comments From rharinath@novell.com 2005-03-30 02:46:41 MST ----

This testcase works with 'mcs'.  I believe that once the change to
'mcs' are merged into 'gmcs', it will also start working.




---- Additional Comments From rharinath@novell.com 2005-04-21 11:16:59 MST ----

Works with the latest SVN snapshot.


Unknown operating system unknown. Setting to default OS "Other".