fjgandrade / sharpkit

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

Linq Max apparently not supported #360

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The following code:

using SharpKit.JavaScript;
using SharpKit.Html;
using SharpKit.jQuery;
using System.Linq;
using System;

[JsType(JsMode.Global)]
public class TestClass
{
  public static void Test()
  {
    var x = new string[]{"0","1","2"};
    var max = x.Max(s=>Int32.Parse(s));
  } 
}

translates correctly to:

function Test()
{
    var x = ["0", "1", "2"];
    var max = System.Linq.Enumerable.Max$1$$IEnumerable$1$$Func$2(System.String.ctor, x, function (s)
    {
        return System.Int32.Parse$$String(s);
    });
};

which, however, fails to run because 
System.Linq.Enumerable.Max$1$$IEnumerable$1$$Func$2 is undefined.

Original issue reported on code.google.com by filp...@tin.it on 21 Jul 2014 at 3:54