[Mono-bugs] [Bug 81413][Wis] New - Compiler chokes on generic member resolution.

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sat Apr 21 03:00:16 EDT 2007


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 patperry at stanford.edu.

http://bugzilla.ximian.com/show_bug.cgi?id=81413

--- shadow/81413	2007-04-21 03:00:16.000000000 -0400
+++ shadow/81413.tmp.8824	2007-04-21 03:00:16.000000000 -0400
@@ -0,0 +1,81 @@
+Bug#: 81413
+Product: Mono: Compilers
+Version: 1.2
+OS: other
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: patperry at stanford.edu               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Compiler chokes on generic member resolution.
+
+Description of Problem:
+
+If I try to compile the given code, rather than report an error, mono
+throws a Mono.CSharp.InternalErrorException with a horrendous stack trace.
+
+
+Steps to reproduce the problem:
+1. Try to compile the code below:
+
+using System.Collections.Generic;
+
+public class A {
+    public static void Foo (IEnumerable<double> a) {
+        IEnumerator<double> a_enum = a.GetEnumerator();
+        double b = a_enum.Current<double>;
+    }
+}
+
+// this should be a_enum.Current, not a.enum.Current<double>.  
+// the compiler should report the error.
+
+Actual Results:
+
+The stack trace below
+
+Unhandled Exception: Mono.CSharp.InternalErrorException: Internal error
+  at Mono.CSharp.MemberAccess.DoResolve (Mono.CSharp.EmitContext ec,
+Mono.CSharp.Expression right_side) [0x00000] 
+  at Mono.CSharp.MemberAccess.DoResolve (Mono.CSharp.EmitContext ec) [0x00000] 
+  at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec,
+ResolveFlags flags) [0x00000] 
+  at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec) [0x00000] 
+  at Mono.CSharp.Assign.DoResolve (Mono.CSharp.EmitContext ec) [0x00000] 
+  at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec,
+ResolveFlags flags) [0x00000] 
+  at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec) [0x00000] 
+  at Mono.CSharp.ExpressionStatement.ResolveStatement
+(Mono.CSharp.EmitContext ec) [0x00000] 
+  at Mono.CSharp.StatementExpression.Resolve (Mono.CSharp.EmitContext ec)
+[0x00000] 
+  at Mono.CSharp.Block.Resolve (Mono.CSharp.EmitContext ec) [0x00000] 
+  at Mono.CSharp.Block.Resolve (Mono.CSharp.EmitContext ec) [0x00000] 
+  at Mono.CSharp.EmitContext.ResolveTopBlock (Mono.CSharp.EmitContext
+anonymous_method_host, Mono.CSharp.ToplevelBlock block,
+Mono.CSharp.Parameters ip, IMethodData md, System.Boolean& unreachable)
+[0x00000] 
+  at Mono.CSharp.EmitContext.EmitTopBlock (IMethodData md,
+Mono.CSharp.ToplevelBlock block) [0x00000] 
+  at Mono.CSharp.MethodData.Emit (Mono.CSharp.DeclSpace parent) [0x00000] 
+  at Mono.CSharp.Method.Emit () [0x00000] 
+  at Mono.CSharp.TypeContainer.EmitType () [0x00000] 
+  at Mono.CSharp.RootContext.EmitCode () [0x00000] 
+  at Mono.CSharp.Driver.MainDriver (System.String[] args) [0x00000] 
+  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] 
+
+Expected Results:
+
+The above code might be legal, or it might not be (I'm not sure).  Either
+handle it correctly, or report an error.
+
+How often does this happen? 
+
+Always.


More information about the mono-bugs mailing list