Commit 879774e5 authored by da-woods's avatar da-woods

Removed try-catch

parent 073f25c1
...@@ -1962,10 +1962,9 @@ class NameNode(AtomicExprNode): ...@@ -1962,10 +1962,9 @@ class NameNode(AtomicExprNode):
entry = env.lookup(self.name) entry = env.lookup(self.name)
if entry and entry.is_type: if entry and entry.is_type:
if entry.type.is_fused and env.fused_to_specific: if entry.type.is_fused and env.fused_to_specific:
try: if entry.type in env.fused_to_specific:
return entry.type.specialize(env.fused_to_specific) return entry.type.specialize(env.fused_to_specific)
except KeyError: # else lots of valid reasons why we may not be able to get a specific type
pass # lots of valid reasons why we may not be able to get a specific type
# so don't fail # so don't fail
return entry.type return entry.type
else: else:
...@@ -6916,10 +6915,9 @@ class AttributeNode(ExprNode): ...@@ -6916,10 +6915,9 @@ class AttributeNode(ExprNode):
if base_type and hasattr(base_type, 'scope') and base_type.scope is not None: if base_type and hasattr(base_type, 'scope') and base_type.scope is not None:
tp = base_type.scope.lookup_type(self.attribute) tp = base_type.scope.lookup_type(self.attribute)
if tp and tp.is_fused and env.fused_to_specific: if tp and tp.is_fused and env.fused_to_specific:
try: if tp in env.fused_to_specific:
tp = tp.specialize(env.fused_to_specific) tp = tp.specialize(env.fused_to_specific)
except KeyError: # else just use unspecialized type
pass # just use unspecialized type
return tp return tp
def analyse_as_extension_type(self, env): def analyse_as_extension_type(self, env):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment