Skip to content

Commit

Permalink
special-case assigning Nil
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Jun 6, 2012
1 parent 066916c commit 9103333
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/binder/container.c
Expand Up @@ -4,6 +4,7 @@
#include "container.h"
#include "sixmodelobject.h"
#include "bind.h"
#include "types.h"

static PMC *scalar_type = NULL;
void Rakudo_cont_set_scalar_type(PMC *type) { scalar_type = type; }
Expand Down Expand Up @@ -86,6 +87,10 @@ void Rakudo_cont_store(PARROT_INTERP, PMC *cont, PMC *value,
INTVAL ok = 0;
if (!PMC_IS_NULL(scalar->descriptor)) {
Rakudo_ContainerDescriptor *desc = ((Rakudo_ContainerDescriptor *)PMC_data(scalar->descriptor));
if (value_decont == Rakudo_types_nil_get()) {
scalar->value = desc->of;
return;
}
ok = STABLE(value_decont)->type_check(interp, value_decont, desc->of);
if (!ok) {
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
Expand Down

0 comments on commit 9103333

Please sign in to comment.