Hi folks,
the line:
if getMouseButtonPressStream^ .getLastEvent^ .getTarget = fLastEvent^ .getTarget then
results in an error message:
alpevents.pas:1255: error: invalid type of argument of `^'
The error message disappears if I change the line into:
if ( getMouseButtonPressStream^ .getLastEvent )^ .getTarget = fLastEvent^ .getTarget then
What's that?
Regards,
Markus
Markus Gerwinski wrote:
Hi folks,
the line:
if getMouseButtonPressStream^ .getLastEvent^ .getTarget = fLastEvent^ .getTarget then
results in an error message:
alpevents.pas:1255: error: invalid type of argument of `^'
The error message disappears if I change the line into:
if ( getMouseButtonPressStream^ .getLastEvent )^ .getTarget = fLastEvent^ .getTarget then
What's that?
An incomplete example.
(As was said so often, sending reproducible examples will really help us.)
Frank
Frank Heckenbach wrote:
(As was said so often, sending reproducible examples will really help us.)
Okay, I now reproduced the error in a short simple unit. (Attached.) The respective line therein reads:
if getFoo^ .getBar^ .getBaz = gBar^ .getBaz then writeln ( ':-)' );
The error condition breaks down to this: - getFoo is a (global) function returning a pointer to an object. - getBar is a method function returning a pointer to an object. - getBaz is an arbitrary method function.
Then the parser seemingly isn't able anymore (it was back in version 20041218) to resolve this line, and compiling terminates with the error message
test.pas: In procedure `foobarbaz': test.pas:51: Fehler: invalid type of argument of `^'
If you insert brackets like this, the error disappears:
if ( getFoo^ .getBar )^ .getBaz = gBar^ .getBaz then writeln ( ':-)' );
Yours,
Markus
Markus Gerwinski wrote:
Frank Heckenbach wrote:
(As was said so often, sending reproducible examples will really help us.)
Okay, I now reproduced the error in a short simple unit. (Attached.) The respective line therein reads:
if getFoo^ .getBar^ .getBaz = gBar^ .getBaz then writeln ( ':-)' );
The error condition breaks down to this:
- getFoo is a (global) function returning a pointer to an object.
- getBar is a method function returning a pointer to an object.
- getBaz is an arbitrary method function.
Then the parser seemingly isn't able anymore (it was back in version 20041218) to resolve this line, and compiling terminates with the error message
test.pas: In procedure `foobarbaz': test.pas:51: Fehler: invalid type of argument of `^'
If you insert brackets like this, the error disappears:
if ( getFoo^ .getBar )^ .getBaz = gBar^ .getBaz then writeln ( ':-)' );
Try this patch (markus10*.pas):
--- p/expressions.c.orig Sun Apr 10 23:46:33 2005 +++ p/expressions.c Mon Apr 11 00:08:05 2005 @@ -1629,6 +1629,8 @@ && PASCAL_CST_PARENTHESES (pointer)) error ("invalid parentheses according to ISO Pascal");
+ pointer = probably_call_function (pointer); + if (TREE_SIDE_EFFECTS (pointer)) pointer = save_expr (pointer); prediscriminate_schema (pointer);
Frank