This commit is contained in:
parent
2bf21fb8aa
commit
4893429c2b
|
|
@ -347,7 +347,14 @@ namespace SyntaxVisitors
|
|||
{
|
||||
if (className is template_type_name)
|
||||
{
|
||||
return new template_type_name(helperName, (className as template_type_name).template_args);
|
||||
if (pd.proc_header.template_args != null)
|
||||
{
|
||||
var template_args = (className as template_type_name).template_args.Clone() as ident_list;
|
||||
template_args.AddMany(pd.proc_header.template_args.idents.ToArray());
|
||||
return new template_type_name(helperName, template_args);
|
||||
}
|
||||
else
|
||||
return new template_type_name(helperName, (className as template_type_name).template_args);
|
||||
}
|
||||
else if (pd.proc_header.template_args != null)
|
||||
{
|
||||
|
|
|
|||
23
TestSuite/yield5.pas
Normal file
23
TestSuite/yield5.pas
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
type
|
||||
c1<T1> = class
|
||||
|
||||
function f1<T2>: sequence of T2;
|
||||
begin
|
||||
|
||||
var s: T2;
|
||||
var s1: T1;
|
||||
yield s;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
begin
|
||||
var o := new c1<integer>;
|
||||
var i: integer;
|
||||
foreach var e in o.f1&<integer> do
|
||||
begin
|
||||
assert(e = 0);
|
||||
Inc(i);
|
||||
end;
|
||||
assert(i = 1);
|
||||
end.
|
||||
Loading…
Reference in a new issue