Good day all, I have been digging around the forums and have done some google-fu but I can't seem to wrap my head around this problem.
Any help, advice, pointing to a direction is most welcome.
Now I would like to implement a receiver for a specific type of package declared in the code elsewhere, say "Vegetable"
The error says,
"incompatible types: Vegetable cannot be converted to elsewhere.Vegetable where Vegetable is a type-variable:
Vegetable extends Object declared in method <Vegetable> process(Package<Vegetable>)"
I did read about type erasure things in the net, but I did specify the method to only receive Packages with Vegetables so
why the inability to know that getting the Package's content will always return a Vegetable?
The
IDE also hints at casting but then the error remains, also, what use do I have for having generics in the Packages when
I'm just going to cast it anyway, might as well make Packages receive any Object then cast it when I need to.
Any and all help, advice, or clue is appreciated and most welcome.
Thank you for the time and consideration.