realbasic-betas.mbox
[Top] [All Lists]

Re: overriding sub with function - bug or feature?

To: REALbasic Betas <realbasic-betas at lists dot realsoftware dot com>
Subject: Re: overriding sub with function - bug or feature?
From: Mars Saxman <mars at realsoftware dot com>
Date: Sun, 28 Apr 2002 14:53:22 -0700
listuser at tempel dot org wrote:

> I just noticed that the compiler does not complain that if
> I have declared a function (returning something) in a class
> and if I then provide a same-named method without a function
> return in a subclass.

That is because the sub is not overriding the function, it is overloading
it. Both methods remain active. The compiler can't overload based on return
type but it can tell the difference between a function or a sub.

Thanks for pointing this out - I don't think the new compiler notices the
difference, so I'll have to fix that.

Mars Saxman
REAL Software



<Prev in Thread] Current Thread [Next in Thread>