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

Subset type used in Signatures fails with errors #1799

Closed
cono opened this issue May 5, 2018 · 3 comments
Closed

Subset type used in Signatures fails with errors #1799

cono opened this issue May 5, 2018 · 3 comments
Labels
tests needed Issue is generally resolved but tests were not written yet

Comments

@cono
Copy link
Contributor

cono commented May 5, 2018

20:11 < moritz> it's a bug in the optimizer

The Problem

20:08 < cono> m: module A { my subset CAT is export of Code where { .arity == 2 } }; import A; sub xz(CAT :$c) { say $c(3, 5) }; xz(c => * <=> *)
20:08 <+camelia> rakudo-moar 1447f41: OUTPUT: «===SORRY!===␤Cannot look up attributes in a A::CAT type object␤»

Expected Behavior

subset type should work in signatures and class attributes.

Actual Behavior

fails with error: Cannot look up attributes in a CAT type object

Steps to Reproduce

20:12 < moritz> m: subset CAT of Code; sub xz(CAT $c) { };
20:12 <+camelia> rakudo-moar 1447f41: OUTPUT: «===SORRY!===␤Cannot look up attributes in a CAT type object␤»

Environment

  • Operating system: Gentoo
  • Compiler version (perl6 -v):
    perl6 -v
    This is Rakudo version 2018.04.1-37-g1447f41e6 built on MoarVM version 2018.04-39-gc702f4c66
    implementing Perl 6.c.
@moritz
Copy link
Member

moritz commented May 5, 2018

This is the backtrace I get with --ll-exception:

   at gen/moar/Perl6-Optimizer.nqp:2308  (/home/moritz/p6/rakudo/install/share/nqp/lib/Perl6/Optimizer.moarvm:optimize-param-typecheck)
 from gen/moar/Perl6-Optimizer.nqp:2276  (/home/moritz/p6/rakudo/install/share/nqp/lib/Perl6/Optimizer.moarvm:visit_children)
 from gen/moar/Perl6-Optimizer.nqp:2040  (/home/moritz/p6/rakudo/install/share/nqp/lib/Perl6/Optimizer.moarvm:visit_var)
 from gen/moar/Perl6-Optimizer.nqp:2218  (/home/moritz/p6/rakudo/install/share/nqp/lib/Perl6/Optimizer.moarvm:visit_children)
 from gen/moar/Perl6-Optimizer.nqp:2230  (/home/moritz/p6/rakudo/install/share/nqp/lib/Perl6/Optimizer.moarvm:visit_children)
 from gen/moar/Perl6-Optimizer.nqp:946  (/home/moritz/p6/rakudo/install/share/nqp/lib/Perl6/Optimizer.moarvm:visit_block)
 from gen/moar/Perl6-Optimizer.nqp:2221  (/home/moritz/p6/rakudo/install/share/nqp/lib/Perl6/Optimizer.moarvm:visit_children)
 from gen/moar/Perl6-Optimizer.nqp:2230  (/home/moritz/p6/rakudo/install/share/nqp/lib/Perl6/Optimizer.moarvm:visit_children)
 from gen/moar/Perl6-Optimizer.nqp:2230  (/home/moritz/p6/rakudo/install/share/nqp/lib/Perl6/Optimizer.moarvm:visit_children)
 from gen/moar/Perl6-Optimizer.nqp:946  (/home/moritz/p6/rakudo/install/share/nqp/lib/Perl6/Optimizer.moarvm:visit_block)
 from gen/moar/Perl6-Optimizer.nqp:920  (/home/moritz/p6/rakudo/install/share/nqp/lib/Perl6/Optimizer.moarvm:optimize)
 from src/Perl6/Compiler.nqp:47  (/home/moritz/p6/rakudo/install/share/nqp/lib/Perl6/Compiler.moarvm:optimize)
 from gen/moar/stage2/NQPHLL.nqp:1845  (/home/moritz/p6/rakudo/install/share/nqp/lib/NQPHLL.moarvm:execute_stage)
 from gen/moar/stage2/NQPHLL.nqp:1878  (/home/moritz/p6/rakudo/install/share/nqp/lib/NQPHLL.moarvm:run)
 from gen/moar/stage2/NQPHLL.nqp:1881  (/home/moritz/p6/rakudo/install/share/nqp/lib/NQPHLL.moarvm:)
 from gen/moar/stage2/NQPHLL.nqp:1867  (/home/moritz/p6/rakudo/install/share/nqp/lib/NQPHLL.moarvm:compile)
 from gen/moar/stage2/NQPHLL.nqp:1567  (/home/moritz/p6/rakudo/install/share/nqp/lib/NQPHLL.moarvm:eval)
 from gen/moar/stage2/NQPHLL.nqp:1822  (/home/moritz/p6/rakudo/install/share/nqp/lib/NQPHLL.moarvm:evalfiles)
 from gen/moar/stage2/NQPHLL.nqp:1747  (/home/moritz/p6/rakudo/install/share/nqp/lib/NQPHLL.moarvm:command_eval)
 from src/Perl6/Compiler.nqp:42  (/home/moritz/p6/rakudo/install/share/nqp/lib/Perl6/Compiler.moarvm:command_eval)
 from gen/moar/stage2/NQPHLL.nqp:1673  (/home/moritz/p6/rakudo/install/share/nqp/lib/NQPHLL.moarvm:command_line)
 from gen/moar/main.nqp:47  (/home/moritz/p6/rakudo/install/share/perl6/runtime/perl6.moarvm:MAIN)
 from gen/moar/main.nqp:38  (/home/moritz/p6/rakudo/install/share/perl6/runtime/perl6.moarvm:<mainline>)
 from <unknown>:1  (/home/moritz/p6/rakudo/install/share/perl6/runtime/perl6.moarvm:<main>)
 from <unknown>:1  (/home/moritz/p6/rakudo/install/share/perl6/runtime/perl6.moarvm:<entry>)

@AlexDaniel
Copy link
Contributor

AlexDaniel commented May 5, 2018

Output on all releases: https://gist.github.com/8280e0a1953d48a3308d417ca3aeed69

Bisected to these commits:
43b9c82
f8c2b55 (merge commit)
426a39a
ae69708
d74010b (merge commit)

<moritz> the first one looks suspect
<moritz> it touches subsets and the optimizer

@moritz
Copy link
Member

moritz commented May 5, 2018

I suspect that this: 43b9c82#diff-deae5f68054ef8116f04d6cb78bc4395R8906 needs another condition that checks if $_ is definite.

@moritz moritz added the tests needed Issue is generally resolved but tests were not written yet label May 5, 2018
cono added a commit to Raku/roast that referenced this issue May 5, 2018
Subset type on Code with arity check failed in use in sub/method
signatures or class attributes.
@moritz moritz closed this as completed May 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests needed Issue is generally resolved but tests were not written yet
Projects
None yet
Development

No branches or pull requests

3 participants