← board

Implicit (sloppy) local variables behind a switch — {$IMPLICITVARS ON} / --auto-locals

Idea

Under an explicit opt-in switch, an assignment to a previously-undeclared name creates an inferred local (no var, no type):

{$IMPLICITVARS ON}      { or  pxx --auto-locals  }
begin
  i := 0;               { implicit local, inferred Integer }
  s := 'abc';           { implicit local, inferred AnsiString }
  for i := 0 to 9 do ...
end;

This is "sloppy mode" — Python/BASIC ergonomics in Pascal. pxx's Nil-Python and BASIC frontends already do exactly this, via the same tyAuto (defs.inc:540) inference the inline-var path uses, so the machinery exists.

Why / why behind a switch

Behaviour

Implementation notes

Acceptance

Log