bug fix #778
This commit is contained in:
parent
4ac49e57e0
commit
3e1d264cbd
|
|
@ -41,6 +41,8 @@ namespace SyntaxVisitors
|
|||
return;
|
||||
}
|
||||
|
||||
if (cd.body == null)
|
||||
return;
|
||||
var fields = cd.body.class_def_blocks.SelectMany(cm => cm.members.Where(decl => decl is var_def_statement)
|
||||
.Select(decl1 => (decl1 as var_def_statement).vars.idents)
|
||||
.SelectMany(ids => ids.Select(id => id)));
|
||||
|
|
|
|||
|
|
@ -39,7 +39,8 @@ namespace SyntaxVisitors
|
|||
// Yoda
|
||||
return;
|
||||
}
|
||||
|
||||
if (cd.body == null)
|
||||
return;
|
||||
var methods = cd.body.class_def_blocks.SelectMany(cm => cm.members.Select(decl1 =>
|
||||
{
|
||||
if (decl1 is procedure_header)
|
||||
|
|
|
|||
|
|
@ -39,7 +39,8 @@ namespace SyntaxVisitors
|
|||
// Yoda
|
||||
return;
|
||||
}
|
||||
|
||||
if (cd.body == null)
|
||||
return;
|
||||
var properties = cd.body.class_def_blocks.SelectMany(cm => cm.members.Select(decl => decl as simple_property)
|
||||
.Where(name => (object)name != null)
|
||||
.Select(sp => sp.property_name));
|
||||
|
|
|
|||
16
TestSuite/yield4.pas
Normal file
16
TestSuite/yield4.pas
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
type
|
||||
t1 = class;
|
||||
|
||||
t1 = class
|
||||
function f1: sequence of byte;
|
||||
begin
|
||||
yield 0;//обязательно yield
|
||||
yield 1;
|
||||
end;
|
||||
end;
|
||||
|
||||
begin
|
||||
var o1:t1 := new t1;
|
||||
var arr := o1.f1.ToArray;
|
||||
assert(arr[1] = 1);
|
||||
end.
|
||||
Loading…
Reference in a new issue