static bool method_application(pass_opt_t* opt, ast_t* ast, bool partial) { AST_GET_CHILDREN(ast, positional, namedargs, lhs); if(!check_type_params(opt, &lhs)) return false; ast_t* type = ast_type(lhs); if(is_typecheck_error(type)) return false; AST_GET_CHILDREN(type, cap, typeparams, params, result); if(!extend_positional_args(opt, params, positional)) return false; if(!apply_named_args(opt, params, positional, namedargs)) return false; if(!check_arg_types(opt, params, positional, partial)) return false; switch(ast_id(lhs)) { case TK_FUNREF: case TK_FUNAPP: if(!check_receiver_cap(opt, ast, NULL)) return false; if(!check_nonsendable_recover(opt, ast)) return false; break; default: {} } return true; }
static bool method_application(pass_opt_t* opt, ast_t* ast, bool partial) { // TODO: use args to decide unbound type parameters AST_GET_CHILDREN(ast, positional, namedargs, lhs); if(!check_type_params(&lhs)) return false; ast_t* type = ast_type(lhs); if(is_typecheck_error(type)) return false; AST_GET_CHILDREN(type, cap, typeparams, params, result); if(!extend_positional_args(params, positional)) return false; if(!apply_named_args(params, positional, namedargs)) return false; bool incomplete = is_this_incomplete(&opt->check, ast); if(!check_arg_types(opt, params, positional, incomplete, partial)) return false; switch(ast_id(lhs)) { case TK_FUNREF: case TK_FUNAPP: if(!check_receiver_cap(ast, incomplete)) return false; break; default: {} } return true; }