Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
supply name to X::Bind::NativeType, jnthn++
  • Loading branch information
moritz committed Aug 21, 2012
1 parent 9162d07 commit e0ffd92
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/Perl6/Actions.pm
Expand Up @@ -4057,7 +4057,9 @@ class Perl6::Actions is HLL::Actions {
if $target.isa(QAST::Var) {
# Check it's not a native type; we can't bind to those.
if pir::repr_get_primitive_type_spec__IP($target.returns) {
$*W.throw($/, ['X', 'Bind', 'NativeType']);
$*W.throw($/, ['X', 'Bind', 'NativeType'],
name => ($target.name // ''),
);
}

# We may need to decontainerize the right, depending on sigil.
Expand Down
3 changes: 2 additions & 1 deletion src/core/Exception.pm
Expand Up @@ -496,8 +496,9 @@ my class X::Bind is Exception {
}
}
my class X::Bind::NativeType does X::Comp {
has $.name;
method message() {
'Cannot bind to a natively typed variable; use assignment instead'
"Cannot bind to natively typed variable '$.name'; use assignment instead"
}
}
my class X::Bind::Slice is Exception {
Expand Down
2 changes: 1 addition & 1 deletion src/core/Str.pm
Expand Up @@ -1045,7 +1045,7 @@ multi infix:<~&>(Str:D \a, Str:D \b) returns Str:D {
}
multi infix:<~&>(str $a, str $b) returns str { nqp::bitand_s($a, $b) }

multi infix:<~^>(Str:D \a, Str:D \b) returns Bool:D {
multi infix:<~^>(Str:D \a, Str:D \b) returns Str:D {
nqp::p6box_s(nqp::bitxor_s(nqp::unbox_s(a), nqp::unbox_s(b)))
}
multi infix:<~^>(str $a, str $b) returns str { nqp::bitxor_s($a, $b) }
Expand Down

0 comments on commit e0ffd92

Please sign in to comment.