delphi XE multi-unit namespace question

I am reading RAD Studio Documentaion in Delphi XE. here a some texts.

[ Delphi Reference -> Delphi Language Guide -> Programs and Units -> Using Namespaces -> Searching Namespaces -> Multi-unit Namespaces ]

Multi-unit Namespaces

Multiple units can belong to the same namespace, if the unit declarations refer to the same namespace. For example, one can create two files, unit1.pas and unit2.pas, with the following unit declarations:

// in file 'unit1.pas' 
unit MyCompany.ProjectX.ProgramY.Unit1 

// in file 'unit2.pas' 
unit MyCompany.ProjectX.ProgramY.Unit2 

In this example, the namespace MyCompany.ProjectX.ProgramY logically contains all of the interface symbols from unit1.pas and unit2.pas.

Symbol names in a namespace must be unique, across all units in the namespace.
In the example above, it is an error for Unit1 and Unit2 to both define a global interface symbol named mySymbol

I tested this. код ниже.

----------------------------------------------------------------- 
program Project1; 

{$APPTYPE CONSOLE} 

uses 
  SysUtils, 
  Lib.A in 'Lib.A.pas', 
  Lib.B in 'Lib.B.pas'; 

begin 
  WriteLn ( TestValue ) ; 
  ReadLn ; 
end. 
----------------------------------------------------------------- 
unit Lib.A; 

interface 
  const TestValue : Integer = 10 ; 
implementation 

end. 
----------------------------------------------------------------- 
unit Lib.B; 

interface 
  const TestValue : Integer = 10 ; 
implementation 

end. 

Это не ошибка. Почему? Я не понимаю.

11
задан Johan - reinstate Monica 15 May 2011 в 13:18
поделиться