ghkweon / dwscript

Automatically exported from code.google.com/p/dwscript
0 stars 0 forks source link

Bogus "declared but never written to" hint #482

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
procedure GetValue(var x: integer);
begin
   x := 42;
end;

procedure Test;
var
   i: integer;
begin
   GetValue(i);
   print(i);
end;

Expected: This should compile and run without any objections.
Observed: Hint: Variable "I" declared but never written to

On a related note, it would be nice to be able to declare an "out" parameter to 
make the intention explicit here.

Original issue reported on code.google.com by masonwhe...@gmail.com on 28 Jul 2014 at 3:04