1.1 --- a/deducer.py Sun Mar 19 00:16:10 2017 +0100
1.2 +++ b/deducer.py Sun Mar 19 16:08:01 2017 +0100
1.3 @@ -1730,51 +1730,17 @@
1.4
1.5 attrs = self.get_references_for_access(access_location)
1.6
1.7 - # Where no specific attributes are defined, do not attempt
1.8 - # to refine the alias's types.
1.9 -
1.10 - if not attrs:
1.11 - return False
1.12 -
1.13 - # Invocations converting class accessors to instances do not
1.14 - # change the nature of class providers.
1.15 -
1.16 - provider_attrs = self.convert_invocation_providers(attrs, invocation)
1.17 -
1.18 - (class_types, instance_types, module_types, function_types,
1.19 - var_types) = separate_types(provider_attrs)
1.20 -
1.21 - # Where non-accessor types are found, do not attempt to refine
1.22 - # the defined accessor types.
1.23 -
1.24 - if function_types or var_types:
1.25 - return False
1.26 -
1.27 - class_types = set(provider_class_types).intersection(class_types)
1.28 - instance_types = set(provider_instance_types).intersection(instance_types)
1.29 - module_types = set(provider_module_types).intersection(module_types)
1.30 -
1.31 - new_provider_class_types.update(class_types)
1.32 - new_provider_instance_types.update(instance_types)
1.33 - new_provider_module_types.update(module_types)
1.34 -
1.35 - # Accessors are updated separately, employing invocation
1.36 - # result details.
1.37 -
1.38 - accessor_attrs = self.convert_invocations(attrs, invocation)
1.39 -
1.40 - (class_types, instance_types, module_types, function_types,
1.41 - var_types) = separate_types(accessor_attrs)
1.42 -
1.43 - class_types = set(accessor_class_types).intersection(class_types)
1.44 - instance_types = set(accessor_instance_types).intersection(instance_types)
1.45 - module_types = set(accessor_module_types).intersection(module_types)
1.46 -
1.47 - new_accessor_class_types.update(class_types)
1.48 - new_accessor_instance_types.update(instance_types)
1.49 - new_accessor_module_types.update(module_types)
1.50 -
1.51 - refs.update(accessor_attrs)
1.52 + if attrs:
1.53 +
1.54 + # Invocations converting class accessors to instances do
1.55 + # not change the nature of class providers.
1.56 +
1.57 + provider_attrs = self.convert_invocation_providers(attrs, invocation)
1.58 +
1.59 + # Accessors are updated separately, employing invocation
1.60 + # result details.
1.61 +
1.62 + accessor_attrs = self.convert_invocations(attrs, invocation)
1.63
1.64 # Alias references a name, not an access.
1.65
1.66 @@ -1791,35 +1757,41 @@
1.67 provider_attrs = self.get_provider_references(access_location)
1.68 attrs = accessor_attrs = self.get_accessor_references(access_location)
1.69
1.70 - # Where no further information is found, do not attempt to
1.71 - # refine the defined accessor types.
1.72 -
1.73 - if not attrs:
1.74 - return False
1.75 -
1.76 - (class_types, instance_types, module_types, function_types,
1.77 - var_types) = separate_types(provider_attrs)
1.78 -
1.79 - class_types = set(provider_class_types).intersection(class_types)
1.80 - instance_types = set(provider_instance_types).intersection(instance_types)
1.81 - module_types = set(provider_module_types).intersection(module_types)
1.82 -
1.83 - new_provider_class_types.update(class_types)
1.84 - new_provider_instance_types.update(instance_types)
1.85 - new_provider_module_types.update(module_types)
1.86 -
1.87 - (class_types, instance_types, module_types, function_types,
1.88 - var_types) = separate_types(accessor_attrs)
1.89 -
1.90 - class_types = set(accessor_class_types).intersection(class_types)
1.91 - instance_types = set(accessor_instance_types).intersection(instance_types)
1.92 - module_types = set(accessor_module_types).intersection(module_types)
1.93 -
1.94 - new_accessor_class_types.update(class_types)
1.95 - new_accessor_instance_types.update(instance_types)
1.96 - new_accessor_module_types.update(module_types)
1.97 -
1.98 - refs.update(accessor_attrs)
1.99 + # Where no specific attributes are defined, do not attempt
1.100 + # to refine the alias's types.
1.101 +
1.102 + if not attrs:
1.103 + return False
1.104 +
1.105 + (class_types, instance_types, module_types, function_types,
1.106 + var_types) = separate_types(provider_attrs)
1.107 +
1.108 + # Where non-accessor types are found, do not attempt to refine
1.109 + # the defined accessor types.
1.110 +
1.111 + if function_types or var_types:
1.112 + return False
1.113 +
1.114 + class_types = set(provider_class_types).intersection(class_types)
1.115 + instance_types = set(provider_instance_types).intersection(instance_types)
1.116 + module_types = set(provider_module_types).intersection(module_types)
1.117 +
1.118 + new_provider_class_types.update(class_types)
1.119 + new_provider_instance_types.update(instance_types)
1.120 + new_provider_module_types.update(module_types)
1.121 +
1.122 + (class_types, instance_types, module_types, function_types,
1.123 + var_types) = separate_types(accessor_attrs)
1.124 +
1.125 + class_types = set(accessor_class_types).intersection(class_types)
1.126 + instance_types = set(accessor_instance_types).intersection(instance_types)
1.127 + module_types = set(accessor_module_types).intersection(module_types)
1.128 +
1.129 + new_accessor_class_types.update(class_types)
1.130 + new_accessor_instance_types.update(instance_types)
1.131 + new_accessor_module_types.update(module_types)
1.132 +
1.133 + refs.update(accessor_attrs)
1.134
1.135 # Update the alias relationships for invocations.
1.136
1.137 @@ -1868,14 +1840,6 @@
1.138
1.139 attrs = self.get_references_for_access(access_location)
1.140
1.141 - # Where no further information is found, do not attempt to
1.142 - # refine the defined accessor types.
1.143 -
1.144 - if not attrs:
1.145 - return False
1.146 -
1.147 - refs.update(self.convert_invocations(attrs, invocation))
1.148 -
1.149 # Alias references a name, not an access.
1.150
1.151 else:
1.152 @@ -1891,13 +1855,13 @@
1.153 provider_attrs = self.get_provider_references(access_location)
1.154 attrs = accessor_attrs = self.get_accessor_references(access_location)
1.155
1.156 - # Where no further information is found, do not attempt to
1.157 - # refine the defined accessor types.
1.158 -
1.159 - if not attrs:
1.160 - return False
1.161 -
1.162 - refs.update(self.convert_invocations(attrs, invocation))
1.163 + # Where no further information is found, do not attempt to
1.164 + # refine the defined accessor types.
1.165 +
1.166 + if not attrs:
1.167 + return False
1.168 +
1.169 + refs.update(self.convert_invocations(attrs, invocation))
1.170
1.171 # Update the alias relationships for invocations.
1.172