Bugzilla – Bug 318292
[GMCS] context from type instead of method is used when parsing generic method invocation
Last modified: 2007-09-15 21:24:46 UTC
---- Reported by nazgul@omega.pl 2005-06-17 13:28:34 MST ---- Please fill in this template when reporting a bug, unless you know what you are doing. Description of Problem: Runtime fails on generic method invocation. Steps to reproduce the problem: 1. Compile gmcs t.cs class C <A> { public static void foo<B> (C<B> x) { D.append (x); } } class D { public static void append<A> (C<A> x) { } public static void Main () { C<object>.foo<int> (null); } } 2. run mono t.exe Actual Results: ** ERROR **: file metadata.c: line 1812 (mono_metadata_parse_generic_param): assertion failed: (generic_container && (generic_container->is_method || generic_container->is_signature)) aborting... Aborted Expected Results: clear run How often does this happen? Always Additional Information: This is the current nemerle bootstrap blocker... ---- Additional Comments From malekith@pld-linux.org 2005-06-17 13:36:41 MST ---- It's a blocker. It is caused by http://galactus.ximian.com/pipermail/mono-patches/2005-June/060134.html that I guess fixed something else :-) ---- Additional Comments From nazgul@omega.pl 2005-06-20 11:43:54 MST ---- I did some debugging and it seem that in loader.c:504 the 'context' contains: (gdb) p *context $2 = {container = 0x8274d68, gclass = 0x82770f0, gmethod = 0x8277700} Which probably isn't valid. Even if it is valid, the contex should actually point to context -> gmethod -> container, which is a correct context at this place. I attach a little hack, which allowed me to go forward and workaround the bug in some sense. ---- Additional Comments From nazgul@omega.pl 2005-06-20 11:46:21 MST ---- Created an attachment (id=168143) a workaround for incorrect context passed to method_from_methodspec ---- Additional Comments From martin@ximian.com 2005-06-20 12:32:10 MST ---- Thanks a lot for you patch; committed it to SVN :-) Imported an attachment (id=168143) Unknown bug field "cf_op_sys_details" encountered while moving bug <cf_op_sys_details>mono svn from 17.06.2005</cf_op_sys_details> Unknown operating system unknown. Setting to default OS "Other".