Recent

Author Topic: FPC $MODE DELPHI and overloading functions is allowed or not  (Read 1967 times)

WooBean

  • Full Member
  • ***
  • Posts: 230
FPC $MODE DELPHI and overloading functions is allowed or not
« on: November 16, 2017, 09:37:53 am »
I must be stupid or there is an error in FPC documentation. In online FPC documentation (https://www.freepascal.org/docs-html/current/prog/progse74.html#x289-305000D.3) it is stated at point 4. : "Overloading of functions is not allowed."
But, in fact a program  with directive $MODE DELPHI using units with some overloaded functions can be compilled and executed without any problems. Tested on Lazarus 1.6 32bit, Win 7/64, FPC 3.0.0.

So, I must be stupid as such a basic (and importand for any serious programmer) level of FPC descrption can not be bad?
Platforms: Win7/64, Linux Mint Ulyssa/64

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11447
  • FPC developer.
Re: FPC $MODE DELPHI and overloading functions is allowed or not
« Reply #1 on: November 16, 2017, 09:51:56 am »
It's indeed outdated, the D4..D7 introduction line already hints on being "old".

Afaik Delphi enabled function (not method, that was earlier) in D2006, but requires "overload;"  directives (I'm not sure if FPC enforces that too). Probably overloading was simple enabled in Delphi mode when compatibility moved on, and the documentation guy didn't get the message.

Then it falls onto the users, please file a documentation bug to have it updated.

 

TinyPortal © 2005-2018