<p>I know it is same but why no error on the line:</p>
<p>for n in sm1.reversed...</p>
<p>regards.</p>
<div class="gmail_quote">在 2013-9-24 下午11:23,"Sven Barth" <<a href="mailto:pascaldragon@googlemail.com">pascaldragon@googlemail.com</a>>写道:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <div>Am <a href="tel:24.09.2013%2017" value="+12409201317" target="_blank">24.09.2013 17</a>:14, schrieb Xiangrong
      Fang:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">2013/9/24 Sven Barth <span dir="ltr"><<a href="mailto:pascaldragon@googlemail.com" target="_blank">pascaldragon@googlemail.com</a>></span><br>
            <div> </div>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
              <div text="#000000" bgcolor="#FFFFFF">How is PNode
                declared? What is the exact error?<br>
              </div>
              <br>
            </blockquote>
            <div><br>
            </div>
            <div>PNode is declared inside TTreap generic class, the
              source is here:<br>
              <br>
              <a href="https://github.com/xrfang/fpcollection/blob/master/src/units/treap.pas" target="_blank">https://github.com/xrfang/fpcollection/blob/master/src/units/treap.pas</a>
              <br>
              <br>
            </div>
            <div>The exact error is:<br>
              <br>
              Error: Incompatible types: got
              "TStringMapper.TTreap$AnsiString$AnsiString" expected
              "TStringMapper"<br>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    The error is exactly the same as the one in your TIntTree, because
    the return type of TTreap<String, String>.Reversed is
    TTreap<String, String> and nothing else. Thus the solution is
    the same as for TIntTree.Next: either none or a new "Reversed"
    function. And again: This problem would also occur with non generic
    classes.<br>
    <br>
    Regards,<br>
    Sven<br>
  </div>

<br>_______________________________________________<br>
fpc-pascal maillist  -  <a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/mailman/listinfo/fpc-pascal</a><br></blockquote></div>