Explorar o código

Merged revisions 553-554 via svnmerge from
/trunk

git-svn-id: branches/fixes_2_0@562 -

florian %!s(int64=20) %!d(string=hai) anos
pai
achega
54ce2298d5
Modificáronse 5 ficheiros con 65 adicións e 3 borrados
  1. 2 0
      .gitattributes
  2. 4 2
      compiler/symtable.pas
  3. 1 1
      compiler/symtype.pas
  4. 17 0
      tests/webtbf/tw3969.pp
  5. 41 0
      tests/webtbf/uw3969.pp

+ 2 - 0
.gitattributes

@@ -5303,6 +5303,7 @@ tests/webtbf/tw3738.pp svneol=native#text/plain
 tests/webtbf/tw3740.pp svneol=native#text/plain
 tests/webtbf/tw3790.pp svneol=native#text/plain
 tests/webtbf/tw3841.pp svneol=native#text/plain
+tests/webtbf/tw3969.pp svneol=native#text/plain
 tests/webtbf/tw4111.pp svneol=native#text/plain
 tests/webtbf/uw0744.pp svneol=native#text/plain
 tests/webtbf/uw0840a.pp svneol=native#text/plain
@@ -5310,6 +5311,7 @@ tests/webtbf/uw0840b.pp svneol=native#text/plain
 tests/webtbf/uw0856.pp svneol=native#text/plain
 tests/webtbf/uw2414.pp svneol=native#text/plain
 tests/webtbf/uw3450.pp svneol=native#text/plain
+tests/webtbf/uw3969.pp svneol=native#text/plain
 tests/webtbs/tu2002.pp svneol=native#text/plain
 tests/webtbs/tw0555.pp svneol=native#text/plain
 tests/webtbs/tw0630.pp svneol=native#text/plain

+ 4 - 2
compiler/symtable.pas

@@ -1936,8 +1936,10 @@ implementation
           begin
             sym:=tsym(classh.symtable.speedsearch(s,speedvalue));
             if assigned(sym) and
-               Tsym(sym).is_visible_for_object(topclassh) then
-              break;
+               tsym(sym).is_visible_for_object(topclassh) then
+              break
+            else
+              sym:=nil;
             classh:=classh.childof;
           end;
          searchsym_in_class:=sym;

+ 1 - 1
compiler/symtype.pas

@@ -475,7 +475,7 @@ implementation
       end;
 
 
-    function Tsym.is_visible_for_object(currobjdef:Tdef):boolean;
+    function tsym.is_visible_for_object(currobjdef:Tdef):boolean;
       begin
         is_visible_for_object:=false;
 

+ 17 - 0
tests/webtbf/tw3969.pp

@@ -0,0 +1,17 @@
+{ %fail }
+{$Mode Delphi}
+{$R-,X+,V-}
+uses crt, uw3969;
+
+var
+  myobj: testobj;
+
+begin
+  clrscr;
+  myobj.init;
+  writeln(myobj.getvar);
+  myobj.setvar('antonio');
+  myobj.myvar := 'pippo';
+  writeln(myobj.myvar);
+  myobj.done;
+end.

+ 41 - 0
tests/webtbf/uw3969.pp

@@ -0,0 +1,41 @@
+{$Mode Delphi}
+{$R-,X+,V-}
+
+unit uw3969;
+
+interface
+
+   type testobj = object
+      constructor init;
+      destructor done;
+      procedure setvar(value: string);
+      function getvar: string;
+
+      private
+
+      myvar: string;
+   end;
+
+implementation
+
+   constructor testobj.init;
+   begin
+      myvar := 'init';
+   end;
+
+   destructor testobj.done;
+   begin
+      myvar := 'done';
+   end;
+
+   procedure testobj.setvar;
+   begin
+      myvar := value;
+   end;
+
+   function testobj.getvar : string;
+   begin
+      result := myvar;
+   end;
+
+end.