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

Cross meta operator on empty list complains "This type (Scalar) does not support elems" #6289

Closed
p6rt opened this issue May 29, 2017 · 10 comments
Closed
Labels
Bug

Comments

@p6rt
Copy link

@p6rt p6rt commented May 29, 2017

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

Searchable as RT131395$

@p6rt
Copy link
Author

@p6rt p6rt commented May 29, 2017

From @thundergnat

Using a cross meta operator on an empty list complains "This type
(Scalar) does not support elems".

  say (1,2).elems; say ().elems; say (1,2) X ();

yields "2␤0␤This type (Scalar) does not support elems"

Seems to work correctly with arrays instead of lists.

  say [1,2].elems; say [].elems; say [1,2] X [];

Linux Mint 17.2

perl6 -v
This is Rakudo version 2017.05 built on MoarVM version 2017.05
implementing Perl 6.c.

@p6rt
Copy link
Author

@p6rt p6rt commented May 29, 2017

From @zoffixznet

https://irclog.perlgeek.de/perl6/2017-05-29#i_14654174

16​:54 bisectable6 MasterDuke, bisect log​: https://gist.github.com/7d49ce1401bee0ab3127c5d1be2a919e
16​:54 MasterDuke, (2017-01-16) rakudo/rakudo@8a3ff7b

16​:57 Zoffix m​: use nqp; nqp​::elems(nqp​::getattr((), List, '$!reified'))
16​:57 camelia rakudo-moar a18c06​: OUTPUT​: «This type (Scalar) does not support elems␤ in block <unit> at <tmp> line 1␤␤»

17​:00 m​: use nqp; dd nqp​::getattr((), List, '$!reified').^name; dd nqp​::getattr([], List, '$!reified').^name
17​:00 camelia rakudo-moar a18c06​: OUTPUT​: «"Mu"␤"IterationBuffer"␤»
17​:00 Zoffix Both prolly should be the same? So this bug doesn't occur elsewhere?

@p6rt
Copy link
Author

@p6rt p6rt commented May 29, 2017

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

@p6rt
Copy link
Author

@p6rt p6rt commented May 29, 2017

From @lizmat

On 29 May 2017, at 19​:06, Zoffix Znet via RT <perl6-bugs-followup@​perl.org> wrote​:

https://irclog.perlgeek.de/perl6/2017-05-29#i_14654174

16​:54 bisectable6 MasterDuke, bisect log​: https://gist.github.com/7d49ce1401bee0ab3127c5d1be2a919e
16​:54 MasterDuke, (2017-01-16) rakudo/rakudo@8a3ff7b

16​:57 Zoffix m​: use nqp; nqp​::elems(nqp​::getattr((), List, '$!reified'))
16​:57 camelia rakudo-moar a18c06​: OUTPUT​: «This type (Scalar) does not support elems␤ in block <unit> at <tmp> line 1␤␤»

17​:00 m​: use nqp; dd nqp​::getattr((), List, '$!reified').^name; dd nqp​::getattr([], List, '$!reified').^name
17​:00 camelia rakudo-moar a18c06​: OUTPUT​: «"Mu"␤"IterationBuffer"␤»
17​:00 Zoffix Both prolly should be the same? So this bug doesn't occur elsewhere?

FWIW, I’m testing a fix.

Liz

@p6rt
Copy link
Author

@p6rt p6rt commented May 29, 2017

From @zoffixznet

On Mon, 29 May 2017 10​:02​:27 -0700, thundergnat@​comcast.net wrote​:

Using a cross meta operator on an empty list complains "This type
(Scalar) does not support elems".

 say \(1,2\)\.elems; say \(\)\.elems; say \(1,2\) X \(\);

yields "2␤0␤This type (Scalar) does not support elems"

Seems to work correctly with arrays instead of lists.

     say \[1,2\]\.elems; say \[\]\.elems; say \[1,2\] X \[\];

Linux Mint 17.2

perl6 -v
This is Rakudo version 2017.05 built on MoarVM version 2017.05
implementing Perl 6.c.

