[Mono-bugs] [Bug 76419][Wis] New - [GMCS] weird NullReferenceException on resolving missing interface implementation

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Oct 12 08:06:13 EDT 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 atsushi at ximian.com.


--- shadow/76419	2005-10-12 08:06:13.000000000 -0400
+++ shadow/76419.tmp.5623	2005-10-12 08:06:13.000000000 -0400
@@ -0,0 +1,81 @@
+Bug#: 76419
+Product: Mono: Compilers
+Version: 1.1
+OS Details: 
+Status: NEW   
+Priority: Wishlist
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: atsushi at ximian.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: [GMCS] weird NullReferenceException on resolving missing interface implementation
+This example results in a weird compiler crash, difficult to name this bug ;-)
+public interface IFoo
+        string Heh { get; } // significant to cause the error.
+        Uri Hoge (); // note that it cannot be resolved here.
+public class Foo : IFoo
+        string IFoo.Heh { get { return null; } }
+        System.Uri Hoge () { return null; }
+Actual Results:
+$ mono --debug ../../svn/mcs/gmcs/gmcs.exe missing-iface-stuff.cs
+missing-iface-stuff.cs(4,2): error CS0246: The type or namespace name `Uri'
+could not be found. Are you missing a using directive or an assembly reference?
+Unhandled Exception: System.NullReferenceException: Object reference not
+set to an instance of an object
+in [0x00125] (at C:\cygwin\home\atsushi\svn\mcs\gmcs\pending.cs:429)
+Mono.CSharp.PendingImplementation:InterfaceMethod (System.Type t,
+System.String name, System.Type ret_type, ParameterData args, Operation op,
+System.Reflection.MethodInfo need_proxy)
+in [0x00008] (at C:\cygwin\home\atsushi\svn\mcs\gmcs\pending.cs:347)
+Mono.CSharp.PendingImplementation:IsInterfaceMethod (System.Type t,
+System.String name, System.Type ret_type, ParameterData args)
+in [0x000a0] (at C:\cygwin\home\atsushi\svn\mcs\gmcs\class.cs:5018)
+Mono.CSharp.MethodData:Define (Mono.CSharp.TypeContainer container)
+in [0x00038] (at C:\cygwin\home\atsushi\svn\mcs\gmcs\class.cs:6385)
+Mono.CSharp.PropertyBase+GetMethod:Define (Mono.CSharp.TypeContainer container)
+in [0x00056] (at C:\cygwin\home\atsushi\svn\mcs\gmcs\class.cs:6891)
+Mono.CSharp.Property:Define ()
+in [0x00019] (at C:\cygwin\home\atsushi\svn\mcs\gmcs\class.cs:71)
+Mono.CSharp.TypeContainer+MemberCoreArrayList:DefineContainerMembers ()
+in [0x00008] (at C:\cygwin\home\atsushi\svn\mcs\gmcs\class.cs:1665)
+(Mono.CSharp.MemberCoreArrayList mcal)
+in [0x0028b] (at C:\cygwin\home\atsushi\svn\mcs\gmcs\class.cs:1613)
+Mono.CSharp.TypeContainer:DoDefineMembers ()
+in [0x00022] (at C:\cygwin\home\atsushi\svn\mcs\gmcs\class.cs:1532)
+Mono.CSharp.TypeContainer:DefineMembers (Mono.CSharp.TypeContainer container)
+in [0x00088] (at C:\cygwin\home\atsushi\svn\mcs\gmcs\rootcontext.cs:530)
+Mono.CSharp.RootContext:PopulateTypes ()
+in [0x0055e] (at C:\cygwin\home\atsushi\svn\mcs\gmcs\driver.cs:1601)
+Mono.CSharp.Driver:MainDriver (System.String[] args)
+in [0x00020] (at C:\cygwin\home\atsushi\svn\mcs\gmcs\driver.cs:289)
+Mono.CSharp.Driver:Main (System.String[] args)
+Expected Results:
+no compiler crash (compiler errors are still expected).
+How often does this happen? 
+Additional Information:
+As far as I tried, it does not happen when I remove the property definition
+from the interface.

More information about the mono-bugs mailing list