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

Complex parametric role composition fails badly when no candidate found #4513

Open
p6rt opened this issue Sep 5, 2015 · 5 comments
Open

Comments

@p6rt
Copy link

p6rt commented Sep 5, 2015

Migrated from rt.perl.org#125996 (status was 'open')

Searchable as RT125996$

@p6rt
Copy link
Author

p6rt commented Sep 5, 2015

From @dakkar

This code​::

  role R[$a,$b] {}
  role R2[$x] does R[1] {}
  class C does R2[1] {}

  C.new;

Produces the error message​::

  ===SORRY!===
  Cannot find method 'collisions'

The error happens in ``RoleToClassApplier​::apply``​: something goes
wrong with the nested role specialisation, and the compiler tries to
apply a ``NQPMu``.

--
  Dakkar - <Mobilis in mobile>
  GPG public key fingerprint = A071 E618 DD2C 5901 9574
  6FE2 40EA 9883 7519 3F88
  key id = 0x75193F88

Giving up on assembly language was the apple in our Garden of Eden​:
Languages whose use squanders machine cycles are sinful. The LISP
machine now permits LISP programmers to abandon bra and fig-leaf.
  -- Epigrams in Programming, ACM SIGPLAN Sept. 1982

@p6rt
Copy link
Author

p6rt commented Sep 5, 2015

From @lizmat

One would expect an error message such as​:

$ 6 'role R[$a,$b] {}; class C does R[1] {}'
===SORRY!===
No appropriate parametric role variant available for ‘R'

but even that message is rather LTA, as it doesn’t mention which parameters were tried and which candidates are available.

Liz

On 05 Sep 2015, at 12​:38, dakkar (via RT) <perl6-bugs-followup@​perl.org> wrote​:

# New Ticket Created by dakkar
# Please include the string​: [perl #​125996]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=125996 >

This code​::

role R[$a,$b] {}
role R2[$x] does R[1] {}
class C does R2[1] {}

C.new;

Produces the error message​::

===SORRY!===
Cannot find method 'collisions'

The error happens in ``RoleToClassApplier​::apply``​: something goes
wrong with the nested role specialisation, and the compiler tries to
apply a ``NQPMu``.

--
Dakkar - <Mobilis in mobile>
GPG public key fingerprint = A071 E618 DD2C 5901 9574
6FE2 40EA 9883 7519 3F88
key id = 0x75193F88

Giving up on assembly language was the apple in our Garden of Eden​:
Languages whose use squanders machine cycles are sinful. The LISP
machine now permits LISP programmers to abandon bra and fig-leaf.
-- Epigrams in Programming, ACM SIGPLAN Sept. 1982

@p6rt
Copy link
Author

p6rt commented Sep 5, 2015

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

@p6rt
Copy link
Author

p6rt commented Dec 3, 2017

From @AlexDaniel

Last message still reproducible (2017.11,HEAD(e5b660e))

On 2015-09-05 03​:44​:49, elizabeth wrote​:

One would expect an error message such as​:

$ 6 'role R[$a,$b] {}; class C does R[1] {}'
===SORRY!===
No appropriate parametric role variant available for ‘R'

but even that message is rather LTA, as it doesn’t mention which
parameters were tried and which candidates are available.

Liz

On 05 Sep 2015, at 12​:38, dakkar (via RT) <perl6-bugs-
followup@​perl.org> wrote​:

# New Ticket Created by dakkar
# Please include the string​: [perl #​125996]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=125996 >

This code​::

role R[$a,$b] {}
role R2[$x] does R[1] {}
class C does R2[1] {}

C.new;

Produces the error message​::

===SORRY!===
Cannot find method 'collisions'

The error happens in ``RoleToClassApplier​::apply``​: something goes
wrong with the nested role specialisation, and the compiler tries to
apply a ``NQPMu``.

--
Dakkar - <Mobilis in mobile>
GPG public key fingerprint = A071 E618 DD2C 5901 9574
6FE2 40EA 9883 7519 3F88
key id = 0x75193F88

Giving up on assembly language was the apple in our Garden of Eden​:
Languages whose use squanders machine cycles are sinful. The LISP
machine now permits LISP programmers to abandon bra and fig-leaf.
-- Epigrams in Programming, ACM SIGPLAN Sept. 1982

@usev6
Copy link

usev6 commented Apr 10, 2021

The current error message looks good to me:

$ cat >gh_old_4513.raku
role R[$a,$b] {};     
role R2[$x] does R[1] {};
class C does R2[1] {};
C.new;
^D
$ ./rakudo-m gh_old_4513.raku 
===SORRY!=== Error while compiling /path/to/gh_old_4513.raku
No appropriate parametric role variant available for 'R':
    Cannot resolve caller (R[Int]:U, Int:D); none of these signatures match:
        (::$?CLASS ::::?CLASS Mu, Mu $a, Mu $b)
at /path/to/gh_old_4513.raku:2

Should probably got a test in Rakudo's test suite.

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

2 participants