mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-11-04 05:22:59 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			19 lines
		
	
	
		
			247 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			247 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
{ %fail }
 | 
						|
program tgeneric30;
 | 
						|
 | 
						|
{$mode delphi}
 | 
						|
 | 
						|
type
 | 
						|
  TGenericClass<T> = class
 | 
						|
    function DoSomething(Arg: T): T;
 | 
						|
  end;
 | 
						|
 | 
						|
// it must be TGenericClass<T> here
 | 
						|
function TGenericClass.DoSomething(Arg: T): T;
 | 
						|
begin
 | 
						|
  Result := Arg;
 | 
						|
end;
 | 
						|
 | 
						|
begin
 | 
						|
end.
 |