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

Parameterizing a role via a variable results in an LTA error #5211

Open
p6rt opened this issue Apr 3, 2016 · 4 comments
Open

Parameterizing a role via a variable results in an LTA error #5211

p6rt opened this issue Apr 3, 2016 · 4 comments
Labels
LTA Less Than Awesome; typically an error message that could be better

Comments

@p6rt
Copy link

p6rt commented Apr 3, 2016

Migrated from rt.perl.org#127832 (status was 'new')

Searchable as RT127832$

@p6rt
Copy link
Author

p6rt commented Apr 3, 2016

From @hoelzro

See the attached file. If you store a parameterized role in a variable and attempt to parameterize it via postcircumfix​:sym<[ ]>, you get a cryptic error message​:

No appropriate parametric role variant available for 'R'
in any specialize at gen/moar/m-Metamodel.nqp line 2609
in any compose at gen/moar/m-Metamodel.nqp line 2988
in any make_pun at gen/moar/m-Metamodel.nqp line 1692
in any find_method at gen/moar/m-Metamodel.nqp line 1720
in block <unit> at test.pl line 11

@p6rt
Copy link
Author

p6rt commented Apr 3, 2016

From @hoelzro

test.pl

@p6rt
Copy link
Author

p6rt commented Jul 10, 2016

From @zoffixznet

Still present​:

zoffix@​VirtualBox​:/tmp/tmp.9WzczD5eHY$ perl6 -v
This is Rakudo version 2016.06-154-g55c359e built on MoarVM version 2016.06-9-g8fc21d5
implementing Perl 6.c.
zoffix@​VirtualBox​:/tmp/tmp.9WzczD5eHY$ 6f foo.p6
No appropriate parametric role variant available for 'R'
  in any specialize at gen/moar/m-Metamodel.nqp line 2614
  in any compose at gen/moar/m-Metamodel.nqp line 2993
  in any make_pun at gen/moar/m-Metamodel.nqp line 1701
  in any find_method at gen/moar/m-Metamodel.nqp line 1729
  in block <unit> at foo.p6 line 10

@p6rt p6rt added the LTA Less Than Awesome; typically an error message that could be better label Jan 5, 2020
@usev6
Copy link

usev6 commented Oct 6, 2023

For the record (and to have all the data available in this issue): This is the content of the file test.pl:

use v6;

role R[$value] {}

class C {}

my $obj = C.new;
my $r = R;

$obj but $r[1];

=output
No appropriate parametric role variant available for 'R'
  in any specialize at gen/moar/m-Metamodel.nqp line 2609
  in any compose at gen/moar/m-Metamodel.nqp line 2988
  in any make_pun at gen/moar/m-Metamodel.nqp line 1692
  in any find_method at gen/moar/m-Metamodel.nqp line 1720
  in block <unit> at test.pl line 11

The code still dies nowadays:

$ ./rakudo-m -e 'role R[$value] {}; class C {}; my $obj = C.new; my $r = R; $obj but $r[1]'
No appropriate parametric role variant available for 'R':
    Cannot resolve caller (R); none of these signatures matches:
        (::$?CLASS ::::?CLASS Mu, Mu $value)
  in block <unit> at -e line 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTA Less Than Awesome; typically an error message that could be better
Projects
None yet
Development

No branches or pull requests

2 participants