mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 12:28:02 +02: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 -
35 lines
436 B
ObjectPascal
35 lines
436 B
ObjectPascal
{ %NORUN }
|
|
|
|
program tw27750b;
|
|
|
|
{$MODE OBJFPC}
|
|
{$modeswitch advancedrecords}
|
|
|
|
type
|
|
|
|
{ TGeneric }
|
|
|
|
generic TGeneric<Foo, Bar> = record
|
|
public type
|
|
TGFB = specialize TGeneric<Foo, Bar>;
|
|
public
|
|
class operator :=(aFoo : Foo) : TGFB;
|
|
class operator :=(aBar : Bar) : TGFB;
|
|
end;
|
|
|
|
{ TGeneric }
|
|
|
|
class operator TGeneric.:=(aFoo: Foo): TGFB;
|
|
begin
|
|
|
|
end;
|
|
|
|
class operator TGeneric.:=(aBar: Bar): TGFB;
|
|
begin
|
|
|
|
end;
|
|
|
|
begin
|
|
end.
|
|
|