On Thursday, March 20, 2003, at 11:49 AM, Mars Saxman wrote:
yeomans at desuetude dot com wrote:
I have found a few glitches, though. You cannot do the following.
Sub Foo(v as Variant)
Sub Foo(obj as Object)
Now, you also cannot do the following.
Sub Foo( obj as Object)
Sub Foo(w as Window)
But this makes sense, because here the overloading is ambiguous.
That's true, but you can disambiguate it by casting your argument to
"Window". If the argument types match one method's parameters exactly,
the
compiler selects that method whether there are other legal options or
not.
(This is copied from the old compiler's behaviour.)
Well, how about that?
Next, suppose you define Sub Foo(v() as Variant). Then the following
code compiles.
dim list(-1) as String
Test list
Oh, ouch. That's certainly a bug. I'm sure you will get either a crash
or
some other nasty behaviour if you actually try to use that array of
variants
inside Foo.
Oops; I got it backward (but not in the bug report); this won't compile:
dim list(-1) as String
Test list
but this will.
dim list(-1) as Object
Test list
Charles Yeomans
---
A searchable archive of this list is available at:
<http://support.realsoftware.com/listarchives/search.php>
Unsubscribe:
<mailto:realbasic-nug-off at lists dot realsoftware dot com>
Subscribe to the digest:
<mailto:realbasic-nug-digest at lists dot realsoftware dot com>
.
|