pascalabcnet/TestSuite/errors/err0536.pas
2024-03-31 12:13:41 +02:00

20 lines
590 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.

//!Невозможно преобразовать функциональный тип в процедурный тип
uses System.Threading.Tasks;
type
c1<T> = class
field1: Task<T>;
procedure pr1(act: System.Action);
begin
Task.CompletedTask.ContinueWith(r-> act.Invoke);
end;
// если закомментировать этот кусок, то перестанет компилироваться pr1 о_О
procedure pr2<T1>(fun: Func<T, T1>);
begin
field1.ContinueWith( e-> fun.Invoke(e.result) );
end;
end;
begin end.