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 [EMAIL PROTECTED] http://bugzilla.ximian.com/show_bug.cgi?id=75331 --- shadow/75331 2005-06-20 16:20:11.000000000 -0400 +++ shadow/75331.tmp.18894 2005-06-20 16:20:11.000000000 -0400 @@ -0,0 +1,114 @@ +Bug#: 75331 +Product: Mono: Runtime +Version: 1.0 +OS: +OS Details: mono svn +Status: NEW +Resolution: +Severity: +Priority: Wishlist +Component: io-layer +AssignedTo: [EMAIL PROTECTED] +ReportedBy: [EMAIL PROTECTED] +QAContact: [EMAIL PROTECTED] +TargetMilestone: --- +URL: +Cc: +Summary: [GMCS] strange difference in loading mono generated dll and its reassembled version + +Please fill in this template when reporting a bug, unless you know what you +are doing. +Description of Problem: +We came into a very strange issue. Assembly generated with nemerle (mono +S.R.E) causes assertion in mono runtime, but after reassembling it (the IL +is identicall) on MS.NET it runs ok. + +The t.exe was compiled with csc from +class C : IComparable <C> { + int IComparable<C>.CompareTo (C x) { return 1; } +} +class M { + static void Main () { + NemerleMap<C,int> y = new NemerleMap<C,int> (); + y.Add (new C(), 1); + } +} + +tlib1.dll is compiled from nemerle + public interface IComparable ['a] + { + CompareTo(x : 'a) : int; + } + internal struct NodeNem ['a, 'b] : IComparable [NodeNem ['a, 'b]] + { + public x : int; + + public CompareTo (x : NodeNem ['a, 'b]) : int + { 1 } + + public this (k : 'a, v : 'b) + { } + } + + public class NemerleMap ['a, 'b] + { + public Add (k : 'a, v : 'b) : void + { + def x = NodeNem (k, v); + null + } + } + +and tlib2.dll is generated by ildasm /text tlib1.dll > tlib2.il; ilasm +/dll tlib2.il + +Steps to reproduce the problem: +1. Unpack attached testcase +2. run mono t.exe +3. mv tlib2.dll tlib1.dll +3. run mono t.exe + +Actual Results: +** ERROR **: file metadata.c: line 1790 +(mono_metadata_parse_generic_param): assertion failed: (generic_context) +aborting... +Aborted + +clear run + +Expected Results: +clear run +clear run + +How often does this happen? +Always + +Additional Information: +Unfortunately I was not able to reproduce it with gmcs generated tlib (C# +source is as follows) + public interface IComparable <a> + { + int CompareTo(a x); + } + internal struct NodeNem <a, b> : IComparable <NodeNem <a, b> > + { + public int x; + + int IComparable<NodeNem<a,b>>.CompareTo (NodeNem <a, b> x) + { return 1; } + + public NodeNem (a k, b v) + { x = 1; } + } + + public class NemerleMap <a, b> + { + public void Add (a k, b v) + { + NodeNem <a,b> x = new NodeNem <a,b> (k, v); + } + } + + +Also I noticed, that changing struct to class in nemerle source made this +error disappear... _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
