1.1 --- a/micropython/report.py Thu Nov 15 22:27:44 2012 +0100
1.2 +++ b/micropython/report.py Fri Nov 16 00:29:15 2012 +0100
1.3 @@ -1059,6 +1059,7 @@
1.4 if not possible_types:
1.5 possible_types = self._get_possible_types(node.attrname)
1.6
1.7 + self.record_unknown_targets(possible_types, deduced, node)
1.8 attributes = self._get_attributes(possible_types, node.attrname)
1.9
1.10 wraps_getattr = self._has_descendant(node.expr, compiler.ast.Getattr)
1.11 @@ -1165,6 +1166,7 @@
1.12 if not possible_types:
1.13 possible_types = self._get_possible_types(node.attrname)
1.14
1.15 + self.record_unknown_targets(possible_types, deduced, node)
1.16 attributes = self._get_attributes(possible_types, node.attrname)
1.17
1.18 wraps_getattr = self._has_descendant(node.expr, compiler.ast.Getattr)
1.19 @@ -1457,10 +1459,13 @@
1.20 # Statistics gathering methods.
1.21
1.22 def possible_accessor_types(self, node, defining_users=1):
1.23 - possible_types = set([tn for (tn, st) in ASTVisitor.possible_accessor_types(self, node, defining_users)])
1.24 + return set([tn for (tn, st) in ASTVisitor.possible_accessor_types(self, node, defining_users)])
1.25 +
1.26 + def record_unknown_targets(self, possible_types, deduced, node):
1.27 if not possible_types:
1.28 self.program.unknown_target_nodes.append((self.units[-1], node))
1.29 - return possible_types
1.30 + elif not deduced:
1.31 + self.program.independent_target_nodes.append((self.units[-1], node))
1.32
1.33 # Utility methods.
1.34