pascalabcnet/TestSuite/yieldoperator1.pas
2022-09-25 10:53:20 +02:00

22 lines
426 B
ObjectPascal
Raw 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.

type
t1 = class
// Обязательно оператор
static function operator+(p1, p2: t1): t1;
begin
end;
// Обязательно yield-функция
// Не важно, статическая или экземплярная
function f1: sequence of byte;
begin
yield 1;
end;
end;
begin
var o := new t1;
assert(o.f1.ToArray[0] = 1);
end.