pascalabcnet/TestSuite/lambdas_in_generics_2.pas
Mikhalkovich Stanislav c9617a5afc fix #2253
ABCPascal.cs
ABCPascalYacc.cs вернул на место
2020-06-18 23:17:13 +03:00

16 lines
465 B
ObjectPascal
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Это холостой тест. В оригинале было where G: integer но это мы запретили
type cl<T> = class where T: constructor;
public procedure pr<G>(a: IEnumerable<G>); where G: record;
begin
var tt := a.OrderBy(x -> begin var d: T := new T(); result := x end).ToList;
//assert(tt[0] = 1);
//assert(tt[1] = 2);
//assert(tt[2] = 3);
end;
end;
begin
var t := new cl<integer>();
t.pr(Seq(3,2,1));
end.