From c50c120364dd8c2f9fda59fea04108e86970adc3 Mon Sep 17 00:00:00 2001 From: Jonathan Worthington Date: Sun, 22 May 2011 19:30:31 +0200 Subject: [PATCH] A few little fixes to the binder updates. --- src/binder/bind.c | 8 ++++---- src/binder/bind.h | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/binder/bind.c b/src/binder/bind.c index 797f02e0863..e32fc7709d8 100644 --- a/src/binder/bind.c +++ b/src/binder/bind.c @@ -11,11 +11,11 @@ Copyright (C) 2009-2011, The Perl Foundation. #include "sixmodelobject.h" -/* Cache of the type ID for low level signatures and some strings. */ +/* Cache of Parrot type IDs and some strings. */ static INTVAL or_id = 0; static INTVAL p6s_id = 0; static INTVAL p6r_id = 0; -static INTVAL p6o_id = 0; +static INTVAL smo_id = 0; static STRING *ACCEPTS = NULL; static STRING *HOW = NULL; static STRING *DO_str = NULL; @@ -78,7 +78,7 @@ static void setup_binder_statics(PARROT_INTERP) { or_id = pmc_type(interp, Parrot_str_new(interp, "ObjectRef", 0)); p6s_id = pmc_type(interp, P6_SCALAR_str); p6r_id = pmc_type(interp, Parrot_str_new(interp, "P6role", 0)); - p6o_id = pmc_type(interp, Parrot_str_new(interp, "P6opaque", 0)); + smo_id = pmc_type(interp, Parrot_str_new(interp, "SixModelObject", 0)); } @@ -256,7 +256,7 @@ Rakudo_binding_bind_one_param(PARROT_INTERP, PMC *lexpad, Rakudo_Signature *sign /* If we need to do a type check, do one. */ if (!no_nom_type_check) { /* If not, do the check. */ - if (!STABLE(value)->type_check(interp, value, param->nominal_type)) { + if (value->vtable->base_type != smo_id || !STABLE(value)->type_check(interp, value, param->nominal_type)) { /* Type check failed; produce error if needed. */ if (error) { PMC * got_how = STABLE(value)->HOW; diff --git a/src/binder/bind.h b/src/binder/bind.h index 930b11b9397..299b47ce442 100644 --- a/src/binder/bind.h +++ b/src/binder/bind.h @@ -24,6 +24,7 @@ typedef struct { PMC *st; /* S-table, though we don't care about that here. */ PMC *sc; /* Serialization context, though we don't care about that here. */ + PMC *spill; /* Attribute spill storage. */ STRING *variable_name; /* The name in the lexpad to bind to, if any. */ PMC *named_names; /* List of the name(s) that a named parameter has. */ PMC *type_captures; /* Name(s) that we bind the type of a parameter to. */ @@ -43,6 +44,7 @@ typedef struct { typedef struct { PMC *st; /* S-table, though we don't care about that here. */ PMC *sc; /* Serialization context, though we don't care about that here. */ + PMC *spill; /* Attribute spill storage. */ PMC *params; /* Array of objects that are all parameters. */ PMC *returns; /* Return type. */ PMC *named_to_pos_cache; /* Cache of named to position mappings. */