pike.git / src / las.c

version» Context lines:

pike.git/src/las.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: las.c,v 1.391 2007/05/04 18:35:18 grubba Exp $ + || $Id: las.c,v 1.392 2007/09/06 13:24:01 grubba Exp $   */      #include "global.h"   #include "interpret.h"   #include "las.h"   #include "array.h"   #include "object.h"   #include "stralloc.h"   #include "dynamic_buffer.h"   #include "lex.h"
pike.git/src/las.c:3723: Inside #if defined(NEW_ARG_CHECK)
   if (CAR(n) && CAR(n)->type) {   #ifdef NEW_ARG_CHECK    struct pike_type *soft_type = NULL;    if (CDR(n) && (CDR(n)->token == F_CONSTANT) &&    (CDR(n)->u.sval.type == T_TYPE)) {    soft_type = CDR(n)->u.sval.u.type;    if ((n->type = soft_cast(soft_type, CAR(n)->type, 0))) {    /* Success. */    break;    } -  struct pike_string *t1 = describe_type(CAR(n)->type); -  struct pike_string *t2 = describe_type(soft_type); +  struct pike_string *t1 = describe_type(soft_type); +  struct pike_string *t2 = describe_type(CAR(n)->type);    my_yyerror("Soft cast of %S to %S isn't a valid cast.",    t2, t1);    free_string(t2);    free_string(t1);    } else {    yytype_error("Soft cast with non-type.",    type_type_string,    CDR(n)->type, 0);    }    /* Failure: Fall through to the old code. */
pike.git/src/las.c:4002: Inside #if defined(NEW_ARG_CHECK)
   break;    }       /* Too few arguments or similar. */    copy_pike_type(n->type, mixed_type_string);       if ((s = get_first_arg_type(dmalloc_touch(struct pike_type *, f), 0))) {    my_yyerror("Too few arguments to %S (got %d).", name, args);    yytype_error(NULL, s, NULL, 0);    free_type(s); +  yytype_error("Function type:", CAR(n)->type, NULL, 0); +  yytype_error("Remaining type:", f, NULL, 0);    } else { -  my_yyerror("Type checking error for function call to %S.", name); -  yytype_error(NULL, NULL, f, 0); +  my_yyerror("Attempt to call a non function value %S.", name); +  yytype_error(NULL, function_type_string, f, 0);    }    free_type(f);    break;   #else /* !NEW_ARG_CHECK */       push_type(T_MIXED); /* match any return type */    push_type(T_VOID); /* even void */    push_type(T_OR);       push_type(T_VOID); /* not varargs */