Skip to content

Commit

Permalink
Make binding on a typed Hash a bit more awesome
Browse files Browse the repository at this point in the history
Since we are typechecking on the 2nd parameter of BIND-KEY, the name
of the parameter leaks out.  Change the name to make it less obvious
that it is actually the name of a parameter
  • Loading branch information
lizmat committed Oct 8, 2018
1 parent ea71041 commit 560e94e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/Hash.pm6
Expand Up @@ -462,11 +462,11 @@ my class Hash { # declared in BOOTSTRAP
)
)
}
method BIND-KEY(\key, TValue \bindval) is raw {
method BIND-KEY(\key, TValue \value) is raw {
nqp::bindkey(
nqp::getattr(self,Map,'$!storage'),
key.Str,
bindval
value
)
}
multi method perl(::?CLASS:D \SELF:) {
Expand Down Expand Up @@ -533,12 +533,12 @@ my class Hash { # declared in BOOTSTRAP
)
}

method BIND-KEY(TKey \key, TValue \bindval) is raw {
method BIND-KEY(TKey \key, TValue \value) is raw {
nqp::getattr(
nqp::bindkey(
nqp::getattr(self,Map,'$!storage'),
key.WHICH,
Pair.new(key,bindval)
Pair.new(key,value)
),
Pair,
'$!value'
Expand Down

0 comments on commit 560e94e

Please sign in to comment.