Friday, May 13, 2016

jsinterop: modeling inheritance problem


I am trying to model with jsinterop libraries that build upon jquery such as bootstrap and As such I would like to extend the basic jquery return type with a child class.

For example

where JQuerySelection is
@JsType(isNative = true)
public class BaseClass {}

@JsType(isNative = true)
public class ChildClass extends BaseClass{}

The upcasting from BaseClass to ChildClass does not work.

If I use interfaces instead of class definition it works and I can cast but I am loosing the capability to have non static @jsoverlay methods

Is this a bug? Is this on purpose? Is there any workaround? What is the best practice in such cases?

I originally asked this question here.
Hopefully now makes more sense.

Vassilis Virvilis

You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment