Author: Ronan Lamy <[email protected]>
Branch:
Changeset: r86823:30767c452330
Date: 2016-09-01 18:39 +0100
http://bitbucket.org/pypy/pypy/changeset/30767c452330/
Log: Improve error message when attempting to modify annotations in a
fixed graph
diff --git a/rpython/annotator/annrpython.py b/rpython/annotator/annrpython.py
--- a/rpython/annotator/annrpython.py
+++ b/rpython/annotator/annrpython.py
@@ -164,8 +164,13 @@
# annotations that are passed in, and don't annotate the old
# graph -- it's already low-level operations!
for a, s_newarg in zip(block.inputargs, cells):
- s_oldarg = self.binding(a)
- assert annmodel.unionof(s_oldarg, s_newarg) == s_oldarg
+ s_oldarg = a.annotation
+ if not s_oldarg.contains(s_newarg):
+ raise annmodel.AnnotatorError(
+ "Late-stage annotation is not allowed to modify the "
+ "existing annotation for variable %s: %s" %
+ (a, s_oldarg))
+
else:
assert not self.frozen
if block not in self.annotated:
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit