Hello,

Taking the following code:

{$mode objfpc}{$h+}
class function tfoo.classmetadata: string;
var
  vmetadatamethod: function: string of object;
begin
  vmetadatamethod := @internalmetadatastr;
  // more code
  Result := vmetadatamethod;
end;

the last assignment doesn't compile, the compiler complains that:

Error: Incompatible types: got "<procedure variable type of
function:AnsiString of object;Register>" expected "AnsiString"

Current 2.2 fixes branch.

If I remove the at operator, this code compiles under $mode delphi.

What can I do to make it work under objfpc?

Thanks.

--
Joao Morais
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to