Saltarelle / SaltarelleCompiler

C# to JavaScript compiler – Now http://bridge.net
http://saltarelle-compiler.com
Other
297 stars 74 forks source link

Struct reflectability impossible? #415

Closed Enichan closed 9 years ago

Enichan commented 9 years ago

No matter what I do, I can't seem to get SC to generate metadata for reflection of struct types. Is there a particular reason that reflection metadata isn't generated for structs? Attributes on anything but the type itself also seem to not be added to the metadata set.

erik-kallen commented 9 years ago

No, if that is the case it is a bug.

Enichan commented 9 years ago

Tested in 2.5.0 and 2.6.2

erik-kallen commented 9 years ago

Sorry, when rereading this I noticed that I missed half of your question. In order for metadata to be generated for members, the members need to either: 1) have any (scriptable) attributes applied to them, or 2) have a [ReflectableAttribute], or 3) the type or assembly could have a [DefaultMemberReflectabilityAttribute]

Enichan commented 9 years ago

Yep, even when adding those metadata was only generated for the struct itself, not for any of its members.

erik-kallen commented 9 years ago

Was there actually any metadata added for the struct? I just fixed a bug causing no metadata for a struct at all to be generated.

Enichan commented 9 years ago

It appeared to generate metadata for Attributes applied to the struct (but not its members)