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

.push and .unshift do not do typechecks #3196

Closed
p6rt opened this issue Jul 29, 2013 · 7 comments
Closed

.push and .unshift do not do typechecks #3196

p6rt opened this issue Jul 29, 2013 · 7 comments

Comments

@p6rt
Copy link

p6rt commented Jul 29, 2013

Migrated from rt.perl.org#119061 (status was 'resolved')

Searchable as RT119061$

@p6rt
Copy link
Author

p6rt commented Jul 29, 2013

From @lizmat

[12​:48​:23] <lizmat> r​: my Int @​a; @​a.push​: "a"; say @​a # rakudobug
[12​:48​:24] <+camelia> rakudo c81003​: OUTPUT«a␤»
[12​:49​:03] <lizmat> r​: my Int @​a; @​a[@​a.elems] ="a"; say @​a
[12​:49​:04] <+camelia> rakudo c81003​: OUTPUT«Type check failed in assignment to '$v'; expected 'Int' but got 'Str'␤ in block at /tmp/6VsTyW_b_X​:1␤␤»
[12​:49​:19] <lizmat> apparently .push is not doing a typecheck
[12​:49​:40] <lizmat> r​: my Int @​a; @​a.unshift​: "a"; say @​a # rakudobug
[12​:49​:41] <+camelia> rakudo c81003​: OUTPUT«a␤»
[12​:49​:50] <lizmat> and nor is unshift
[12​:50​:44] lizmat submits rakudonug

@p6rt
Copy link
Author

p6rt commented Jul 29, 2013

From @lizmat

On Jul 29, 2013, at 12​:52 PM, Elizabeth Mattijsen (via RT) <perl6-bugs-followup@​perl.org> wrote​:

# New Ticket Created by Elizabeth Mattijsen
# Please include the string​: [perl #​119061]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=119061 >

[12​:48​:23] <lizmat> r​: my Int @​a; @​a.push​: "a"; say @​a # rakudobug
[12​:48​:24] <+camelia> rakudo c81003​: OUTPUT«a␤»
[12​:49​:03] <lizmat> r​: my Int @​a; @​a[@​a.elems] ="a"; say @​a
[12​:49​:04] <+camelia> rakudo c81003​: OUTPUT«Type check failed in assignment to '$v'; expected 'Int' but got 'Str'␤ in block at /tmp/6VsTyW_b_X​:1␤␤»
[12​:49​:19] <lizmat> apparently .push is not doing a typecheck
[12​:49​:40] <lizmat> r​: my Int @​a; @​a.unshift​: "a"; say @​a # rakudobug
[12​:49​:41] <+camelia> rakudo c81003​: OUTPUT«a␤»
[12​:49​:50] <lizmat> and nor is unshift
[12​:50​:44] lizmat submits rakudonug

This goes even further​:

[14​:59​:24] <lizmat> r​: my Int @​a=<foo bar>; say @​a # yikes!
[14​:59​:25] <+camelia> rakudo f8e970​: OUTPUT«foo bar␤»

@p6rt
Copy link
Author

p6rt commented Nov 14, 2013

From @lizmat

This appears to have been fixed.

@p6rt
Copy link
Author

p6rt commented Nov 14, 2013

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Oct 16, 2014

From @usev6

Since this works now I've added 3 tests to S09-typed-arrays/arrays.t with the following commit​: Raku/roast@ece637835e

For the last example ("my Int @​a=<foo bar>;") there was already a test (written for ticket 114968).

I'm closing this ticket now.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 16, 2014

From @usev6

Since this works now I've added 3 tests to S09-typed-arrays/arrays.t with the following commit​: Raku/roast@ece637835e

For the last example ("my Int @​a=<foo bar>;") there was already a test (written for ticket 114968).

I'm closing this ticket now.

@p6rt p6rt closed this as completed Oct 16, 2014
@p6rt
Copy link
Author

p6rt commented Oct 16, 2014

@usev6 - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant