On 28-Nov-03, at 2:52 PM, eric at glassbead dot com wrote:
Hi folks,
I've discovered a problem with the new covariance feature. I implement
a container class with a "get" method that returns a variant.
Sometimes
I'll subclass that class and override the "get" method with a method
that returns a specific class type. This now fails.
To reproduce this: Create an application with three classes class1,
class2 (which descends from class1) and otherClass. Add a method "get"
to class1 that returns a variant. Override get in class2 to return
otherClass. This now causes the compiler to report an error, but it
used
to work just fine.
I thought the notes said that you had to be returning an instance of
the root class, a subclass of the root class, or a class that
implemented an interface.
This would not be true with a variant as it's not the parent class of
any of these.
Maybe I misunderstood the release note ?
- - -
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|