<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 03.11.2015 20:26, Mattias Gaertner
wrote:<br>
</div>
<blockquote cite="mid:20151103202607.18d1d1b7@limapholos.matflo.wg"
type="cite">
<blockquote type="cite" style="color: #000000;">
<pre wrap="">procedure Test;
<span class="moz-txt-citetags">> </span>var
<span class="moz-txt-citetags">> </span> I: Integer;
<span class="moz-txt-citetags">> </span> S: SmallInt;
<span class="moz-txt-citetags">> </span>begin
<span class="moz-txt-citetags">> </span> Res := I + S;
<span class="moz-txt-citetags">> </span>end;
<span class="moz-txt-citetags">> </span>
<span class="moz-txt-citetags">> </span>Something like:
<span class="moz-txt-citetags">> </span>1.)
<span class="moz-txt-citetags">> </span>I = (Integer -> longint)
<span class="moz-txt-citetags">> </span>S = SmallInt
<span class="moz-txt-citetags">> </span>2.)
<span class="moz-txt-citetags">> </span>ResultBasicType = Compare(longint, SmallInt) -> longint -> I
<span class="moz-txt-citetags">> </span>3.)
<span class="moz-txt-citetags">> </span>ResultType = ResultBasicType -> I -> <b class="moz-txt-star"><span class="moz-txt-tag">*</span>Integer<span class="moz-txt-tag">*</span></b>
</pre>
</blockquote>
<pre wrap="">That would fail with the following example:
var
i: SizeInt;
j: SmallInt;
begin
k:=i+j;
end;
The result should be SizeInt, not Integer.
</pre>
</blockquote>
<br>
No, the result will be SizeInt, because (SizeInt -> LongInt) wins
over SmallInt and the result thus will be SizeInt (as the original
type alias of <i><b>i</b></i>) and not Integer.<br>
<br>
A problem could be with such code:<br>
<pre wrap="">var
i: SizeInt;
j: Integer;
begin
k:=i+j;
end;
</pre>
Because obviously on 32bit SizeInt=longint and Integer=longint, so
there won't be a deterministic way which type wins.<br>
<br>
Ondrej<br>
</body>
</html>