mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 00:09:32 +02:00
* create_for_in_loop: explicitely convert "for ... in [] do" to a nothing-node including an unreachable code warning (avoids code conversions that are for naught anyway)
git-svn-id: trunk@36096 -
This commit is contained in:
parent
df893b4a30
commit
a8b1d340c7
@ -872,6 +872,14 @@ implementation
|
||||
hloopbody.free;
|
||||
end;
|
||||
end
|
||||
{ "for x in [] do ..." always results in a never executed loop body }
|
||||
else if (is_array_constructor(expr.resultdef) and
|
||||
(tarraydef(expr.resultdef).elementdef=voidtype)) then
|
||||
begin
|
||||
if assigned(hloopbody) then
|
||||
MessagePos(hloopbody.fileinfo,cg_w_unreachable_code);
|
||||
result:=cnothingnode.create;
|
||||
end
|
||||
else
|
||||
begin
|
||||
// search for operator first
|
||||
|
Loading…
Reference in New Issue
Block a user