Bug 324093 (MONO81413) - [GMCS] Compiler chokes on generic member resolution.
Summary: [GMCS] Compiler chokes on generic member resolution.
Status: RESOLVED FIXED
Alias: MONO81413
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: 1.2
Hardware: Other Other
: P3 - Medium : Major
Target Milestone: ---
Assignee: Marek Safar
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-21 10:00 UTC by Patrick Perry
Modified: 2008-09-22 13:37 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 20:36:06 UTC


---- Reported by patperry@stanford.edu 2007-04-21 03:00:16 MST ----

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.


Unknown operating system other. Setting to default OS "Other".

Comment 2 Marek Safar 2008-09-22 13:37:35 UTC
Fixed in SVN.