fix #2582
This commit is contained in:
parent
f88ef8abcd
commit
eef8481b7c
|
|
@ -721,10 +721,14 @@ namespace PascalABCCompiler.PCU
|
||||||
{
|
{
|
||||||
int pos = (int)bw.BaseStream.Position;
|
int pos = (int)bw.BaseStream.Position;
|
||||||
members[dn] = pos;
|
members[dn] = pos;
|
||||||
name_pool[dn].offset = pos;
|
if (name_pool.ContainsKey(dn))
|
||||||
if (dn is common_namespace_function_node)
|
{
|
||||||
if ((dn as common_namespace_function_node).is_overload)
|
name_pool[dn].offset = pos;
|
||||||
name_pool[dn].symbol_kind = symbol_kind.sk_overload_function;
|
if (dn is common_namespace_function_node)
|
||||||
|
if ((dn as common_namespace_function_node).is_overload)
|
||||||
|
name_pool[dn].symbol_kind = symbol_kind.sk_overload_function;
|
||||||
|
}
|
||||||
|
|
||||||
gl_members[dn] = pos;
|
gl_members[dn] = pos;
|
||||||
List<PCUWriter> pwl = null;
|
List<PCUWriter> pwl = null;
|
||||||
//если какой-то модуль ждет смещения от этой сущности, сообщаем ему
|
//если какой-то модуль ждет смещения от этой сущности, сообщаем ему
|
||||||
|
|
|
||||||
18
TestSuite/units/u_delegates5.pas
Normal file
18
TestSuite/units/u_delegates5.pas
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
unit u_delegates5;
|
||||||
|
interface
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
type
|
||||||
|
d<T> = T->();
|
||||||
|
|
||||||
|
procedure Test;
|
||||||
|
begin
|
||||||
|
var i := 0;
|
||||||
|
var f: d<integer> := x -> begin i := x end;
|
||||||
|
f(2);
|
||||||
|
assert(i = 2);
|
||||||
|
end;
|
||||||
|
begin
|
||||||
|
Test;
|
||||||
|
end.
|
||||||
1
TestSuite/usesunits/use_delegates5.pas
Normal file
1
TestSuite/usesunits/use_delegates5.pas
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uses u_delegates5; begin end.
|
||||||
Loading…
Reference in a new issue