pike.git / src / las.c

version» Context lines:

pike.git/src/las.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #include "global.h" - RCSID("$Id: las.c,v 1.129 1999/11/23 22:04:17 grubba Exp $"); + RCSID("$Id: las.c,v 1.130 1999/11/24 00:59:11 grubba Exp $");      #include "language.h"   #include "interpret.h"   #include "las.h"   #include "array.h"   #include "object.h"   #include "stralloc.h"   #include "dynamic_buffer.h"   #include "lex.h"   #include "pike_types.h"
pike.git/src/las.c:2116:    fix_type_field(CAR(n));    fix_type_field(CDR(n));    if (!pike_types_le(CAR(n)->type, CDR(n)->type)) {    /* a["b"]=c and a->b=c can be valid when a is an array */    if (CDR(n)->token != F_INDEX && CDR(n)->token != F_ARROW &&    !match_types(CDR(n)->type,CAR(n)->type)) {    my_yyerror("Bad type in assignment.");    } else if (lex.pragmas & ID_STRICT_TYPES) {    struct pike_string *t1 = describe_type(CAR(n)->type);    struct pike_string *t2 = describe_type(CDR(n)->type); + #ifdef PIKE_DEBUG +  if (l_flag > 0) { +  fprintf(stderr, "Warning: Invalid assignment: ");    print_tree(n); -  +  } + #endif /* PIKE_DEBUG */    yywarning("An expression type %s cannot be assigned to "    "a variable of type %s.",    t1->str, t2->str);    free_string(t2);    free_string(t1); -  yywarning("Incompatible types in assignment."); +     }    }    }    n->type = and_pike_types(CAR(n)->type, CDR(n)->type);    break;       case F_INDEX:    case F_ARROW:    if (!CAR(n) || (CAR(n)->type == void_type_string)) {    my_yyerror("Indexing a void expression.");