[Mono-bugs] [Bug 47801][Nor] New - MCS crashes when compiling a program with a class that subclasses an inner class when this declaration occurs before the inner class declaration.
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Thu, 21 Aug 2003 15:12:05 -0400 (EDT)
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 mono@skippingrock.com.
http://bugzilla.ximian.com/show_bug.cgi?id=47801
--- shadow/47801 2003-08-21 15:12:05.000000000 -0400
+++ shadow/47801.tmp.10522 2003-08-21 15:12:05.000000000 -0400
@@ -0,0 +1,63 @@
+Bug#: 47801
+Product: Mono/MCS
+Version: unspecified
+OS:
+OS Details: xp
+Status: NEW
+Resolution:
+Severity: Unknown
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: mono@skippingrock.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: MCS crashes when compiling a program with a class that subclasses an inner class when this declaration occurs before the inner class declaration.
+
+Description of Problem:
+System.NullReferenceException when subclassing an inner class when the
+subclass declaration occurs before the inner class declaration.
+
+Steps to reproduce the problem:
+1. Try to compile this program:
+public class a:b.c { }
+public class b
+{
+ public class c
+ {
+ }
+
+ public static void Main(string[] args)
+ {
+ }
+}
+
+Actual Results:
+Unhandled Exception: System.NullReferenceException: Object reference not
+set to an instance of an object.
+ at Mono.CSharp.TypeContainer.DefineType()
+ at Mono.CSharp.DeclSpace.LookupInterfaceOrClass(String ns, String name,
+Boolean& error)
+ at Mono.CSharp.DeclSpace.FindType(Location loc, String name)
+ at Mono.CSharp.MemberAccess.ResolveAsTypeStep(EmitContext ec)
+ at Mono.CSharp.Expression.ResolveAsTypeTerminal(EmitContext ec)
+ at Mono.CSharp.DeclSpace.ResolveTypeExpr(Expression e, Boolean silent,
+Location loc)
+ at Mono.CSharp.TypeContainer.GetClassBases(Boolean is_class, Type&
+parent, Boolean& error)
+ at Mono.CSharp.TypeContainer.DefineType()
+ at Mono.CSharp.RootContext.ResolveTree()
+ at Mono.CSharp.Driver.MainDriver(String[] args)
+ at Mono.CSharp.Driver.Main(String[] args)
+
+Expected Results:
+Program compilation
+
+How often does this happen?
+Every time
+
+Additional Information:
+if you move the declaration of class a to below that of class b,
+compilation succeeds.