https://bugzilla.novell.com/show_bug.cgi?id=462515


           Summary: calling private method from subclass leads to compiler
                    crash
           Product: Mono: Compilers
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Minor
          Priority: P5 - None
         Component: C#
        AssignedTo: [email protected]
        ReportedBy: [email protected]
         QAContact: [email protected]
          Found By: ---


Testcase:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
using System;

public class Foo
{
        void Bar () {
        }
}

public class Baz : Foo
{
        public static void Main (String[] args) {
                Bar ();
        }
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

To reproduce:

gmcs bug.cs
bug.cs(5,14): warning CS0169: The private method `Foo.Bar()' is never used

Unhandled Exception: Mono.CSharp.InternalErrorException: bug.cs(9,14): Baz --->
System.InvalidOperationException: Method 'Baz.Main' does not have a method
body.
  at System.Reflection.Emit.MethodBuilder.fixup () [0x00000]
  at System.Reflection.Emit.TypeBuilder.CreateType () [0x00000]
  at Mono.CSharp.TypeContainer.CloseType () [0x00000]
  --- End of inner exception stack trace ---
  at Mono.CSharp.TypeContainer.CloseType () [0x00000]
  at Mono.CSharp.RootContext.CloseTypes () [0x00000]
  at Mono.CSharp.Driver.Compile () [0x00000]
  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000]


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to