pike.git / src / pike_types.cmod

version» Context lines:

pike.git/src/pike_types.cmod:9590:    return 1;    }    free_type(t);    }    return 0;   #else    if (!a) return 0;       add_ref(a);    -  while (a && b && -  ((b->type == T_FUNCTION) || -  ((b->type == T_MANY) && (b->car != void_type_string) && -  (a->type == T_FUNCTION)))) { -  struct pike_type *cont = low_new_check_call(a, b->car, 0, NULL); +  push_type(PIKE_T_UNKNOWN); +  +  do { +  struct pike_type *cont; +  +  if (!b || b->type == T_MANY || +  (b->car && (b->car->flags & PT_FLAG_VOIDABLE))) { +  struct pike_type *tmp = new_get_return_type(a, 0); +  if (tmp) { +  push_finished_type(tmp); +  push_type(T_OR); +  +  free_type(tmp); +  } +  +  if (!b || !b->car || +  ((b->type == T_MANY) && (b->car == void_type_string))) { +  break; +  } +  } +  + #ifdef PIKE_DEBUG +  if ((b->type != T_MANY) && (b->type != T_FUNCTION)) { +  Pike_fatal("Invalid argument type to check_call().\n"); +  } + #endif +  +  cont = low_new_check_call(a, b->car, 0, NULL);    free_type(a);    a = cont; -  if (b->type == T_FUNCTION) b = b->cdr; -  } +     -  if (!a) return 0; +  if (!a) break;    -  b = new_get_return_type(a, 0); +  if (b->type == T_FUNCTION) b = b->cdr; +  } while(1); +  +  if (a) {    free_type(a);    -  if (b) { -  push_finished_type(b); -  free_type(b); +  if (peek_type_stack()) {    return 1;    } -  +  } +  +  compiler_discard_top_type();    return 0;   #endif   }         int match_types(struct pike_type *a, struct pike_type *b)   {    struct pike_type *res;   #ifdef PIKE_EXTRA_DEBUG    struct remap_state remap;