Branch: Tag:

2003-03-27

2003-03-27 02:22:17 by Martin Stjernholm <mast@lysator.liu.se>

Don't derive return types for lambdas etc during pass 1 since that can
induce too strict type checks.

Rev: src/language.yacc:1.320

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: language.yacc,v 1.319 2003/03/27 02:06:43 mast Exp $ + || $Id: language.yacc,v 1.320 2003/03/27 02:22:17 mast Exp $   */      %pure_parser
113:   /* This is the grammar definition of Pike. */      #include "global.h" - RCSID("$Id: language.yacc,v 1.319 2003/03/27 02:06:43 mast Exp $"); + RCSID("$Id: language.yacc,v 1.320 2003/03/27 02:22:17 mast Exp $");   #ifdef HAVE_MEMORY_H   #include <memory.h>   #endif
1881:       debug_malloc_touch($7);    $7=mknode(F_COMMA_EXPR,$7,mknode(F_RETURN,mkintnode(0),0)); +  if (Pike_compiler->compiler_pass == 2) +  /* Doing this in pass 1 might induce too strict checks on types +  * in cases where we got placeholders. */    type=find_return_type($7); -  +  else +  type = NULL;       if(type) {    push_finished_type(type);
3049:       debug_malloc_touch($5);    $5=mknode(F_COMMA_EXPR,$5,mknode(F_RETURN,mkintnode(0),0)); +  if (Pike_compiler->compiler_pass == 2) +  /* Doing this in pass 1 might induce too strict checks on types +  * in cases where we got placeholders. */    type=find_return_type($5); -  +  else +  type = NULL;       if(type) {    push_finished_type(type);