[fpc-devel] Abs(Variant) unexpected result
Michael Van Canneyt
michael at freepascal.org
Sun Feb 25 15:40:30 CET 2018
On Sun, 25 Feb 2018, Bart wrote:
> On Sun, Feb 25, 2018 at 1:01 PM, Michael Van Canneyt
> <michael at freepascal.org> wrote:
>> The compiler does not know at compile time what type the variant is, how can
>> you expect it to choose the "right" overloaded version ?
> I would have expected that it will choose the right one @runtime .
Choices between overloads are always made at compile time.
Only if we add an
Abs(Variant) : Variant;
which will then make the choice will this work. But I'm not sure whether this
would interfere with the normal working of abs() overloads.
More information about the fpc-devel