1.1 --- a/deducer.py Sun Mar 12 18:03:25 2017 +0100
1.2 +++ b/deducer.py Sun Mar 12 18:04:08 2017 +0100
1.3 @@ -1775,8 +1775,13 @@
1.4
1.5 "Convert 'ref' to a provider appropriate to its invocation result."
1.6
1.7 - if ref and ref.has_kind("<class>"):
1.8 - return ref
1.9 + if ref:
1.10 + if ref.has_kind("<class>"):
1.11 + return ref
1.12 + elif ref.has_kind("<function>"):
1.13 + refs = self.importer.all_return_values.get(ref.get_origin())
1.14 + if refs and len(refs) == 1:
1.15 + return first(refs)
1.16
1.17 return Reference("<var>")
1.18
1.19 @@ -1793,8 +1798,13 @@
1.20
1.21 "Convert 'ref' to its invocation result."
1.22
1.23 - if ref and ref.has_kind("<class>"):
1.24 - return ref.instance_of()
1.25 + if ref:
1.26 + if ref.has_kind("<class>"):
1.27 + return ref.instance_of()
1.28 + elif ref.has_kind("<function>"):
1.29 + refs = self.importer.all_return_values.get(ref.get_origin())
1.30 + if refs and len(refs) == 1:
1.31 + return first(refs)
1.32
1.33 return Reference("<var>")
1.34