<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">PING<br>
<br>
On 08/02/2014 19:38, Martin Frb wrote:<br>
</div>
<blockquote cite="mid:52F687C6.2060300@mfriebe.de" type="cite">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
Below works with 2.6.2 but not with trunk<br>
<br>
Is that indented?<br>
</blockquote>
<br>
Surely someone knows, if that is intended?<br>
<br>
<blockquote cite="mid:52F687C6.2060300@mfriebe.de" type="cite"> <br>
the wiki says<br>
<blockquote type="cite">
<h4> <span class="mw-headline"
id="Default_values_are_now_properly_typechecked"> Default
values are now properly typechecked </span></h4>
<ul>
<li> <b>Old behaviour</b>: The compiler did not detect
default values for parameters of which the type did not in
any way correspond to the parameter type. </li>
<li> <b>New behaviour</b>: The compiler now properly checks
whether the type of the constant matches the parameter's
type when parsing default values. </li>
<li> <b>Reason</b>: Proper type checking is one of the
fundamental properties of the Pascal language; Delphi
compatibility. </li>
<li> <b>Remedy</b>: Add a typecast around default values that
now result in compiler errors, or correct the type of such
parameters. </li>
</ul>
</blockquote>
<br>
"did not in any way correspond to the parameter type"<br>
it does through the overloaded operator, doesn't it?<br>
<br>
Also "add a typecast" (despite that would mean the overloaded
operator isn't called),<br>
the following<br>
procedure Test(a:TObject=TObject(1));<br>
gives<br>
project1.lpr(6,36) Error: Illegal expression<br>
even though 1 can be typecasted into an TObject.<br>
<br>
<br>
<br>
program project1;<br>
operator := (a:integer) b: TObject;<br>
begin<br>
b:= TObject.Create;<br>
end;<br>
procedure Test(a:TObject=1);<br>
begin<br>
end;<br>
begin<br>
Test;<br>
end.<br>
<br>
</blockquote>
<br>
</body>
</html>