pike.git / src / pike_types.c

version» Context lines:

pike.git/src/pike_types.c:6762:   {    struct pike_type *res = NULL;    struct pike_type *tmp;    struct pike_type *tmp2;    loop:    /* Get rid of the array levels. */    while(fun_type->type == PIKE_T_ARRAY) {    fun_type = fun_type->car;    }    + #ifdef PIKE_DEBUG +  if (l_flag > 2) { +  fprintf(stderr, "get_first_arg_type("); +  simple_describe_type(fun_type); +  fprintf(stderr, ", 0x%04x)\n", flags); +  } + #endif +     switch(fun_type->type) {    case PIKE_T_SCOPE:    case T_ASSIGN:    case PIKE_T_NAME:    case PIKE_T_ATTRIBUTE:    case PIKE_T_RING:    fun_type = fun_type->cdr;    goto loop;       case T_OR:
pike.git/src/pike_types.c:6805:    * ==>    * string | string|int    *    * This is however not true in the case where neither is inverted:    *    * function(attribute(sprintf_args, mixed)...:string) &    * function(object|string:string)    * ==>    * attribute(sprintf_args, mixed) & object|string    */ -  if ((fun_type->car->type == T_NOT) == (fun_type->cdr->type == T_NOT)) { +  if (!(flags & CALL_NOT_LAST_ARG) || +  ((fun_type->car->type == T_NOT) == (fun_type->cdr->type == T_NOT))) {    res = and_pike_types(tmp2 = res, tmp);    } else {    res = or_pike_types(tmp2 = res, tmp, 1);    }    free_type(tmp);    free_type(tmp2);    break;    case T_NOT:    if (!(res = get_first_arg_type(fun_type->car, flags))) {    break;
pike.git/src/pike_types.c:6865:    * Failed to lookup program id.    * Program does not have the lfun `()().    */       /* FALL_THROUGH */    case PIKE_T_MIXED:    copy_pike_type(res, mixed_type_string);    break;       case PIKE_T_FUNCTION: +  if (!(flags & CALL_NOT_LAST_ARG) && +  (fun_type->cdr->type == PIKE_T_FUNCTION) && +  !low_match_types(fun_type->cdr->car, void_type_string, 0)) { +  /* Last argument and more arguments required. */ +  res = NULL; +  break; +  } +  /* FALL_THROUGH */    case T_MANY:    if ((res = fun_type->car)->type == T_VOID) {    res = NULL;    break;    }    res = low_get_first_arg_type(res, 0);    break;       default:    /* Not a callable. */    break;    }    -  + #ifdef PIKE_DEBUG +  if (l_flag > 2) { +  fprintf(stderr, "get_first_arg_type("); +  simple_describe_type(fun_type); +  fprintf(stderr, ", 0x%04x) ==> ", flags); +  simple_describe_type(res); +  fprintf(stderr, "\n"); +  } + #endif +     return res;   }      /* NOTE: fun_type loses a reference. */   struct pike_type *check_splice_call(struct pike_string *fun_name,    struct pike_type *fun_type,    INT32 argno,    struct pike_type *arg_type,    struct svalue *sval,    INT32 flags)