[fpc-pascal] Operator overload bug

Ben Grasset operator97 at gmail.com
Mon Jul 23 03:24:31 CEST 2018


Why wouldn't you just use the TIntegerArray type that's implicitly declared
in the "Objpas" unit by default, if you were going to do that? Doesn't
address the underlying issue anyways.

On Sun, Jul 22, 2018 at 9:10 PM, Vojtěch Čihák <vojtech.cihak at atlas.cz>
wrote:

> Hello,
>
>
>
> you can define type:
>
>
>
> TIntArray = array of Integer;
>
>
>
> operator + (left: TMyClass; right: TIntArray): TMyClass; overload;
>
>
>
> and with retyping it works:
>
>
>
> c := c + TIntArray([1, 2, 3]);
>
>
>
> V.
>
>
>
>
>
> ______________________________________________________________
> > Od: Ben Grasset <operator97 at gmail.com>
> > Komu: FPC-Pascal users discussions <fpc-pascal at lists.freepascal.org>
> > Datum: 23.07.2018 02:16
> > Předmět: Re: [fpc-pascal] Operator overload bug
> >
> I'd say it's a bug in the sense that the compiler assumes something
> starting with "[" and ending with "]" can only possibly be a set in that
> context.
>
> On Sun, Jul 22, 2018 at 12:10 PM, Ryan Joseph <ryan at thealchemistguild.com>
> wrote:
>
>> I mentioned this as an aside a while ago but I don’t remember getting a
>> response so I’d like to formally reintroduce the issue.
>>
>> _______________________________________________
>> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
>> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>
>
>
> ----------
>
>
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20180722/e00d4da4/attachment.html>


More information about the fpc-pascal mailing list