callee = new_callee;
}
- if (!calling_a_macro) call->callee = callee;
-
// NOTE: Build callee's type
fill_in_type((AstTyped *) callee);
if (callee->type == NULL) {
YIELD(call->token->pos, "Trying to resolve function type for callee.");
}
+ if (!calling_a_macro) call->callee = callee;
+
if (callee->type->kind != Type_Kind_Function) {
ERROR_(call->token->pos,
"Attempting to call something that is not a function, '%b'.",
// 9. Check types of formal and actual params against each other, handling varargs
AstCall* call = *pcall;
- {
+ if (call->kind == Ast_Kind_Call) {
AstNode* callee = strip_aliases((AstNode *) call->callee);
if (callee->kind == Ast_Kind_Poly_Struct_Type) {
// HACK HACK HACK
case Ast_Kind_Binary_Op: retval = check_binaryop((AstBinaryOp **) pexpr); break;
case Ast_Kind_Unary_Op: retval = check_unaryop((AstUnaryOp **) pexpr); break;
+ case Ast_Kind_Intrinsic_Call:
case Ast_Kind_Call: retval = check_call((AstCall **) pexpr); break;
case Ast_Kind_Argument: retval = check_argument((AstArgument **) pexpr); break;
case Ast_Kind_Block: retval = check_block((AstBlock *) expr); break;
case Ast_Kind_Unary_Field_Access: break;
case Ast_Kind_Constraint_Sentinel: break;
- // NOTE: The only way to have an Intrinsic_Call node is to have gone through the
- // checking of a call node at least once.
- case Ast_Kind_Intrinsic_Call: break;
-
default:
retval = Check_Error;
onyx_report_error(expr->token->pos, Error_Critical, "UNEXPECTED INTERNAL COMPILER ERROR");
node = onyx_ast_node_new(context.ast_alloc, sizeof(AstTypeRawAlias), Ast_Kind_Type_Raw_Alias);
((AstTypeRawAlias *) node)->token = sln->poly_sym->token;
((AstTypeRawAlias *) node)->to = sln->type;
+ ((AstTypeRawAlias *) node)->type = &basic_types[Basic_Kind_Type_Index];
+ ((AstTypeRawAlias *) node)->type_id = sln->type->id;
break;
case PSK_Value: