Skip to content
Permalink
Browse files

Show the actual value instead of its type

Improves the error message for "Set[Int}.new = <a b c>" from:

    Type check failed in binding; expected Int but got Str (Str)

to:

    Type check failed in binding; expected Int but got Str ("a")
  • Loading branch information...
lizmat committed Jan 15, 2019
1 parent 8ad750a commit 6a8f08b95f7072adef4cb591468b60af426065b3
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/core/Rakudo/QuantHash.pm6
@@ -301,7 +301,7 @@ my class Rakudo::QuantHash {
nqp::istype(value,type),
nqp::bindkey(elems,value.WHICH,value),
X::TypeCheck::Binding.new(
got => value.WHAT,
got => value,
expected => type
).throw
)
@@ -609,7 +609,7 @@ my class Rakudo::QuantHash {
nqp::istype(object,type),
nqp::bindkey(elems,which,Pair.new(object,value)),
X::TypeCheck::Binding.new(
got => object.WHAT,
got => object,
expected => type
).throw
)
@@ -1230,7 +1230,7 @@ my class Rakudo::QuantHash {
nqp::istype(object,type),
nqp::bindkey(elems,which,Pair.new(object,value)),
X::TypeCheck::Binding.new(
got => object.WHAT,
got => object,
expected => type
).throw
)

0 comments on commit 6a8f08b

Please sign in to comment.
You can’t perform that action at this time.