Hi pypy !<br><br>I hit an assert in pypy/annotation/annrpython.py in addpendingblock line 231 : assert annmodel.unionof(s_oldarg, s_newarg) == s_oldarg<br><br>I think I found an explanation by digging in code :<br><br>The treated block is in the "ll_delitem_nonneg" function, <br>
s_newarg is a "SomeInteger(nonneg=True)" and s_oldarg is a "SomeInteger(nonneg=False)"<br>and in fact they are the "index" argument of this function.<br><br><br>oldarg comes from a previous annotation using the "rtype_method_remove" of rlist.py.<br>
"rtype_method_remove" use "ll_listremove" which use :<br>ll_delitem_nonneg(..., ll_listindex(...))<br>Looking at ll_listindex, it seems clear that the index can be proved as always positive.<br>That's probably why s_oldarg is a "SomeInteger(nonneg=True)"<br>
<br><br>The new annotation comes from the method "rtype_delitem" (class __extend__ in rlist.py).<br>the index from hop is always positive, so the code :<br>if hop.args_s[1].nonneg:<br> llfn = ll_delitem_nonneg<br>
select "ll_delitem_nonneg" as the deletion function.<br>But the index given to the annotator is taken from :<br>v_lst, v_index = hop.inputargs(r_lst, Signed)<br>v_index is a "Signed"<br>The information concerning the "non negative" property of the index integer is lost here.<br>
index is now "SomeInteger(nonneg=False)" and trigs the assert.<br><br><br>What do you think ?<br><br>Zariko.<br>