static matchtype_t is_x_match_x(ast_t* operand, ast_t* pattern, errorframe_t* errorf, bool report_reject, pass_opt_t* opt) { if(ast_id(pattern) == TK_DONTCARETYPE) return MATCHTYPE_ACCEPT; switch(ast_id(pattern)) { case TK_UNIONTYPE: return is_x_match_union(operand, pattern, errorf, report_reject, opt); case TK_ISECTTYPE: return is_x_match_isect(operand, pattern, errorf, report_reject, opt); case TK_TUPLETYPE: return is_x_match_tuple(operand, pattern, errorf, report_reject, opt); case TK_NOMINAL: return is_x_match_nominal(operand, pattern, errorf, report_reject, opt); case TK_TYPEPARAMREF: return is_x_match_typeparam(operand, pattern, errorf, report_reject, opt); case TK_ARROW: return is_x_match_arrow(operand, pattern, errorf, report_reject, opt); case TK_FUNTYPE: return MATCHTYPE_DENY; default: {} } pony_assert(0); return MATCHTYPE_DENY; }
matchtype_t is_matchtype(ast_t* operand, ast_t* pattern) { if(ast_id(pattern) == TK_DONTCARE) return MATCHTYPE_ACCEPT; switch(ast_id(pattern)) { case TK_UNIONTYPE: return is_x_match_union(operand, pattern); case TK_ISECTTYPE: return is_x_match_isect(operand, pattern); case TK_TUPLETYPE: return is_x_match_tuple(operand, pattern); case TK_NOMINAL: return is_x_match_nominal(operand, pattern); case TK_TYPEPARAMREF: return is_x_match_typeparam(operand, pattern); case TK_ARROW: return is_x_match_arrow(operand, pattern); case TK_DONTCARE: return MATCHTYPE_ACCEPT; case TK_FUNTYPE: return MATCHTYPE_DENY; default: {} } assert(0); return MATCHTYPE_DENY; }