Skip to content

Commit

Permalink
A few little fixes to the binder updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed May 22, 2011
1 parent 98c43fd commit c50c120
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/binder/bind.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
}


Expand Down Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/binder/bind.h
Expand Up @@ -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. */
Expand All @@ -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. */
Expand Down

0 comments on commit c50c120

Please sign in to comment.