This commit is contained in:
Бондарев Иван 2017-08-09 19:36:41 +02:00
parent 01efad3d4f
commit dccde94e62
5 changed files with 19 additions and 3 deletions

View file

@ -824,7 +824,13 @@ namespace PascalABCCompiler.PCU
{ {
name_array[i] = new NameRef(cur_cnn.functions[i - j].name, i); name_array[i] = new NameRef(cur_cnn.functions[i - j].name, i);
if (cur_cnn.functions[i - j].ConnectedToType != null) if (cur_cnn.functions[i - j].ConnectedToType != null)
{
name_array[i].special_scope = 1; name_array[i].special_scope = 1;
if (cur_cnn.functions[i - j].return_value_type != null)
name_array[i].symbol_kind = symbol_kind.sk_overload_function;
else
name_array[i].symbol_kind = symbol_kind.sk_overload_procedure;
}
pools[cur_cnn.functions[i - j]] = name_array[i]; pools[cur_cnn.functions[i - j]] = name_array[i];
} }
j = i; j = i;

View file

@ -5,7 +5,7 @@
/// !! System unit /// !! System unit
unit PABCSystem; unit PABCSystem;
{$define PascalABC} {$define PascalABC}
{$gendoc true} {$gendoc true}

11
TestSuite/overloads7.pas Normal file
View file

@ -0,0 +1,11 @@
var i: integer;
procedure p := Inc(i);
begin
var q := 3*p;
var q1 := p*3;
q;
assert(i=3);
q1;
assert(i=6);
end.

View file

@ -107,7 +107,6 @@ var __initialized: boolean;
procedure __InitModule; procedure __InitModule;
begin begin
end; end;
procedure __InitModule__; procedure __InitModule__;

View file

@ -5,7 +5,7 @@
/// !! System unit /// !! System unit
unit PABCSystem; unit PABCSystem;
{$define PascalABC} {$define PascalABC}
{$gendoc true} {$gendoc true}