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

.gist on typed array shows (Any) instead of real type objects #3563

Closed
p6rt opened this issue Oct 23, 2014 · 8 comments
Closed

.gist on typed array shows (Any) instead of real type objects #3563

p6rt opened this issue Oct 23, 2014 · 8 comments

Comments

@p6rt
Copy link

p6rt commented Oct 23, 2014

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

Searchable as RT123037$

@p6rt
Copy link
Author

p6rt commented Oct 23, 2014

From @masak

<smls> m​: my Int @​a; @​a[4]++; say @​a[0]; say @​a
<camelia> rakudo-moar 315ec6​: OUTPUT«(Int)␤(Any) (Any) (Any) (Any) 1␤»
<smls> Is that *supposed* to say "(Any)" there?
<moritz> no, (Int)
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented Sep 13, 2015

From @usev6

On Thu Oct 23 04​:51​:47 2014, masak wrote​:

<smls> m​: my Int @​a; @​a[4]++; say @​a[0]; say @​a
<camelia> rakudo-moar 315ec6​: OUTPUT«(Int)␤(Any) (Any) (Any) (Any) 1␤»
<smls> Is that *supposed* to say "(Any)" there?
<moritz> no, (Int)
* masak submits rakudobug

Actually, the typed array seems to contain (Int) type objects -- as the output of @​a[0] also shows​:

$ perl6 -e 'my Int @​a; @​a[4]++; say @​a[0]; say @​a.perl'
(Int)
Array[Int].new(Int, Int, Int, Int, 1)

The problem seems to be in .gist (which is called with 'say @​a' in the first evaluation). More specifically, .gist calls .map on @​a and the type info is not present within .map. (Also reported in https://rt-archive.perl.org/perl6/Ticket/Display.html?id=120071).

$ perl6 -e 'my Int @​a; @​a[4]++; @​a.map​:{say .WHAT.perl};'
Any
Any
Any
Any
Int

I'm going to change the subject of this ticket and add a reference to RT #​120071.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Sep 13, 2015

From @usev6

On Thu Oct 23 04​:51​:47 2014, masak wrote​:

<smls> m​: my Int @​a; @​a[4]++; say @​a[0]; say @​a
<camelia> rakudo-moar 315ec6​: OUTPUT«(Int)␤(Any) (Any) (Any) (Any) 1␤»
<smls> Is that *supposed* to say "(Any)" there?
<moritz> no, (Int)
* masak submits rakudobug

Actually, the typed array seems to contain (Int) type objects -- as the output of @​a[0] also shows​:

$ perl6 -e 'my Int @​a; @​a[4]++; say @​a[0]; say @​a.perl'
(Int)
Array[Int].new(Int, Int, Int, Int, 1)

The problem seems to be in .gist (which is called with 'say @​a' in the first evaluation). More specifically, .gist calls .map on @​a and the type info is not present within .map. (Also reported in https://rt-archive.perl.org/perl6/Ticket/Display.html?id=120071).

$ perl6 -e 'my Int @​a; @​a[4]++; @​a.map​:{say .WHAT.perl};'
Any
Any
Any
Any
Int

I'm going to change the subject of this ticket and add a reference to RT #​120071.

@p6rt
Copy link
Author

p6rt commented Sep 13, 2015

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

@p6rt
Copy link
Author

p6rt commented Oct 9, 2015

From @peschwa

On Sun Sep 13 12​:52​:47 2015, bartolin@​gmx.de wrote​:

On Thu Oct 23 04​:51​:47 2014, masak wrote​:

<smls> m​: my Int @​a; @​a[4]++; say @​a[0]; say @​a
<camelia> rakudo-moar 315ec6​: OUTPUT«(Int)␤(Any) (Any) (Any) (Any)
1␤»
<smls> Is that *supposed* to say "(Any)" there?
<moritz> no, (Int)
* masak submits rakudobug

Actually, the typed array seems to contain (Int) type objects -- as
the output of @​a[0] also shows​:

$ perl6 -e 'my Int @​a; @​a[4]++; say @​a[0]; say @​a.perl'
(Int)
Array[Int].new(Int, Int, Int, Int, 1)

The problem seems to be in .gist (which is called with 'say @​a' in the
first evaluation). More specifically, .gist calls .map on @​a and the
type info is not present within .map. (Also reported in
https://rt-archive.perl.org/perl6/Ticket/Display.html?id=120071).

$ perl6 -e 'my Int @​a; @​a[4]++; @​a.map​:{say .WHAT.perl};'
Any
Any
Any
Any
Int

I'm going to change the subject of this ticket and add a reference to
RT #​120071.

As of commit 5b2b2475, this evaluates as follows​:

< psch> m​: my Int @​a; @​a[4]++; @​a.map​:{say .WHAT.perl};
<+camelia> rakudo-moar 2275f6​: OUTPUT«Int␤Int␤Int␤Int␤Int␤»

@p6rt
Copy link
Author

p6rt commented Oct 24, 2015

From @usev6

Also masak's example works now as expected​:

$ perl6 -e 'my Int @​a; @​a[4]++; say @​a[0]; say @​a'
(Int)
[(Int) (Int) (Int) (Int) 1]

I added a test (without say, but using .gist) to S09-typed-arrays/arrays.t with commit Raku/roast@4ec7087158.

I'm closing this ticket as 'resolved'.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 24, 2015

From @usev6

Also masak's example works now as expected​:

$ perl6 -e 'my Int @​a; @​a[4]++; say @​a[0]; say @​a'
(Int)
[(Int) (Int) (Int) (Int) 1]

I added a test (without say, but using .gist) to S09-typed-arrays/arrays.t with commit Raku/roast@4ec7087158.

I'm closing this ticket as 'resolved'.

@p6rt
Copy link
Author

p6rt commented Oct 24, 2015

@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