Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2023-11

Incompatible procedure types

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Hairy Pixels

What does this error mean? It's comparing a pointer to a procedure to a procedure variable (a callback). The signature appears exactly the same "function(TSymbol;TSymbol):LongInt is nested" so what's the problem?

error: Incompatible type for arg no. 2: Got "<address of function(TSymbol;TSymbol):LongInt is nested;StdCall>", expected "TSList$1$crcCC4DE170_crc9A33B934.<procedure variable type of function(TSymbol;TSymbol):LongInt is nested;StdCall>"

Regards,
Ryan Joseph

Reply by email

Sven Barth
to Hairy Pixels

Hairy Pixels via fpc-pascal schrieb am
Mi., 8. Nov. 2023, 01:48:

Show quoted text 9 lines
What does this error mean? It's comparing a pointer to a procedure to a procedure variable (a callback). The signature appears exactly the same "function(TSymbol;TSymbol):LongInt is nested" so what's the problem? error: Incompatible type for arg no. 2: Got "<address of function(TSymbol;TSymbol):LongInt is nested;StdCall>", expected "TSList$1$crcCC4DE170_crc9A33B934.<procedure variable type of function(TSymbol;TSymbol):LongInt is nested;StdCall>"

Please provide example code so that one can messages without example are more often than not simply useless.

Regards,
Sven

Reply by email

Hairy Pixels
to Sven Barth
On Nov 8, 2023, at 1:50 PM, Sven Barth via fpc-pascal wrote: Please provide example code so that one can messages without example are more often than not simply useless.

So this ended up being because I didn't enable the "nestedprocvars" mode switch and you get that error assigning to a "is nested" procedure variable. This has bitten me sooooo many times. That error message is basically worthless to a user and should probably be changed.

Regards,
Ryan Joseph

Reply by email

Sven Barth
to Hairy Pixels

Hairy Pixels schrieb am Do., 9. Nov. 2023, 01:37:

Show quoted text 14 lines
> On Nov 8, 2023, at 1:50 PM, Sven Barth via fpc-pascal < > wrote: > > Please provide example code so that one can messages without example are more often than not simply useless. > So this ended up being because I didn't enable the "nestedprocvars" mode switch and you get that error assigning to a "is nested" procedure variable. This has bitten me sooooo many times. That error message is basically worthless to a user and should probably be changed.

Still, provide an example, please.

Regards,
Sven

Reply by email