mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-11-04 08:19:36 +01:00 
			
		
		
		
	
							parent
							
								
									bbe9ea7ff4
								
							
						
					
					
						commit
						2ab60da6d5
					
				
							
								
								
									
										1
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
								
							@ -7547,6 +7547,7 @@ tests/test/tgeneric13.pp svneol=native#text/plain
 | 
			
		||||
tests/test/tgeneric14.pp svneol=native#text/plain
 | 
			
		||||
tests/test/tgeneric15.pp svneol=native#text/plain
 | 
			
		||||
tests/test/tgeneric16.pp svneol=native#text/plain
 | 
			
		||||
tests/test/tgeneric17.pp svneol=native#text/plain
 | 
			
		||||
tests/test/tgeneric2.pp svneol=native#text/plain
 | 
			
		||||
tests/test/tgeneric3.pp svneol=native#text/plain
 | 
			
		||||
tests/test/tgeneric4.pp svneol=native#text/plain
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										26
									
								
								tests/test/tgeneric17.pp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								tests/test/tgeneric17.pp
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,26 @@
 | 
			
		||||
{$mode objfpc}{$H+}
 | 
			
		||||
 | 
			
		||||
type
 | 
			
		||||
  generic TGListItem<T> = class(TObject)
 | 
			
		||||
  public
 | 
			
		||||
    FNext: TGListItem;
 | 
			
		||||
    procedure Assign(Source: TGListItem);
 | 
			
		||||
  end;
 | 
			
		||||
 | 
			
		||||
procedure TGListItem.Assign(Source: TGListItem)
 | 
			
		||||
begin
 | 
			
		||||
  FNext := Source;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
type
 | 
			
		||||
  TIntListItem = specialize TGListItem<Integer>;
 | 
			
		||||
 | 
			
		||||
var
 | 
			
		||||
  A, B: TIntListItem;
 | 
			
		||||
begin
 | 
			
		||||
  A := TIntListItem.Create;
 | 
			
		||||
  B := TIntListItem.Create;
 | 
			
		||||
  A.Assign(B);
 | 
			
		||||
  if A.FNext <> B then
 | 
			
		||||
    halt(1);
 | 
			
		||||
end.
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user