mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-11-04 07:43:04 +01:00 
			
		
		
		
	pgenutil.pas: * parse_generic_parameters: create explicit undefineddefs for type parameters that don't have a constraint * insert_generic_parameter_types: move the created undefineddefs from the parent symtable to the generic's symtable defcmp.pas, compare_defs_ext: * in case the flag for strict undefineddef checks is set don't consider two different undefineddefs as compatible + added tests git-svn-id: trunk@30705 -
		
			
				
	
	
		
			34 lines
		
	
	
		
			431 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			431 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
{ %NORUN }
 | 
						|
 | 
						|
program tw27750a;
 | 
						|
 | 
						|
{$MODE DELPHI}
 | 
						|
 | 
						|
type
 | 
						|
 | 
						|
  { TGeneric }
 | 
						|
 | 
						|
  TGeneric<Foo, Bar> = record
 | 
						|
  public type
 | 
						|
    TGFB = TGeneric<Foo, Bar>;
 | 
						|
  public
 | 
						|
    class operator implicit(aFoo : Foo) : TGFB;
 | 
						|
    class operator implicit(aBar : Bar) : TGFB;
 | 
						|
  end;
 | 
						|
 | 
						|
{ TGeneric }
 | 
						|
 | 
						|
class operator TGeneric<Foo, Bar>.implicit(aFoo: Foo): TGFB;
 | 
						|
begin
 | 
						|
 | 
						|
end;
 | 
						|
 | 
						|
class operator TGeneric<Foo, Bar>.implicit(aBar: Bar): TGFB;
 | 
						|
begin
 | 
						|
 | 
						|
end;
 | 
						|
 | 
						|
begin
 | 
						|
end.
 | 
						|
 |