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

Pushed values are not type-cheched properly #4329

Closed
p6rt opened this issue Jun 17, 2015 · 6 comments
Closed

Pushed values are not type-cheched properly #4329

p6rt opened this issue Jun 17, 2015 · 6 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jun 17, 2015

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

Searchable as RT125428$

@p6rt
Copy link
Author

p6rt commented Jun 17, 2015

From andrspv@gmail.com

<andreoss> m​: subset Y of Int where 1..10; my Y @​x; @​x.push​: 10; @​x[0]++ ;
  @​x.perl.say
<camelia> rakudo-moar 2c58ee​: OUTPUT«Array[Y].new(11)␤»
<andreoss> m​: subset Y of Int where 1..10; my Y @​x; @​x[0] = 10; @​x[0]++ ;
  @​x.perl.say
<camelia> rakudo-moar 2c58ee​: OUTPUT«Type check failed in assignment to '@​x';
  expected 'Y' but got 'Int'␤ in block <unit> at /tmp/1211Xh_ZOc​:1␤␤»
<andreoss> why pushed value is not type checked?
<moritz> because bug
<moritz> I guess that push doesn't create the right Scalar container for the
  new elemnt

@p6rt
Copy link
Author

p6rt commented Jun 17, 2015

From @lizmat

Fixed with f97f9ad6f0b9c6bf96c6. Tests are still needed.

Liz

On 17 Jun 2015, at 03​:52, Andrei Osipov (via RT) <perl6-bugs-followup@​perl.org> wrote​:

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

<andreoss> m​: subset Y of Int where 1..10; my Y @​x; @​x.push​: 10; @​x[0]++ ;
@​x.perl.say
<camelia> rakudo-moar 2c58ee​: OUTPUT«Array[Y].new(11)␤»
<andreoss> m​: subset Y of Int where 1..10; my Y @​x; @​x[0] = 10; @​x[0]++ ;
@​x.perl.say
<camelia> rakudo-moar 2c58ee​: OUTPUT«Type check failed in assignment to '@​x';
expected 'Y' but got 'Int'␤ in block <unit> at /tmp/1211Xh_ZOc​:1␤␤»
<andreoss> why pushed value is not type checked?
<moritz> because bug
<moritz> I guess that push doesn't create the right Scalar container for the
new elemnt

@p6rt
Copy link
Author

p6rt commented Jun 17, 2015

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

@p6rt
Copy link
Author

p6rt commented Jun 17, 2015

From @usev6

I added a test to S09-typed-arrays/arrays.t with commit Raku/roast@e9694a7ef8.

I'm closing this ticket as 'resolved'.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Jun 17, 2015

From @usev6

I added a test to S09-typed-arrays/arrays.t with commit Raku/roast@e9694a7ef8.

I'm closing this ticket as 'resolved'.

@p6rt
Copy link
Author

p6rt commented Jun 17, 2015

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

@p6rt p6rt closed this as completed Jun 17, 2015
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant