Error "Incompatible types" with itself when a program uses dotted unit names and default name spaces using -FNxxxx switch.
Original Reporter info from Mantis: glorfin
-
Reporter name: Viatcheslav
Original Reporter info from Mantis: glorfin
- Reporter name: Viatcheslav
Description:
A program depends on 2 packages: lmTestGenMath and lmTestComponents. It uses unit lmath.uTypes from lmTestGenMath and lmath.uPointsVec from lmTestComponents.
In turn, lmTestComponents depends on lmTestGenMath and uses lmath.uTypes.
lmath.uTypes defines type TRealPoint;
lmath.uPointsVec defines procedure Append(APoint:TRealPoint);
The program has compiler switch -FNlmath and uses clause as:
uses uTypes, uPointsVec.
lmTestComponents has complete identifiers:
uses lmath.uTypes.
Attempt to compile the program leads to error message:
fitlogexp.pas(18,12) Error: Incompatible type for arg no. 1: Got "LMATH.UTYPES.TRealPoint", expected "LMATH.UTYPES.TRealPoint"
lmath.upointsvec.pas(11,11)
Hint: Found declaration: Append(TRealPoint);
Steps to reproduce:
Download and unzip attached file NameSpacesBug.zip.
It contains 3 directories: PackOne and PackTwo for the packages, NameSpaces for the program.
Compile lmTestGenMath.lpk in PackOne
Compile lmtestcomponents.lpk in PackTwo.
Attempt to compile project constr_fit.lpi from directory NameSpaces.
Enjoy.
Mantis conversion info:
- Mantis ID: 37622
- OS: Windows
- OS Build: 10
- Platform: Win32
- Version: 3.2.0