void FunctionResolver::visit(FunctionCall &call)
{
- string arg_types;
- bool has_signature = true;
- for(NodeArray<Expression>::const_iterator i=call.arguments.begin(); (has_signature && i!=call.arguments.end()); ++i)
- {
- if((*i)->type)
- append(arg_types, ",", (*i)->type->name);
- else
- has_signature = false;
- }
-
FunctionDeclaration *declaration = 0;
- if(has_signature)
+ if(stage->types.count(call.name))
+ call.constructor = true;
+ else
{
- map<string, FunctionDeclaration *>::iterator i = stage->functions.find(format("%s(%s)", call.name, arg_types));
- declaration = (i!=stage->functions.end() ? i->second : 0);
+ string arg_types;
+ bool has_signature = true;
+ for(NodeArray<Expression>::const_iterator i=call.arguments.begin(); (has_signature && i!=call.arguments.end()); ++i)
+ {
+ if((*i)->type)
+ append(arg_types, ",", (*i)->type->name);
+ else
+ has_signature = false;
+ }
+
+ if(has_signature)
+ {
+ map<string, FunctionDeclaration *>::iterator i = stage->functions.find(format("%s(%s)", call.name, arg_types));
+ declaration = (i!=stage->functions.end() ? i->second : 0);
+ }
}
+
r_any_resolved |= (declaration!=call.declaration);
call.declaration = declaration;
{
RefPtr<FunctionCall> call = create_node<FunctionCall>();
call->name = var.name;
- call->constructor = is_type(call->name);
call->oper = &Operator::get_operator("(", Operator::POSTFIX);
tokenizer.expect("(");
while(tokenizer.peek_token()!=")")