datni / gwt-pectin

Automatically exported from code.google.com/p/gwt-pectin
0 stars 0 forks source link

Allow binding to a channel whose type is a supertype of the source. #31

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
 If I have a FieldModel<U> f and a Channel<Object> c, I'd like to be able to do :

binder.bind(f).to(c.asDestination());

I join a patch that changes de signature of asDestination to:

<U extends T> Destination<U> asDestination();

 Another solution (as Andrew suggested), is to change the signature of 'to' to be:

public void to(final Destination<? super T> destination)

Original issue reported on code.google.com by goo...@ambre.net on 27 Jul 2010 at 8:42

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by andrew.pietsch on 27 Jul 2010 at 10:01

GoogleCodeExporter commented 8 years ago
I've added <? super T> to the various bindings (Channel builders and 
ValueBindingBuilder).  This is in svn and the current 0.8 snapshot.

Original comment by andrew.pietsch on 29 Jul 2010 at 6:44

GoogleCodeExporter commented 8 years ago

Original comment by andrew.pietsch on 30 Jul 2010 at 8:13