1.1 --- a/deducer.py Mon Mar 13 17:59:13 2017 +0100
1.2 +++ b/deducer.py Tue Mar 14 16:40:04 2017 +0100
1.3 @@ -1864,9 +1864,7 @@
1.4 if ref.has_kind("<class>"):
1.5 return ref
1.6 elif ref.has_kind("<function>"):
1.7 - refs = self.importer.all_return_values.get(ref.get_origin())
1.8 - if refs and len(refs) == 1:
1.9 - return first(refs)
1.10 + return self.convert_function_invocation(ref)
1.11
1.12 return Reference("<var>")
1.13
1.14 @@ -1887,9 +1885,19 @@
1.15 if ref.has_kind("<class>"):
1.16 return ref.instance_of()
1.17 elif ref.has_kind("<function>"):
1.18 - refs = self.importer.all_return_values.get(ref.get_origin())
1.19 - if refs and len(refs) == 1:
1.20 - return first(refs)
1.21 + return self.convert_function_invocation(ref)
1.22 +
1.23 + return Reference("<var>")
1.24 +
1.25 + def convert_function_invocation(self, ref):
1.26 +
1.27 + "Convert the function 'ref' to its return value reference."
1.28 +
1.29 + initialised_names = self.importer.all_initialised_names.get((ref.get_origin(), "$return"))
1.30 + if initialised_names:
1.31 + refs = set(initialised_names.values())
1.32 + if len(refs) == 1:
1.33 + return first(refs)
1.34
1.35 return Reference("<var>")
1.36