This commit is contained in:
Бондарев Иван 2017-12-28 12:27:15 +01:00
parent c3041fd6f1
commit a4e3b61484
2 changed files with 12 additions and 0 deletions

10
TestSuite/yieldset1.pas Normal file
View file

@ -0,0 +1,10 @@
type CharSet = set of char;
function Test: sequence of CharSet;
begin
var set1 := ['a','b'];
yield set1;
end;
begin
assert(test().First = ['a','b']);
end.

View file

@ -16278,12 +16278,14 @@ namespace PascalABCCompiler.TreeConverter
var cfr = to as class_field_reference;
cfr.field.type = from.type;
cfr.type = from.type;
cfr.field.inital_value = context.GetInitalValueForVariable(cfr.field, cfr.field.inital_value);
}
else if (to is local_block_variable_reference)
{
var lvr = to as local_block_variable_reference;
lvr.var.type = from.type;
lvr.type = from.type;
lvr.var.inital_value = context.GetInitalValueForVariable(lvr.var, lvr.var.inital_value);
}
else AddError(to.location, "Не могу вывести тип при наличии yield: "+ to.type.full_name);
//to.type = from.type; // и без всякого real_type!