[Mono-bugs] [Bug 483689] New: Compiler crashes when checking method override in the presence of a static parametrized method within a parametrized class.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Mar 9 18:46:10 EDT 2009


           Summary: Compiler crashes when checking method override in the
                    presence of a static parametrized method within a
                    parametrized class.
    Classification: Mono
           Product: Mono: Compilers
           Version: 1.9
          Platform: x86
        OS/Version: Ubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: chadwick at ccs.neu.edu
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:
Gecko/2009030422 Ubuntu/8.10 (intrepid) Firefox/3.0.7

With GMCS version on Ubuntu, compiling the following minimal test case

   public class A<T>{
       public static int stat<X>(){ return 1; }
       public override int GetHashCode(){ return A<int>.stat(); }

Seems like the type argument is not inferred correctly, but no error is given. 
Adding the parameter fixes the problem.  Removing the class' type-parameter or
using an older GMCS version ( produces error CS0411.

Reproducible: Always

Steps to Reproduce:
1. Compile the class definition above with GMCS
2. Crash should occur every time
Actual Results:  
Exception caught by the compiler while compiling:
   Block that caused the problem begin at: A.cs(5,25):
                     Block being compiled: [A.cs(5,38):,A.cs(5,62):]
Mono.CSharp.InternalErrorException: Overload verification expected failure
Internal compiler error at A.cs(5,25):: exception caught while emitting
MethodBuilder [A`1::GetHashCode]

Unhandled Exception: Mono.CSharp.InternalErrorException: Overload verification
expected failure
  at Mono.CSharp.MethodGroupExpr.OverloadResolve (Mono.CSharp.EmitContext ec,
System.Collections.ArrayList& Arguments, Boolean may_fail, Location loc)
  at Mono.CSharp.Invocation.DoResolveOverload (Mono.CSharp.EmitContext ec)
  at Mono.CSharp.Invocation.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.Return.DoResolve (Mono.CSharp.EmitContext ec) [0x00000] 
  at Mono.CSharp.Return.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] 

Expected Results:  
error CS0411: The type arguments for method `A.stat<X>()' cannot be inferred
from the usage. Try specifying the type arguments explicitly

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