<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Another question that never got answered. Yet I would expect, that
    either it is implemented with intend, then someone must know. <br>
    Or it is a bug then that should be checked? <br>
    <br>
    If no one knows, shall I assume it is a bug, and report it?<br>
    <br>
    <div class="moz-forward-container"><br>
      -------- Original Message --------
      <table class="moz-email-headers-table" border="0" cellpadding="0"
        cellspacing="0">
        <tbody>
          <tr>
            <th valign="BASELINE" align="RIGHT" nowrap="nowrap">Subject:
            </th>
            <td>[fpc-devel] override works, even if result type changed?</td>
          </tr>
          <tr>
            <th valign="BASELINE" align="RIGHT" nowrap="nowrap">Date: </th>
            <td>Sun, 23 Feb 2014 16:56:26 +0000</td>
          </tr>
          <tr>
            <th valign="BASELINE" align="RIGHT" nowrap="nowrap">From: </th>
            <td>Martin Frb <a class="moz-txt-link-rfc2396E" href="mailto:lazarus@mfriebe.de"><lazarus@mfriebe.de></a></td>
          </tr>
          <tr>
            <th valign="BASELINE" align="RIGHT" nowrap="nowrap">Reply-To:
            </th>
            <td>FPC developers' list
              <a class="moz-txt-link-rfc2396E" href="mailto:fpc-devel@lists.freepascal.org"><fpc-devel@lists.freepascal.org></a></td>
          </tr>
          <tr>
            <th valign="BASELINE" align="RIGHT" nowrap="nowrap">To: </th>
            <td>FPC developers' list
              <a class="moz-txt-link-rfc2396E" href="mailto:fpc-devel@lists.freepascal.org"><fpc-devel@lists.freepascal.org></a></td>
          </tr>
        </tbody>
      </table>
      <br>
      <br>
      <pre>Just found that the below works.

Note, that the result type of "a" (overridden) is different.
Well, TFoo2 will always satisfy the needs of TFoo, so it seems save. I 
still found it surprising. Is it intended?


program Project1;
type
  TFoo= class
  public
    function a: TFoo; virtual;
  end;

  TFoo2= class(TFoo)
  public
    function a: TFoo2; override;
  end;

function TFoo2.a: TFoo2;
begin
end;

function TFoo.a: TFoo;
begin
end;

begin
end.

_______________________________________________
fpc-devel maillist  -  <a class="moz-txt-link-abbreviated" href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel</a>
</pre>
      <br>
    </div>
    <br>
  </body>
</html>