[fpc-pascal] Non-initialized member access warning

Hairy Pixels genericptr at gmail.com
Wed Jun 7 10:44:43 CEST 2023


I'm curious, why doesn't the following code give a warning? Shouldn't the compiler know you're assigning to "r" which hasn't been initialized yet?

type
	TMyClass = class
		x: integer;
	end;

procedure MyProcedure; 
var
	r: TMyClass;
begin
	r.x := 1;
end;


Regards,
	Ryan Joseph



More information about the fpc-pascal mailing list