Browse Source

* variables can have the same name as the main program in iso mode, resolves #37322

git-svn-id: trunk@45757 -
florian 5 years ago
parent
commit
392d66a9ce
3 changed files with 10 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 2 0
      compiler/symtable.pas
  3. 7 0
      tests/webtbs/tw37322.pp

+ 1 - 0
.gitattributes

@@ -18349,6 +18349,7 @@ tests/webtbs/tw37254.pp svneol=native#text/pascal
 tests/webtbs/tw37261.pp svneol=native#text/pascal
 tests/webtbs/tw37272a.pp svneol=native#text/pascal
 tests/webtbs/tw37301.pp svneol=native#text/pascal
+tests/webtbs/tw37322.pp svneol=native#text/pascal
 tests/webtbs/tw3742.pp svneol=native#text/plain
 tests/webtbs/tw3751.pp svneol=native#text/plain
 tests/webtbs/tw3758.pp svneol=native#text/plain

+ 2 - 0
compiler/symtable.pas

@@ -2552,6 +2552,8 @@ implementation
                 HideSym(hsym);
                 tstaticvarsym(sym).isoindex:=tprogramparasym(hsym).isoindex;
               end
+            else if (m_iso in current_settings.modeswitches) and (hsym.typ=unitsym) then
+              HideSym(hsym)
             else
               DuplicateSym(hashedid,sym,hsym,false);
             result:=true;

+ 7 - 0
tests/webtbs/tw37322.pp

@@ -0,0 +1,7 @@
+{ %OPT=-Miso }
+program test;
+
+var test: integer;
+
+begin
+end.