<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello!<br>
<br>
In Delphi it is valid to assign a static class procedure to a
procedure variable:<br>
<br>
<tt>program project1;</tt><tt><br>
</tt><tt><br>
</tt><tt>type</tt><tt><br>
</tt><tt> TMyObject = class</tt><tt><br>
</tt><tt> public</tt><tt><br>
</tt><tt> class procedure Proc; static;</tt><tt><br>
</tt><tt> end;</tt><tt><br>
</tt><tt><br>
</tt><tt> TProc = procedure();</tt><tt><br>
</tt><tt><br>
</tt><tt>class procedure TMyObject.Proc;</tt><tt><br>
</tt><tt>begin</tt><tt><br>
</tt><tt><br>
</tt><tt>end;</tt><tt><br>
</tt><tt><br>
</tt><tt><tt>var</tt><tt><br>
</tt><tt> xProc: TProc;</tt><tt><br>
</tt>begin</tt><tt><br>
</tt><b><tt> xProc := @TMyObject.Proc;</tt></b><b><tt><br>
</tt></b><tt>end.</tt><tt><br>
</tt><br>
(In Delphi just without the @ operator, obviously.)<br>
<br>
In FPC 3.1.1 (trunk) I get the following error:<br>
<br>
project1.lpr(22,12) Error: Incompatible types: got "<class method
type of procedure of object;Register>" expected "<procedure
variable type of procedure;Register>"<br>
<br>
Why? Can it be achieved somehow (compiler settings)?<br>
<br>
Ondrej<br>
</body>
</html>