Bug 318544 (MONO75584) - [GMCS] line 1810 (mono_metadata_parse_generic_param): assertion failed: (generic_context)
Summary: [GMCS] line 1810 (mono_metadata_parse_generic_param): assertion failed: (gene...
Status: RESOLVED FIXED
Alias: MONO75584
Product: Mono: Runtime
Classification: Mono
Component: misc (show other bugs)
Version: 1.1
Hardware: Other Other
: P3 - Medium : Blocker
Target Milestone: ---
Assignee: Martin Baulig
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-19 16:46 UTC by Michal Moskal
Modified: 2007-09-15 21:24 UTC (History)
0 users

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


Attachments
error log of monodis attempt (1.73 KB, text/plain)
2005-09-13 20:34 UTC, Thomas Wiest
Details

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


---- Reported by malekith@pld-linux.org 2005-07-19 09:46:58 MST ----

Description of Problem:

I was trying to reproduce a problem I have with Nemerle compiled code.
While rewriting it in C# another issue occured, which seems to be related.


Steps to reproduce the problem:
1. Compile the following program with gmcs
class C<X,Y> {
  class Q<A,B> {
    public void apply (C<X,Y> t)
        {
          t.bar<A,B>();
        }
  }

  public void foo<A,B> ()
  {
    Q<A,B> q = new Q<A,B>();
        q.apply(this);
  }

  public void bar<A,B> ()
  {
    System.Console.WriteLine ("'{0} {1} {2} {3}'",
typeof(X),typeof(Y),typeof(A),typeof(B));
  }
}

class X {
  public static void Main () {
    C<int,string> c = new C<int,string>();
        c.foo<float,string> ();
  }
}

2. run it

Actual Results:
** ERROR **: file metadata.c: line 1810
(mono_metadata_parse_generic_param): assertion failed: (generic_context)
aborting...
zsh: 28350 abort      ~/mono-svn/bin/mono foo.exe


Expected Results:
'System.Int32 System.String System.Single System.String'

How often does this happen? 
always

Additional Information:
I'm using mono svn. The program works as expected on ms.net, also
csc-compiled executable fails, so this seems like a runtime issue.



---- Additional Comments From kiess@h3c.de 2005-09-13 12:17:51 MST ----

A shorter testcase which fails with the same error:

class A<T1> {
  public void f<T2> () {}
}

class M {
  public static void Fun<T>() {
    //new A<T>(); // with this it will work
    ((A<T>)null).f<object>();
  }

  public static void Main() {
    Fun<object>();
  }
}




---- Additional Comments From akopa@charter.net 2005-09-13 13:34:29 MST ----

Created an attachment (id=168255)
error log of monodis attempt




---- Additional Comments From akopa@charter.net 2005-09-13 13:35:41 MST ----

also fails with same error disassembling the generated .exe



---- Additional Comments From martin@ximian.com 2005-09-27 12:17:16 MST ----

Fixed in SVN; added as gtest-203.cs.

Imported an attachment (id=168255)

Unknown bug field "cf_op_sys_details" encountered while moving bug
   <cf_op_sys_details>amd64 pld linux</cf_op_sys_details>
Unknown operating system unknown. Setting to default OS "Other".