Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2019-05

Compiler picks wrong overload

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Ben Grasset
to Pascal Riekenberg
PM Pascal Riekenberg wrote
No one? This is a showstopper!

FWIW, you can comment out the new TBytes definitions as a temporary fix. They are not actually used anywhere in the FPC codebase.

More broadly I think the bigger problem is FPC's internal over-eagerness to implicitly cast things to other things... for example, if you have a type with an ":=" operator overload (or as Delphi calls it, an "Implicit" operator overload) from both "Pointer" and "TObject", FPC will always pick the "Pointer" one even if given an explicit TObject variable. They (currently) cannot co-exist. But certainly, they should be able to, if you ask me.

Reply by email

Martok
to Ben Grasset
Show quoted text 6 lines
More broadly I think the bigger problem is FPC's internal over-eagerness to implicitly cast things to other things... for example, if you have a type with an ":=" operator overload (or as Delphi calls it, an "Implicit" operator overload) from both "Pointer" and "TObject", FPC will always pick the "Pointer" one even if given an explicit TObject variable. They (currently) cannot co-exist. But certainly, they should be able to, if you ask me.

I still find "nil->Pointer->dynarray->UCS4String" the most hilarious "weight 1" autoconversion (see 0031215, which is also an overload bug).

Regards, Martok

Reply by email