Skip to content

Instantly share code, notes, and snippets.

@mcintyre321
Created December 13, 2016 11:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcintyre321/ed0e34f68885d67c41aced5c7c0c0213 to your computer and use it in GitHub Desktop.
Save mcintyre321/ed0e34f68885d67c41aced5c7c0c0213 to your computer and use it in GitHub Desktop.
JSIL LINQ error
using System;
using JSIL;
using JSIL.Meta;
using System.Collections.Generic;
using System.Linq;
public static class Program {
public static void Main () {
Dictionary<string, string[]> data = new Dictionary<string, string[]>(){
{ "a", new []{"b"}},
{ "b", new string[0]}
};
var xs = data.Keys.Select(k => new X{ Name = k}).ToList();
xs.ForEach(x => x.Refs = data[x.Name].Select(y => xs.Single(z => z.Name == y)).ToArray());
Console.WriteLine("Hello JSIL World!");
}
public class X
{
public string Name {get;set;}
public X[] Refs {get;set;}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment