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

Typed Shaped Arrays can't be initialized #4772

Closed
p6rt opened this issue Nov 21, 2015 · 5 comments
Closed

Typed Shaped Arrays can't be initialized #4772

p6rt opened this issue Nov 21, 2015 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Nov 21, 2015

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

Searchable as RT126703$

@p6rt
Copy link
Author

p6rt commented Nov 21, 2015

From @timo

Reproducing test​:

my @​a[3;3] = <a b c>, <d e f>, <g h i>; say @​a; # works
my Str @​a[3;3] = <a b c>, <d e f>, <g h i>; say @​a; # fails

153852 jnthn │ m​: say ((0 xx 10) xx 10).WHAT
153852 +camelia │ rakudo-moar : OUTPUT«(List)␤»
153857 jnthn │ Curious...
153933 timotimo │ how do you initialize the lists in your multidim
tests? :)
153935 jnthn │ Curious...I'd kinda have expected that to be a Seq...
153955 jnthn │ m​: my @​a[3;3] = <a b c>, <d e f>, <g h i>; say @​a
153956 +camelia │ rakudo-moar : OUTPUT«[[a b c] [d e f] [g h i]]␤»
154002 timotimo │ mhh
154003 jnthn │ m​: my @​a[3;3] = <a b c> xx 3; say @​a
154004 +camelia │ rakudo-moar : OUTPUT«[[a b c] [a b c] [a b c]]␤»
154014 timotimo │ m​: my Str @​a[3;3] = <a b c>, <d e f>, <g h i>; say @​a
154014 +camelia │ rakudo-moar : OUTPUT«Type check failed in assignment
to ; expected Str but got List␤ in block
  │ <unit> at /tmp/XObUYCKoZZ​:1␤␤»
154023 jnthn │ m​: my @​a[3;3] = ('a' xx 3) xx 3; say @​a
154023 +camelia │ rakudo-moar : OUTPUT«[[a a a] [a a a] [a a a]]␤»
154032 jnthn │ Oh...
154037 timotimo │ it's really the type annotation; the type check seems
to happen in a/the wrong place
154047 jnthn │ Yes, looks like it.

@p6rt
Copy link
Author

p6rt commented Feb 6, 2018

From @dogbert17

On Sat, 21 Nov 2015 06​:48​:27 -0800, timo wrote​:

Reproducing test​:

my @​a[3;3] = <a b c>, <d e f>, <g h i>; say @​a; # works
my Str @​a[3;3] = <a b c>, <d e f>, <g h i>; say @​a; # fails

153852 jnthn │ m​: say ((0 xx 10) xx 10).WHAT
153852 +camelia │ rakudo-moar : OUTPUT«(List)␤»
153857 jnthn │ Curious...
153933 timotimo │ how do you initialize the lists in your multidim
tests? :)
153935 jnthn │ Curious...I'd kinda have expected that to be a Seq...
153955 jnthn │ m​: my @​a[3;3] = <a b c>, <d e f>, <g h i>; say @​a
153956 +camelia │ rakudo-moar : OUTPUT«[[a b c] [d e f] [g h i]]␤»
154002 timotimo │ mhh
154003 jnthn │ m​: my @​a[3;3] = <a b c> xx 3; say @​a
154004 +camelia │ rakudo-moar : OUTPUT«[[a b c] [a b c] [a b c]]␤»
154014 timotimo │ m​: my Str @​a[3;3] = <a b c>, <d e f>, <g h i>; say @​a
154014 +camelia │ rakudo-moar : OUTPUT«Type check failed in assignment
to ; expected Str but got List␤ in block
│ <unit> at /tmp/XObUYCKoZZ​:1␤␤»
154023 jnthn │ m​: my @​a[3;3] = ('a' xx 3) xx 3; say @​a
154023 +camelia │ rakudo-moar : OUTPUT«[[a a a] [a a a] [a a a]]␤»
154032 jnthn │ Oh...
154037 timotimo │ it's really the type annotation; the type check seems
to happen in a/the wrong place
154047 jnthn │ Yes, looks like it.

Fixed with commit 131367c7daa89d. Test needed.

@p6rt
Copy link
Author

p6rt commented Feb 6, 2018

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

@p6rt
Copy link
Author

p6rt commented Feb 7, 2018

From @zoffixznet

Tests Raku/roast#387

@p6rt p6rt closed this as completed Feb 7, 2018
@p6rt
Copy link
Author

p6rt commented Feb 7, 2018

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

@p6rt p6rt added the testneeded label Jan 5, 2020
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