Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Turn on scalar decontainerization of return values, and return value …
…type checking. Note we need to be careful to add 'is rw' now to routines that fall off the bottom with a value we expect to return in containerized form. Think I've caught all of these; testing welcome.
  • Loading branch information
jnthn committed Jul 9, 2011
1 parent f2e0b4a commit dba1c2f
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/Perl6/Actions.pm
Expand Up @@ -3520,11 +3520,18 @@ class Perl6::Actions is HLL::Actions {
}

sub wrap_return_handler($past) {
PAST::Stmts.new( :signature('0Pv'),
PAST::Op.new(:pasttype<lexotic>, :name<RETURN>, $past),
PAST::Op.new(:pasttype<bind_6model>,
PAST::Var.new(:name<RETURN>, :scope<lexical>),
PAST::Var.new(:name<&EXHAUST>, :scope<lexical>))
PAST::Op.new(
:pirop('perl6_type_check_return_value 0P'),
PAST::Stmts.new( :signature('0Pv'),
PAST::Op.new(:pasttype<lexotic>, :name<RETURN>,
# If we fall off the bottom, decontainerize if
# rw not set.
PAST::Op.new( :pirop('perl6_decontainerize_return_value PP'), $past )
),
PAST::Op.new(:pasttype<bind_6model>,
PAST::Var.new(:name<RETURN>, :scope<lexical>),
PAST::Var.new(:name<&EXHAUST>, :scope<lexical>))
)
)
}

Expand Down

0 comments on commit dba1c2f

Please sign in to comment.