fjgandrade / sharpkit

Automatically exported from code.google.com/p/sharpkit
0 stars 0 forks source link

List<T>.Sort(Comparison<T> comparison) throws Uncaught TypeError: Object {T} has no method 'Sort$$Comparison$1' #221

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Create a list an call the Sort() method, passing a valid comparer. e.g.

            var foo = new List<int>(new[] {1, 2, 3});
            foo.Sort((a, b) => 1);

What is the expected output? What do you see instead?

JsClr appears to support this method. The compiled code that is generated for 
the above snippet is:

            var l=new System.Collections.Generic.List$1.ctor$$IEnumerable$1(System.Int32.ctor,[1,2,3]);
            l.Sort$$Comparison$1($CreateAnonymousDelegate(this,function(a,b)
            {
                return 1;
            }));

however $$Comparison is not a valid member. 

What version of the product are you using? On what operating system?

4.29.9000 clr 4.1.0

Original issue reported on code.google.com by tworedce...@gmail.com on 23 Sep 2012 at 8:45

GoogleCodeExporter commented 9 years ago

Original comment by yvan.rod...@gmail.com on 4 Oct 2012 at 5:22

GoogleCodeExporter commented 9 years ago

Original comment by yvan.rod...@gmail.com on 1 Nov 2012 at 1:56

GoogleCodeExporter commented 9 years ago

Original comment by yvan.rod...@gmail.com on 12 Dec 2012 at 7:07

GoogleCodeExporter commented 9 years ago
Fixed by implementing Sort() with no arguments. This forces the compiler to 
export each method with a full signature. (svn 1313)

Original comment by yvan.rod...@gmail.com on 8 Jan 2013 at 11:33

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r1313.

Original comment by yvan.rod...@gmail.com on 8 Jan 2013 at 11:34