Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Compiler/Delphi/Language    [ Add a report in this area ]  
Report #:  128740   Status: Open
Mechanism for easing resolving name conflicts
Project:  Delphi Build #:  XE7
Version:    21.0 Submitted By:   Alexey Kazantsev
Report Type:  New Feature Request Date Reported:  11/6/2014 6:51:50 AM
Severity:    Commonly encountered problem Last Updated: 7/13/2015 4:09:47 AM
Platform:    All platforms Internal Tracking #:  
Resolution: None (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: (2 Total Ratings)
5.00 out of 5
Total Votes: 10
Description
My suggestion: add new directive 'scoped' (or other mechanism) for identifiers which may be used only with fully qualified names (namspace.unitname.identifierName or namespace.identifierName). It will allow using simple name for types identifiers in some namespaces without anxiety about names conflict in another code. Small example:

Program Example;

Uses System.RTTI;

var

v : TValue;

...

v := TValue

Unit Json.Types;

Type

TValue = Class
  ...
End;

If we uses Json.Types unit in Example programm then we has name conflict and have to replace all TValue to System.Rtti.TValue; But, if Json.Types.TValue will be declared as scoped:

Type

TValue = Scoped Class
End;

then conflict will be resolved, but for Json.Types.TValue we will be to use Json.TValue, that is readable and simple.
Steps to Reproduce:
None
Workarounds
None
Attachment
None
Comments

None

Server Response from: ETNACODE01