<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2014-04-15 17:21 GMT+08:00 Sven Barth <span dir="ltr"><<a href="mailto:pascaldragon@googlemail.com" target="_blank">pascaldragon@googlemail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><p>Am 15.04.2014 08:47 schrieb "Xiangrong Fang" <<a href="mailto:xrfang@gmail.com" target="_blank">xrfang@gmail.com</a>>:</p>
<div>
> It's good to know that it works, at least in 2.7.1. Â I will report the problem again while I start using 2.7.1 or when it is released as 2.8 :-)</div><p></p>
<p>That's the point: I don't know wether it compiles in 2.7.1 as I did not test it. If you could provide a minimal sample (which fails in 2.6.2) and report that as a bug I could ensure that 2.7.1 works correctly there.</p>
</blockquote><div><br></div><div class="gmail_default" style="font-family:'courier new',monospace">​I cannot replicate the problem using a minimal program, because it gives out different error message.  The following minimal program compiles OK:</div>
<div class="gmail_default" style="font-family:'courier new',monospace"><br></div><div class="gmail_default"><div class="gmail_default"><font face="courier new, monospace">program vectr;</font></div><div class="gmail_default">
<font face="courier new, monospace">type</font></div><div class="gmail_default"><font face="courier new, monospace">Â generic TGeneric1<T> = class</font></div><div class="gmail_default"><font face="courier new, monospace"><br>
</font></div><div class="gmail_default"><font face="courier new, monospace">Â end;</font></div><div class="gmail_default"><font face="courier new, monospace">Â generic TGeneric2<T> = class</font></div><div class="gmail_default">
<font face="courier new, monospace"><br></font></div><div class="gmail_default"><font face="courier new, monospace">Â end;</font></div><div class="gmail_default"><font face="courier new, monospace">Â TSpec1 = specialize TGeneric1<Integer>;</font></div>
<div class="gmail_default"><font face="courier new, monospace">Â TSpec2 = specialize TGeneric2<TSpec1>;</font></div><div class="gmail_default"><font face="courier new, monospace">begin</font></div><div class="gmail_default">
<font face="courier new, monospace">end.</font></div><div class="gmail_default"><font face="courier new, monospace"><br></font></div><div class="gmail_default"><font face="courier new, monospace">While the following program generate different error:</font></div>
</div><div class="gmail_default" style="font-family:'courier new',monospace"><br></div><div class="gmail_default"><font face="courier new, monospace">program vectr;</font></div><div class="gmail_default">
<font face="courier new, monospace">uses</font></div><div class="gmail_default"><font face="courier new, monospace">Â treap, vector;</font></div><div class="gmail_default"><font face="courier new, monospace">type</font></div>
<div class="gmail_default"><font face="courier new, monospace">Â TNodeHash = specialize TTreap<Integer, string>;</font></div><div class="gmail_default"><font face="courier new, monospace">Â TNodeVector = class(specialize TVector<TNodeHash>)</font></div>
<div class="gmail_default"><font face="courier new, monospace">Â protected</font></div><div class="gmail_default"><font face="courier new, monospace">Â Â function OnSort(v1, v2: T): Integer; override;</font></div>
<div class="gmail_default"><font face="courier new, monospace">Â end;</font></div><div class="gmail_default"><font face="courier new, monospace"><br></font></div><div class="gmail_default"><font face="courier new, monospace">operator <(nh1, nh2: TNodeHash): Boolean;</font></div>
<div class="gmail_default"><font face="courier new, monospace">begin</font></div><div class="gmail_default"><font face="courier new, monospace">Â Result := nh1.Count < nh2.Count;</font></div><div class="gmail_default">
<font face="courier new, monospace">end;</font></div><div class="gmail_default"><font face="courier new, monospace">operator >(nh1, nh2: TNodeHash): Boolean;</font></div><div class="gmail_default"><font face="courier new, monospace">begin</font></div>
<div class="gmail_default"><font face="courier new, monospace">Â Result := nh1.Count > nh2.Count;</font></div><div class="gmail_default"><font face="courier new, monospace">end;</font></div><div class="gmail_default">
<font face="courier new, monospace"><br></font></div><div class="gmail_default"><font face="courier new, monospace">function TNodeVector.OnSort(v1, v2: T): Integer;</font></div><div class="gmail_default"><font face="courier new, monospace">begin</font></div>
<div class="gmail_default"><font face="courier new, monospace">Â Result := 0;</font></div><div class="gmail_default"><font face="courier new, monospace">end;</font></div><div class="gmail_default"><font face="courier new, monospace"><br>
</font></div><div class="gmail_default"><font face="courier new, monospace">begin</font></div><div class="gmail_default"><font face="courier new, monospace">end.   </font><span style="font-family:'courier new',monospace">​</span></div>
<div class="gmail_default"><span style="font-family:'courier new',monospace"><br></span></div><div class="gmail_default"><span style="font-family:'courier new',monospace">gives error message:</span></div>
<div class="gmail_default"><span style="font-family:'courier new',monospace"><br></span></div><div class="gmail_default"><div class="gmail_default"><span style="font-family:'courier new',monospace">vector.pas(149,9) Error: Operator is not overloaded: "TTreap$LongInt$AnsiString" < "TTreap$LongInt$AnsiString"</span><br>
</div><div class="gmail_default"><font face="courier new, monospace">vector.pas(151,14) Error: Operator is not overloaded: "TTreap$LongInt$AnsiString" > "TTreap$LongInt$AnsiString"</font></div>
<div class="gmail_default"><font face="courier new, monospace">vectr.lpr(28) Fatal: There were 2 errors compiling module, stopping</font></div><div style="font-family:'courier new',monospace"><br></div><div style="font-family:'courier new',monospace">
The two used units can be downloaded here:</div><div style="font-family:'courier new',monospace"><br></div><div><font face="courier new, monospace"><a href="https://github.com/xrfang/fpcollection/" target="_blank">https://github.com/xrfang/fpcollection/</a></font><br>
</div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">While in my real program, I have this:</font></div><div><font face="courier new, monospace"><br></font></div>
<div><font face="courier new, monospace"><div>type</div><div>Â TCmhWaves = specialize TVector<TCmhWave>; Â Â Â Â Â Â Â </div><div><br></div><div>The thing is, even if I do NOT use this definition at all, it still crashes the compiler. Â By "crash" I mean I get this from lazarus:</div>
<div><br></div><div><div>Compiling wmodel.lError: /usr/bin/ppcx64 can't be executed, error message: Failed to execute "/usr/bin/ppcx64", error code: -139</div><div><br></div></div><div>TCmhWave is a specialized subclass of My TTreap class (also on github), it does NOT overload the < and > operators either. Â </div>
<div><br></div><div>So my question is:</div><div><br></div><div>1) why my simplified example still require overloaded operator, although I have already done so? </div><div><br></div><div>2) If this is the cause of error (TCmhWave does not have these operators defined), why the compiler returns error code: -139 instead of more detailed errors?</div>
<div><br></div><div>BTW, on my first attempt to debug this problem in lazbuild (command line) I get some error related to VMA, but unfortunately I forgot what it is and cannot get it shown again. Is there any way to customize the lazbuild by some switches to let it output more messages?</div>
<div><br></div><div>Thanks.</div></font></div><div style="font-family:'courier new',monospace"><br></div><div style="font-family:'courier new',monospace"><br></div><div style="font-family:'courier new',monospace">
<br></div><div style="font-family:'courier new',monospace"><br></div></div></div></div></div>