sq / JSIL

CIL to Javascript Compiler
http://jsil.org/
Other
1.73k stars 242 forks source link

JSProxy attribute cannot be set on structs #839

Open wizzard0 opened 8 years ago

wizzard0 commented 8 years ago

I'm trying to add translated implementation of BCL type struct System.ArraySegment<T> by copying it from CoreCLR repo with a different namespace and JSProxy attribute

but i'm getting error CS0592: Attribute 'JSProxy' is not valid on this declaration type. It is only valid on 'class, interface' declarations.

kg commented 8 years ago

I think the proxy should be a class even if the thing being proxied is a struct. Give that a try.

wizzard0 commented 8 years ago

Crashes with JSProxy("ArraySegment`1"), compiles with JSProxy("ArraySegment"), maybe that should be documented somewhere (as well as "proxy should be a class").

And the compiled code then crashes saying:

The external method 'void .ctor(System.Byte[])' of type 'System.ArraySegment1' has not been implemented.`

I believe generic structs are supported... or not?