[analyse] show var/domains if there is no solution (closes #110638)

authorAurelien Campeas <aurelien.campeas@logilab.fr>
changeset00ec1938bb1b
branchdefault
phasedraft
hiddenno
parent revision#e82edc0de3de Add missing comma in utils.KEYWORDS (closes #245563)
child revision<not specified>
files modified by this revision
analyze.py
# HG changeset patch
# User Aurelien Campeas <aurelien.campeas@logilab.fr>
# Date 1352382316 -3600
# Thu Nov 08 14:45:16 2012 +0100
# Node ID 00ec1938bb1ba0af89bc8e85fc8759b6110b1578
# Parent e82edc0de3de12bbeb80675fb0580a48c6383114
[analyse] show var/domains if there is no solution (closes #110638)

diff --git a/analyze.py b/analyze.py
@@ -336,11 +336,13 @@
1 
2          if not sols:
3              rql = node.as_string('utf8', self.kwargs)
4              ex_msg = 'Unable to resolve variables types in "%s"' % (rql,)
5              if True or self.debug:
6 -                ex_msg += '\n%s' % (constraints.get_output(),)
7 +                ex_msg += '\nWith %s\n%s' % (
8 +                    ', '.join(constraints.scons[-2:]),
9 +                    constraints.get_output())
10              raise TypeResolverException(ex_msg)
11          node.set_possible_types(sols, self.kwargs, self.var_solkey)
12 
13      def _visit(self, node, constraints=None):
14          """Recurse down the tree.