This commit is contained in:
parent
34eb88dab7
commit
d978d3bd88
25
TestSuite/lambdas_generics11.pas
Normal file
25
TestSuite/lambdas_generics11.pas
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
type
|
||||
t1<T> = class
|
||||
|
||||
procedure p1<T2>(f: T->T2);
|
||||
begin
|
||||
assert(f(default(T)).ToString() = '22');
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure p1<T>;
|
||||
begin
|
||||
var o: t1<byte>;
|
||||
o.p1(b->'22'); // ok
|
||||
end;
|
||||
|
||||
procedure p2<TSource>;
|
||||
begin
|
||||
var o: t1<TSource> := new t1<TSource>;
|
||||
o.p1(b->'22');
|
||||
end;
|
||||
|
||||
begin
|
||||
p2&<integer>;
|
||||
end.
|
||||
Loading…
Reference in a new issue