* for tp mode don't allow unitname reuse

git-svn-id: trunk@8158 -
This commit is contained in:
peter 2007-07-23 20:38:05 +00:00
parent 5e60b52f28
commit 0fc65c5eec
4 changed files with 27 additions and 6 deletions

1
.gitattributes vendored
View File

@ -7365,6 +7365,7 @@ tests/webtbf/tw6631.pp svneol=native#text/plain
tests/webtbf/tw6686.pp svneol=native#text/plain tests/webtbf/tw6686.pp svneol=native#text/plain
tests/webtbf/tw6796.pp svneol=native#text/plain tests/webtbf/tw6796.pp svneol=native#text/plain
tests/webtbf/tw6922.pp svneol=native#text/plain tests/webtbf/tw6922.pp svneol=native#text/plain
tests/webtbf/tw6957.pp -text
tests/webtbf/tw6970.pp svneol=native#text/plain tests/webtbf/tw6970.pp svneol=native#text/plain
tests/webtbf/tw7070.pp svneol=native#text/plain tests/webtbf/tw7070.pp svneol=native#text/plain
tests/webtbf/tw7322.pp svneol=native#text/plain tests/webtbf/tw7322.pp svneol=native#text/plain

View File

@ -787,8 +787,9 @@ implementation
else else
begin begin
{ when the other symbol is a unit symbol then hide the unit { when the other symbol is a unit symbol then hide the unit
symbol } symbol, this is not supported in tp7 }
if (srsym.typ=unitsym) then if not(m_tp7 in current_settings.modeswitches) and
(srsym.typ=unitsym) then
begin begin
HideSym(srsym); HideSym(srsym);
searchagain:=true; searchagain:=true;

View File

@ -1256,10 +1256,10 @@ implementation
hsym:=tsym(FindWithHash(hashedid)); hsym:=tsym(FindWithHash(hashedid));
if assigned(hsym) then if assigned(hsym) then
begin begin
{ Delphi you can have a symbol with the same name as the { Delphi (contrary to TP) you can have a symbol with the same name as the
unit, the unit can then not be accessed anymore using unit, the unit can then not be accessed anymore using
<unit>.<id>, so we can hide the symbol } <unit>.<id>, so we can hide the symbol }
if (m_duplicate_names in current_settings.modeswitches) and if (m_delphi in current_settings.modeswitches) and
(hsym.typ=symconst.unitsym) then (hsym.typ=symconst.unitsym) then
HideSym(hsym) HideSym(hsym)
else else
@ -1310,10 +1310,10 @@ implementation
hsym:=tsym(FindWithHash(hashedid)); hsym:=tsym(FindWithHash(hashedid));
if assigned(hsym) then if assigned(hsym) then
begin begin
{ Delphi you can have a symbol with the same name as the { Delphi (contrary to TP) you can have a symbol with the same name as the
unit, the unit can then not be accessed anymore using unit, the unit can then not be accessed anymore using
<unit>.<id>, so we can hide the symbol } <unit>.<id>, so we can hide the symbol }
if (m_duplicate_names in current_settings.modeswitches) and if (m_delphi in current_settings.modeswitches) and
(hsym.typ=symconst.unitsym) then (hsym.typ=symconst.unitsym) then
HideSym(hsym) HideSym(hsym)
else else

19
tests/webtbf/tw6957.pp Normal file
View File

@ -0,0 +1,19 @@
{ %fail }
{$IFDEF FPC}
{$MODE TP}
{$ENDIF FPC}
unit tw6957;
interface
function tw6957: boolean;
implementation
function tw6957: boolean;
begin
tw6957 := true;
end;
end.