bug fix #440
This commit is contained in:
parent
c3041fd6f1
commit
a4e3b61484
10
TestSuite/yieldset1.pas
Normal file
10
TestSuite/yieldset1.pas
Normal 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.
|
||||
|
|
@ -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!
|
||||
|
|
|
|||
Loading…
Reference in a new issue