Branch: Tag:

2008-05-10

2008-05-10 11:53:41 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Calling a value of type type now performs the corresponding cast.

Rev: src/interpret.c:1.396
Rev: src/pike_types.c:1.330

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: interpret.c,v 1.395 2008/04/14 16:33:32 grubba Exp $ + || $Id: interpret.c,v 1.396 2008/05/10 11:53:41 grubba Exp $   */      #include "global.h"
1891:    apply_array(s->u.array,args);    break;    +  case PIKE_T_TYPE: +  if (args != 1) { +  /* FIXME: Casts to object ought to propagate to apply program below. */ +  SIMPLE_WRONG_NUM_ARGS_ERROR("cast", 1); +  } +  o_cast(s->u.type, compile_type_to_runtime_type(s->u.type)); +  break; +     case T_PROGRAM:    if(Pike_interpreter.trace_level)    {