Shawn Witte
11/21/2019, 3:31 AMabstract class A<X,Y,Z: A<X,Y,Z>> which I am subclassing to class CompositeA<X,Y>: A<X,Y,CompositeA<X,Y>>
Now, A has an abstract fun copy(): Z and CompositeA has a property components: List<A<X,Y,*>>.
When I try to iterate through objects from components, call copy() on them,and put the put the results into a List<A<X,Y,*>> the IDE gives me an error saying I'm trying to put something of type of type A<*,*,*> into the List, which is incompatible. I can cast the result of copy() by using as A<X,Y,*>, but then I get an unchecked cast warning.
Any ideas what I'm not seeing here?Hullaballoonatic
11/21/2019, 4:55 AMShawn Witte
11/25/2019, 4:12 AM