nikhilk / scriptsharp

Script# Project - a C# to JavaScript compiler, to power your HTML5 and Node.js web development.
http://scriptsharp.com
Other
658 stars 182 forks source link

Action<T> causing error failure #391

Open Sam7 opened 11 years ago

Sam7 commented 11 years ago

Trying to compile this code With ScriptSharp silently fails:

public class TestClass<T>
{
    public Action<T> Action;
}
andrewharry commented 11 years ago

Are generics supported now in ScriptSharp?

mattjphillips commented 11 years ago

Well, more like "yes and no." :-) Yes, you can use standard container generics like List and Action but no, you can't create your own generics as illustrated in the example.

See, eg, http://stackoverflow.com/questions/8883339/using-generics-with-script.

I don't know enough about the compiler to know why it silently fails. It seems to have something to do with the member generic. If I take your example and change the member to just 'public T Action' I get a (admittedly vague) 'unsupported feature' error.