var
i ???
begin
for var i in Something do
begin
// do something
end;
for var i in SomethingElse do
begin
// do something else
end;
end;
That is partly solved but keeps a todo, because I can' t infer i in that case.
var
i: {TODO: add type};
begin
for i in Something do
begin
// do something
end;
for i in SomethingElse do
// do something else
end;
But that can be solved with a renaming pass. Which is not too difficult since I already collect the correct types: only need to resolve the name conflicts in cases where i is used and the types are inferred. That is a corner case, but well worth solving too. It is a corner case: no Delphi code I got from the embarcadero examples used that. It is legal Delphi, so needs a fix? (Basically, yes)
Note this clearly demonstrates the unreadability of inferred inline vars.... You don't know what they mean at any given point in code.
Reading, not writing such code.
For other readers: @LeP means that the two different inferred inline var's i are of different types in the same codeblock, e.g. one could be integer the other could be object or whatever.
This is also not solved in the unleashed branch, btw

(not in my copy)
As always. But the Delphi examples (from the online examples directory) all pass with the premise of everything being rtl.
And before commenting, please read the source. It is not really complex, nor long.
@Martin_fr
It also can not be solved with regexpr otherwise I would have done so.
It needs a proper parser, but you know that.
In general I will leave the code as-is since it passed all delphi examples and it
will produce a todo. Punishment for sloppy programmers that write or use sloppy code.
If something and somethingelse are properly defined and are of the same type it resolves.