Isn't the whole point of polymorphism to avoid having to cast things?
Especially when it's instantiated as the class I want.
In any case, it won't let me cast the operator_convert,
subClass(myClass) = "hello world"
Compiler says 'This method or property does not exist'
But a funny thing happens when I try to cast the second call to MyMethod:
Sub Open()
dim myClass as SuperClass
myClass = new SubClass
SubClass(myClass).MyMethod <--- Works just fine...
myClass = "hello world"
SubClass(myClass).MyMethod <--- IllegalCastException !
End Sub
Something very screwy is happening during the call to operator_convert!
>You've dimmed the class as a SuperClass
>
>have you tried:
>dim myClass as SubClass
>
>or casting:
>subClass(myClass) = "hello world"
>
>--
>Steve Garman
>Using REALbasic Professional on Windows XP Pro
>
>
>_______________________________________________
>Unsubscribe or switch delivery mode:
><http://www.realsoftware.com/support/listmanager/>
>
>Search the archives:
><http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>