tailorlala / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

Add a warning to the documentation of EventBus about generics #1878

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The documentation of EventBus states that
"Events are routed based on their type — an event will be delivered to any 
subscriber for any type to which the event is assignable."

This is not true for generics (a Foo<Y> will also be delivered to @Subscribe 
to(Foo<X>) even though Foo<Y> is not assignable to Foo<X>). So, instead of 
making the programmer wonder how EventBus could possibly guess the erased 
generic information, it would be helpful to warn that it cannot.

Original issue reported on code.google.com by ClovisSe...@gmail.com on 28 Apr 2015 at 8:58