Commit 556f15c6 authored by daniloaf's avatar daniloaf

Fix on constructor call from cimported C++ classes

parent 83949399
......@@ -1049,7 +1049,8 @@ class NewExprNode(AtomicExprNode):
# template_parameters None or [ExprNode] temlate parameters, if any
def infer_type(self, env):
entry = env.lookup(self.cppclass)
cppclass = self.cppclass.analyse_as_type(env)
entry = env.lookup(cppclass.name)
if entry is None or not entry.is_cpp_class:
error(self.pos, "new operator can only be applied to a C++ class")
return
......
......@@ -316,7 +316,11 @@ def p_new_expr(s):
# s.systring == 'new'.
pos = s.position()
s.next()
name = p_ident(s)
node = p_atom(s)
if s.sy == '.':
name = p_trailer(s, node)
else:
name = node
if s.sy == '[':
s.next()
template_parameters = p_simple_expr_list(s)
......
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