mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-11-04 10:39:40 +01:00 
			
		
		
		
	* when checking whether the current class definition finalises an existing
forward-declared class, only search the current symtable rather than the
    entire symtable stack (to prevent finding types in e.g. nested types)
git-svn-id: trunk@17128 -
			
			
This commit is contained in:
		
							parent
							
								
									c439d0107d
								
							
						
					
					
						commit
						ac283bb237
					
				
							
								
								
									
										1
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
								
							@ -9531,6 +9531,7 @@ tests/test/tclass12c.pp svneol=native#text/pascal
 | 
			
		||||
tests/test/tclass12d.pp svneol=native#text/plain
 | 
			
		||||
tests/test/tclass13.pp svneol=native#text/pascal
 | 
			
		||||
tests/test/tclass13a.pp svneol=native#text/plain
 | 
			
		||||
tests/test/tclass13b.pp svneol=native#text/plain
 | 
			
		||||
tests/test/tclass14a.pp svneol=native#text/pascal
 | 
			
		||||
tests/test/tclass14b.pp svneol=native#text/pascal
 | 
			
		||||
tests/test/tclass2.pp svneol=native#text/plain
 | 
			
		||||
 | 
			
		||||
@ -397,7 +397,6 @@ implementation
 | 
			
		||||
         typename,orgtypename : TIDString;
 | 
			
		||||
         newtype  : ttypesym;
 | 
			
		||||
         sym      : tsym;
 | 
			
		||||
         srsymtable : TSymtable;
 | 
			
		||||
         hdef     : tdef;
 | 
			
		||||
         defpos,storetokenpos : tfileposinfo;
 | 
			
		||||
         old_block_type : tblock_type;
 | 
			
		||||
@ -462,8 +461,10 @@ implementation
 | 
			
		||||
               current_scanner.startrecordtokens(generictokenbuf);
 | 
			
		||||
             end;
 | 
			
		||||
 | 
			
		||||
           { is the type already defined? }
 | 
			
		||||
           searchsym(typename,sym,srsymtable);
 | 
			
		||||
           { is the type already defined? -- must be in the current symtable,
 | 
			
		||||
             not in a nested symtable or one higher up the stack -> don't
 | 
			
		||||
             use searchsym & frinds! }
 | 
			
		||||
           sym:=tsym(symtablestack.top.find(typename));
 | 
			
		||||
           newtype:=nil;
 | 
			
		||||
           { found a symbol with this name? }
 | 
			
		||||
           if assigned(sym) then
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										23
									
								
								tests/test/tclass13b.pp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								tests/test/tclass13b.pp
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,23 @@
 | 
			
		||||
{ %norun }
 | 
			
		||||
 | 
			
		||||
{$mode delphi}
 | 
			
		||||
 | 
			
		||||
type
 | 
			
		||||
  tc = class
 | 
			
		||||
    type
 | 
			
		||||
      tforward = class;
 | 
			
		||||
 | 
			
		||||
      tnested = class
 | 
			
		||||
        type
 | 
			
		||||
          tforward = class;
 | 
			
		||||
 | 
			
		||||
          tforward = class
 | 
			
		||||
          end;
 | 
			
		||||
      end;
 | 
			
		||||
 | 
			
		||||
      tforward = class
 | 
			
		||||
      end;
 | 
			
		||||
  end;
 | 
			
		||||
 | 
			
		||||
begin
 | 
			
		||||
end.
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user