Commit 28eebe43 authored by Mark Florisson's avatar Mark Florisson

Fix CVarDefNode's in_pxd flag

parent 359d1c70
......@@ -1074,7 +1074,8 @@ class CVarDefNode(StatNode):
self.dest_scope = dest_scope
base_type = self.base_type.analyse(env)
if base_type.is_fused and (env.is_c_class_scope or env.is_module_scope):
if base_type.is_fused and not self.in_pxd and (env.is_c_class_scope or
env.is_module_scope):
error(self.pos, "Fused types not allowed here")
return error_type
......
......@@ -2734,7 +2734,7 @@ def p_c_func_or_var_declaration(s, pos, ctx):
visibility = ctx.visibility,
base_type = base_type,
declarators = declarators,
in_pxd = ctx.level == 'module_pxd',
in_pxd = ctx.level in ('module_pxd', 'c_class_pxd'),
api = ctx.api,
overridable = ctx.overridable)
return result
......
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