Sign in Join

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

Mailing lists / fpc-devel / 2003-04

The "Duplicate Identifier" in classes and interfaces

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Ivan Shikhalev

There is error "duplicate identifier" when a parameter name of some method of class or interface is same as name of any property. It is present in mode OBJFPC, but is not in mode DELPHI.

1. What is a reason for this constraint in OBJFPC mode?
2. It is a unneccessary incompatipily feature (IMHO). What's about?

Sorry, this question was posted, but I can not find the answers in archives.

Thanks.

------------
Ivan Shikhalev
http://fpc.by.ru/

Reply by email

Michael Van Canneyt
to Ivan Shikhalev
Ivan Shikhalev wrote 5 lines
There is error "duplicate identifier" when a parameter name of some method of class or interface is same as name of any property. It is present in mode OBJFPC, but is not in mode DELPHI. 1. What is a reason for this constraint in OBJFPC mode?

Because we consider it bad coding. It creates confusion. But since Delphi allows it, it is allowed in Delphi compatibility mode.

Michael.

Reply by email