[Mono-bugs] [Bug 412880] New: [PATCH] wrong Modifiers.GetDescription() causes compiler crash

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Jul 29 07:05:43 EDT 2008


           Summary: [PATCH] wrong Modifiers.GetDescription() causes compiler
           Product: Mono: Compilers
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Minor
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: atsushi at ximian.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

The following code causes compiler crash:

class Foo
        protected internal virtual void X ()

class Bar : Foo
        protected override void X ()


(The override should be protected internal.)

$ gmcs foa.cs

Unhandled Exception: Mono.CSharp.InternalErrorException: foa.cs(10,33): Bar.X()
---> System.NotImplementedException: FamORAssem
  at Mono.CSharp.Modifiers.GetDescription (MethodAttributes ma) [0x00000]
  at Mono.CSharp.InterfaceMemberBase.Error_CannotChangeAccessModifiers
 loc, System.Reflection.MemberInfo base_method, MethodAttributes ma,
ng suffix) [0x00000]
  at Mono.CSharp.InterfaceMemberBase.CheckMethodAgainstBase (System.Type
thod_type) [0x00000]
  at Mono.CSharp.InterfaceMemberBase.CheckBase () [0x00000]
  at Mono.CSharp.MethodCore.CheckBase () [0x00000]
  at Mono.CSharp.MethodOrOperator.CheckBase () [0x00000]
  at Mono.CSharp.MethodOrOperator.Define () [0x00000]
  at Mono.CSharp.Method.Define () [0x00000]
  at Mono.CSharp.TypeContainer+MemberCoreArrayList.DefineContainerMembers ()
  --- End of inner exception stack trace ---
  at Mono.CSharp.TypeContainer+MemberCoreArrayList.DefineContainerMembers ()
  at Mono.CSharp.TypeContainer.DefineContainerMembers
ayList mcal) [0x00000]
  at Mono.CSharp.Class.DefineContainerMembers (Mono.CSharp.MemberCoreArrayList
ist) [0x00000]
  at Mono.CSharp.TypeContainer.DoDefineMembers () [0x00000]
  at Mono.CSharp.Class.DoDefineMembers () [0x00000]
  at Mono.CSharp.TypeContainer.DefineMembers () [0x00000]
  at Mono.CSharp.RootContext.PopulateTypes () [0x00000]
  at Mono.CSharp.Driver.Compile () [0x00000]
  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000]

It is one liner fix in modifiers.cs:

atsushi at PC ~/svn/mcs/mcs
$ svn diff
Index: modifiers.cs
--- modifiers.cs        (revision 109139)
+++ modifiers.cs        (working copy)
@@ -95,7 +95,7 @@
                        if (ma == MethodAttributes.Public)
                                return "public";

-                       if (ma == MethodAttributes.FamANDAssem)
+                       if (ma == MethodAttributes.FamORAssem)
                                return "protected internal";

                        if (ma == MethodAttributes.Private)

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.

More information about the mono-bugs mailing list