I don't have the time to report it to bugfile or to check if it is already solved (but I guess it is not solved because the naturity of it).
When I define records like this:
TRect = record
x: integer;
y: integer;
w: integer;
h: integer;
End;
I declare a var:
Var
rectangle: TRect;
And when I try to assign values:
begin
rectangle.x := 10;
rectangle.y := 20;
rectangle.w := 50;
rectangle.h := 60;
end;
A breakpoint in the beginning of the assignment pause the program in that place. Then I evaluate the values and guess what:
rectangle.h = Type TRECT has no component named h.
Sometimes in some uncommon situation assigning a value to h in any record or class what have a h name gives me a SIGSEGV.
The special case is with SDL2 calling SDL_RenderCopy or SDL_RenderCopyEx where that functions try to assign values to a TSDL_Rect type, specially in the h component.
In a near finished work/program that I am developing when I use intensively types like the TRect declared above, I give a lot of "Type <kind of type> has no component named h" or sometimes a problem with the name y too (I don't remember now if it is the same problem, but appears to be related).
And that don't let me evaluate or modify the "h" named fields.
It appears that h is used internally? Or the compiler for some reason is confusing the h with something other thing.
If I use complete names like "height":
TRect = record
x: integer;
y: integer;
width: integer;
height: integer;
End;
It works as expected. It shows the values.
But If I declare h alone:
Var
h : integer;
And in the breakpoint code:
h := 135;
The evaluate/modify says: h = nil
How that can be possible? H is integer! not pointer! how it can be nil?
If I try to assign a nil value to some integer type I get the error:
'Error: Incompatible types: got "Pointer" expected "Longint"
So, something is wrong in FPC using the name 'h'.
Is h some reserved var? As I know is not.
What is happening then?