Thank you for the report. lizmat++ fixed the issue.

Fix​: rakudo/rakudo@9494cbd
Test​: Raku/roast@0faf3c3

@p6rt
Copy link
Author

@p6rt p6rt commented May 29, 2017

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

@p6rt
Copy link
Author

@p6rt p6rt commented Sep 30, 2017

From @smls

On Mon, 29 May 2017 11​:36​:49 -0700, cpan@​zoffix.com wrote​:

On Mon, 29 May 2017 10​:02​:27 -0700, thundergnat@​comcast.net wrote​:

Using a cross meta operator on an empty list complains "This type
(Scalar) does not support elems".

 say \(1,2\)\.elems; say \(\)\.elems; say \(1,2\) X \(\);

yields "2␤0␤This type (Scalar) does not support elems"

Seems to work correctly with arrays instead of lists.

     say \[1,2\]\.elems; say \[\]\.elems; say \[1,2\] X \[\];

Linux Mint 17.2

perl6 -v
This is Rakudo version 2017.05 built on MoarVM version 2017.05
implementing Perl 6.c.

Thank you for the report. lizmat++ fixed the issue.

Fix​: rakudo/rakudo@9494cbd
Test​: Raku/roast@0faf3c3

Re-opening, because it hasn't been fixed for the Xop case yet​:

  ➜ say () X+ (1, 2);
  This type (Scalar) does not support elems

  ➜ say (1,2) X~ ();
  This type (Scalar) does not support elems

  ➜ say () X=> ();
  This type (Scalar) does not support elems

Bisectable¹ blames a commit² from January.


[1] https://gist.github.com/Whateverable/f1b3066f1e2c45df7ab5e0aa7aeee3a7
[2] rakudo/rakudo@a26f513


This is Rakudo version 2017.09-142-ga89add0bf built on MoarVM version 2017.09.1-49-gb3dd812a
implementing Perl 6.c.

@p6rt
Copy link
Author

@p6rt p6rt commented Sep 30, 2017

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

@p6rt
Copy link
Author

@p6rt p6rt commented May 12, 2019

From @dogbert17

On Sat, 30 Sep 2017 12​:40​:59 -0700, smls75@​gmail.com wrote​:

On Mon, 29 May 2017 11​:36​:49 -0700, cpan@​zoffix.com wrote​:

On Mon, 29 May 2017 10​:02​:27 -0700, thundergnat@​comcast.net wrote​:

Using a cross meta operator on an empty list complains "This type
(Scalar) does not support elems".

say (1,2).elems; say ().elems; say (1,2) X ();

yields "2␤0␤This type (Scalar) does not support elems"

Seems to work correctly with arrays instead of lists.

say [1,2].elems; say [].elems; say [1,2] X [];

Linux Mint 17.2

perl6 -v
This is Rakudo version 2017.05 built on MoarVM version 2017.05
implementing Perl 6.c.

Thank you for the report. lizmat++ fixed the issue.

Fix​: rakudo/rakudo@9494cbd
Test​: Raku/roast@0faf3c3

Re-opening, because it hasn't been fixed for the Xop case yet​:

➜ say () X+ (1, 2);
This type (Scalar) does not support elems

➜ say (1,2) X~ ();
This type (Scalar) does not support elems

➜ say () X=> ();
This type (Scalar) does not support elems

Bisectable¹ blames a commit² from January.

---
[1]
https://gist.github.com/Whateverable/f1b3066f1e2c45df7ab5e0aa7aeee3a7
[2] rakudo/rakudo@a26f513

---
This is Rakudo version 2017.09-142-ga89add0bf built on MoarVM version
2017.09.1-49-gb3dd812a
implementing Perl 6.c.

Fixed with commit rakudo/rakudo@6c93fde
Roast tests added with Raku/roast@7d47580

Closing

@p6rt
Copy link
Author

@p6rt p6rt commented May 12, 2019

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

@p6rt p6rt closed this May 12, 2019
@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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.