Commit 6e904633 authored by da-woods's avatar da-woods

Fixed cpp_operators (handle type is None)

parent f22704c1
...@@ -657,14 +657,14 @@ class ExprNode(Node): ...@@ -657,14 +657,14 @@ class ExprNode(Node):
def analyse_as_specialized_type(self, env): def analyse_as_specialized_type(self, env):
type = self.analyse_as_type(env) type = self.analyse_as_type(env)
if type.is_fused and env.fused_to_specific: if type and type.is_fused and env.fused_to_specific:
# while it would be nice to test "if entry.type in env.fused_to_specific" # while it would be nice to test "if entry.type in env.fused_to_specific"
# rather than try/catch this doesn't work reliably (mainly for nested fused types) # rather than try/catch this doesn't work reliably (mainly for nested fused types)
try: try:
return type.specialize(env.fused_to_specific) return type.specialize(env.fused_to_specific)
except KeyError: except KeyError:
pass pass
if type.is_fused: if type and type.is_fused:
error(self.pos, "Type is not specific") error(self.pos, "Type is not specific")
return type return type
......
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