[fpc-devel] Fwd: override works, even if result type changed?
lazarus at mfriebe.de
Mon Mar 31 15:36:45 CEST 2014
Another question that never got answered. Yet I would expect, that
either it is implemented with intend, then someone must know.
Or it is a bug then that should be checked?
If no one knows, shall I assume it is a bug, and report it?
-------- Original Message --------
Subject: [fpc-devel] override works, even if result type changed?
Date: Sun, 23 Feb 2014 16:56:26 +0000
From: Martin Frb <lazarus at mfriebe.de>
Reply-To: FPC developers' list <fpc-devel at lists.freepascal.org>
To: FPC developers' list <fpc-devel at lists.freepascal.org>
Just found that the below works.
Note, that the result type of "a" (overridden) is different.
Well, TFoo2 will always satisfy the needs of TFoo, so it seems save. I
still found it surprising. Is it intended?
function a: TFoo; virtual;
function a: TFoo2; override;
function TFoo2.a: TFoo2;
function TFoo.a: TFoo;
fpc-devel maillist - fpc-devel at lists.freepascal.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-devel