scriptsharp icon indicating copy to clipboard operation
scriptsharp copied to clipboard

Action<T> causing error failure

Open Sam7 opened this issue 12 years ago • 2 comments

Trying to compile this code With ScriptSharp silently fails:

public class TestClass<T>
{
    public Action<T> Action;
}

Sam7 avatar Aug 16 '13 07:08 Sam7

Are generics supported now in ScriptSharp?

andrewharry avatar Sep 26 '13 00:09 andrewharry

Well, more like "yes and no." :-) Yes, you can use standard container generics like List<MyClass> and Action<MyClass> 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.

mattjphillips avatar Sep 26 '13 20:09 mattjphillips