Branch: Tag:

2003-11-18

2003-11-18 11:19:42 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Some type checking relaxations, and improved diagnostics.

Rev: src/pike_types.c:1.227
Rev: src/program.c:1.535
Rev: src/program.h:1.191

2:   || 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: pike_types.c,v 1.226 2003/11/12 15:47:41 grubba Exp $ + || $Id: pike_types.c,v 1.227 2003/11/18 11:19:41 grubba Exp $   */      #include "global.h" - RCSID("$Id: pike_types.c,v 1.226 2003/11/12 15:47:41 grubba Exp $"); + RCSID("$Id: pike_types.c,v 1.227 2003/11/18 11:19:41 grubba Exp $");   #include <ctype.h>   #include "svalue.h"   #include "pike_types.h"
80:      static struct program *implements_a;   static struct program *implements_b; + static int implements_mode;      #ifdef PIKE_DEBUG   void TYPE_STACK_DEBUG(const char *fun)
2653:       if(!ap || !bp) break;    +  implements_mode = 0;    if (!is_compatible(implements_a=ap,implements_b=bp))    return 0;    }
3196:    return 0;    }    if ((flags & LE_WEAK_OBJECTS) /* && (!a->car) */) { +  implements_mode = 0;    return is_compatible(implements_a=ap, implements_b=bp);    } -  +  implements_mode = 1;    return implements(implements_a=ap, implements_b=bp);    }    break;
4432:   {    implements_a=0;    implements_b=0; +  implements_mode=0;       match_types(type_a, type_b);   
4456:    free_string(s2);    }    -  if(implements_a && implements_b) -  yyexplain_not_implements(implements_a,implements_b,flags); +  if(implements_a && implements_b) { +  if (implements_mode) { +  yyexplain_not_implements(implements_a, implements_b, flags); +  } else { +  yyexplain_not_compatible(implements_a, implements_b, flags);    } -  +  } + }         /******/