This commit is contained in:
Ivan Bondarev 2022-04-24 11:05:43 +02:00
parent 79fa24a888
commit 7b3cb71ccd
3 changed files with 17 additions and 0 deletions

View file

@ -7198,6 +7198,11 @@ namespace PascalABCCompiler.NETGenerator
is_addr = true;
}
}
if (parameters[i].type is ICompiledTypeNode && (parameters[i].type as ICompiledTypeNode).compiled_type == TypeFactory.CharType && parameters[i].parameter_type == parameter_type.var
&& real_parameters[i] is ISimpleArrayIndexingNode && helper.GetTypeReference((real_parameters[i] as ISimpleArrayIndexingNode).array.type).tp == TypeFactory.StringType)
{
copy_string = true;
}
real_parameters[i].visit(this);
if (mi.DeclaringType == TypeFactory.ArrayType && mi.Name == "Resize" && i == 1)

1
TestSuite/exe/input.txt Normal file
View file

@ -0,0 +1 @@
45

11
TestSuite/stringelem5.pas Normal file
View file

@ -0,0 +1,11 @@
var
a, b: string;
begin
a := '1';
b := '1';
assign(input,'input.txt');
readln(a[1], b[1]);
assert(a[1] = '4');
assert(b[1] = '5');
end.