Sign in Join

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

Mailing lists / fpc-devel / 2008-07

Incompatible Types: got "untyped" expected "<procedure variable type of procedure(Pointer);Register>

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Sean McIlwain

I'm getting a Error: Incompatible Types: got "untyped" expected "<procedure variable type of procedure(Pointer);Register> when compiling the following code. This happens when using default parameter values.

Here is an example:

var Callback: procedure(Data: Pointer);
procedure Proc(AData: Pointer = nil);
begin
end;
initialization
Callback := Proc;

If the = nil is removed, then the code compiles.

Thanks,
Sean

Reply by email

Mattias Gaertner
to Sean McIlwain
Show quoted text 19 lines
I'm getting a Error: Incompatible Types: got "untyped" expected "<procedure variable type of procedure(Pointer);Register> when compiling the following code. This happens when using default parameter values. Here is an example: var Callback: procedure(Data: Pointer); procedure Proc(AData: Pointer = nil); begin end; initialization Callback := Proc; If the = nil is removed, then the code compiles.

Use mode objfpc and

Mattias

Reply by email