Author: Ronan Lamy <ronan.l...@gmail.com> Branch: Changeset: r86825:82980a978280 Date: 2016-09-01 23:02 +0100 http://bitbucket.org/pypy/pypy/changeset/82980a978280/
Log: Fix translation and add a warning in annmodel.unionof diff --git a/rpython/annotator/annrpython.py b/rpython/annotator/annrpython.py --- a/rpython/annotator/annrpython.py +++ b/rpython/annotator/annrpython.py @@ -165,7 +165,9 @@ # graph -- it's already low-level operations! for a, s_newarg in zip(block.inputargs, cells): s_oldarg = a.annotation - if not s_oldarg.contains(s_newarg): + # XXX: Should use s_oldarg.contains(s_newarg) but that breaks + # PyPy translation + if annmodel.unionof(s_oldarg, s_newarg) != s_oldarg: raise annmodel.AnnotatorError( "Late-stage annotation is not allowed to modify the " "existing annotation for variable %s: %s" % diff --git a/rpython/annotator/model.py b/rpython/annotator/model.py --- a/rpython/annotator/model.py +++ b/rpython/annotator/model.py @@ -750,6 +750,7 @@ s1 = pair(s1, s2).union() else: # this is just a performance shortcut + # XXX: This is a lie! Grep for no_side_effects_in_union and weep. if s1 != s2: s1 = pair(s1, s2).union() return s1 _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit