mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-01 17:30:21 +02:00
* don't throw an internal error if a procedure is passed to a const formal parameter, resolves #40817
This commit is contained in:
parent
558704f91c
commit
8b2ebd07bf
@ -1828,7 +1828,7 @@ implementation
|
||||
blockn,
|
||||
calln :
|
||||
begin
|
||||
if (hp.nodetype=calln) or
|
||||
if ((hp.nodetype=calln) and not(is_void(hp.resultdef))) or
|
||||
(nf_no_lvalue in hp.flags) then
|
||||
begin
|
||||
{ Temp strings are stored in memory, for compatibility with
|
||||
|
12
tests/webtbf/tw40817.pp
Normal file
12
tests/webtbf/tw40817.pp
Normal file
@ -0,0 +1,12 @@
|
||||
{ %fail ]
|
||||
procedure proc;
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure test(const o);
|
||||
begin
|
||||
end;
|
||||
|
||||
begin
|
||||
test(proc); // project1.lpr(10,3) Error: Internal error 2011010304
|
||||
end.
|
Loading…
Reference in New Issue
Block a user