Jelajahi Sumber

compiler: redo type search in parent classes. previous trial breaks objective pascal implementation

git-svn-id: trunk@16505 -
paul 14 tahun lalu
induk
melakukan
af39178e06
3 mengubah file dengan 5 tambahan dan 8 penghapusan
  1. 2 2
      compiler/pdecobj.pas
  2. 1 2
      compiler/ptype.pas
  3. 2 4
      compiler/symtable.pas

+ 2 - 2
compiler/pdecobj.pas

@@ -1047,11 +1047,11 @@ implementation
             { parse optional GUID for interfaces }
             { parse optional GUID for interfaces }
             parse_guid;
             parse_guid;
 
 
-            push_child_hierarcy(current_objectdef);
+            symtablestack.push(current_objectdef.symtable);
             insert_generic_parameter_types(genericdef,genericlist);
             insert_generic_parameter_types(genericdef,genericlist);
             { parse and insert object members }
             { parse and insert object members }
             parse_object_members;
             parse_object_members;
-            pop_child_hierarchy(current_objectdef);
+            symtablestack.pop(current_objectdef.symtable);
           end;
           end;
 
 
         { generate vmt space if needed }
         { generate vmt space if needed }

+ 1 - 2
compiler/ptype.pas

@@ -396,8 +396,7 @@ implementation
                 end;
                 end;
              objdef:=tobjectdef(tobjectdef(objdef).owner.defowner);
              objdef:=tobjectdef(tobjectdef(objdef).owner.defowner);
            end;
            end;
-         { Use the special searchsym_type that ignores records,objects and
-           parameters }
+         { Use the special searchsym_type that ignores records and parameters }
          searchsym_type(s,srsym,srsymtable);
          searchsym_type(s,srsym,srsymtable);
          { handle unit specification like System.Writeln }
          { handle unit specification like System.Writeln }
          is_unit_specific:=try_consume_unitsym(srsym,srsymtable,t);
          is_unit_specific:=try_consume_unitsym(srsym,srsymtable,t);

+ 2 - 4
compiler/symtable.pas

@@ -1856,10 +1856,9 @@ implementation
                   end;
                   end;
               end;
               end;
             { also search for class helpers }
             { also search for class helpers }
-            if (srsymtable.symtabletype=objectsymtable) and
-               is_objcclass(tdef(srsymtable.defowner)) then
+            if (srsymtable.symtabletype=objectsymtable) then
               begin
               begin
-                if search_class_helper(tobjectdef(srsymtable.defowner),s,srsym,srsymtable) then
+                if searchsym_in_class(tobjectdef(srsymtable.defowner),tobjectdef(srsymtable.defowner),s,srsym,srsymtable) then
                   begin
                   begin
                     result:=true;
                     result:=true;
                     exit;
                     exit;
@@ -1885,7 +1884,6 @@ implementation
             {
             {
               It is not possible to have type symbols in:
               It is not possible to have type symbols in:
                 records
                 records
-                objects
                 parameters
                 parameters
               Exception are classes, objects, generic definitions and specializations
               Exception are classes, objects, generic definitions and specializations
               that have the parameterized types inserted in the symtable.
               that have the parameterized types inserted in the symtable.