Forum > General

Array of Integer as parameter accepts Integers

<< < (5/5)

440bx:
it's noticeable that compatibility with Delphi isn't a consistent requirement.  Sometimes it is, sometimes it isn't.


@Serge,

I'm pleased you tested that in Delphi.  The ambiguity is obvious and allowing it is an obvious bug (apparently incompatible with Delphi)

Thaddy:

--- Quote from: ASerge on September 29, 2024, 09:22:30 am ---Please, test on FPC 32x.

--- End quote ---
There is not a point in testing it if integer in Delphi has a different meaning.
It is only testable if the fpc compiler mode is also specified. The default mode is fpc mode and the size of an integer = smallint.
https://www.freepascal.org/docs-html/current/ref/refsu4.html#x26-250003.1.1
In DCC32 and DCC64 XE2 and dcc32/d12 the output is Proc with array, in D7 it does not compile at all and in fpc 3.3.1 in delphi mode the output is as you described,  "Proc with single", which seems wrong indeed.
Seems two bugs: one in Delphi7 since the code should compile as in XE2 or higher, and one in fpc where the evaluation order/precedence seems wrong.

PascalDragon:

--- Quote from: 440bx on September 29, 2024, 09:50:54 am ---it's noticeable that compatibility with Delphi isn't a consistent requirement.  Sometimes it is, sometimes it isn't.
--- End quote ---

The point of Delphi compatibility is that Delphi code compiles in FPC with mode Delphi, but NOT that code written in FPC's Delphi mode compiles in Delphi.

(Inline variables - which would be required for Delphi compatiblity - are a special topic, because the majority of the core devs - me included - is against this feature as whole)

Thaddy:
Delphi compatibility is walking through murky waters anyway as my tests showed.

Navigation

[0] Message Index

[*] Previous page

Go to full version