Closed ssatguru closed 8 years ago
Interface issue ?
OK. I finally took the time to look into this issue. There was actually a bug (well, let's say not-supported-yet feature) in the case where a class extends another class and some interfaces. This bug is fixed, so now JSweet behaves as expected for this DirectionalLight
case. Normally I have republished the candy, so that it should now be up-to-date.
The output requires some explanations. If you look at the code, you will see that the DirectionalLight
class does not actually implements the IShadowLight
, but it instead:
IShadowLight
members to DirectionalLight
,@Extends({IShadowLight.class})
annotation.This is because in JSweet, interfaces can be defined as classes (annotated with @Interface
) in order to allow fields in interfaces (like in TS). So, since multiple inheritance of classes is not allowed in Java, we implement some sort of mixins here. What you get in the end is the same API except that the super interfaces have been inlined in the child ones (in case of multiple inheritance only). The @Extends
annotation keeps track of the inlining that was done.
Note that the @Extends
annotation will allow us to implement the instanceof
operator correctly in the coming releases (not yet done but not too complicated to do).
babylon.d.ts defines the class "DirectionalLight" as
JSweet defines this class as
"implements IShadowLight " is missing