Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency: can bind wrong type to typed Hash but not typed Array's value #1655

Open
zoffixznet opened this issue Mar 26, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@zoffixznet
Copy link
Contributor

commented Mar 26, 2018

Not sure which way is right or desirable, but if possible would be good to have a consistency between the two:

19:32 |   | m: my Int %h; %h<foo> := rand; dd %h
-- | -- | --
19:32 | camelia | rakudo-moar 1c4eebe52: OUTPUT: «Hash[Int] %h = (my Int % = :foo(0.9608381618766769e0))␤»
19:32 | Zoffix | m: my Int @h; @h[2] := rand;
19:32 | camelia | rakudo-moar 1c4eebe52: OUTPUT: «Cannot resolve caller BIND-POS(Array[Int]: Int, Num); none of these signatures match:␤    (Array:D $: int $pos, Int \bindval, *%_)␤    (Array:D $: Int:D $pos, Int \bindval, *%_)␤  in block <unit> at <tmp> line 1␤␤»

You can re-bind a non-Int to Int-parametarized Hash, but you can't do the same with Arrays because BIND-POS is typed to parametarized type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.