On Aug 23, 2006, at 2:24 PM, Jonathan Johnson wrote:
On Aug 23, 2006, at 1:15 PM, Daniel Stenning wrote:
On 23/8/06 17:35, "Mars Saxman" <[EMAIL PROTECTED]> wrote:
Overloading is hard to use precisely when it causes ambiguity,
and obscures
rather
than clarifying programmer intent.
Not sure what that means exactly -but in any case surely isnt it
for US
users to decide when such use would cause ambiguity?
This situation right here:
Sub Foo( i as Integer )
Sub Foo( s as String )
Class Bar
GetValue() As String
GetValue() as Integer
End Class
Foo( myBar.GetValue() )
In the current implementation, this can't be ambiguous. However, if
overloaded return types were allowed, this would be ambiguous.
And here's another -- suppose ClassB is a subclass of ClassA. Then
declare
Function Foo() as ClassA
Function Foo() as ClassB
dim c as ClassA = Foo()
Which Foo should be called?
Now suppose both Foo are object methods of a class Class1. Then in a
subclass Class2, declare
Function Foo() as ClassB. In the presence of return type covariance,
which Class1.Foo should be overridden?
Charles Yeomans
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>