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

Class fails to smartmatch against role defined in module #5774

Open
p6rt opened this issue Oct 24, 2016 · 2 comments
Open

Class fails to smartmatch against role defined in module #5774

p6rt opened this issue Oct 24, 2016 · 2 comments

Comments

@p6rt
Copy link

p6rt commented Oct 24, 2016

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

Searchable as RT129957$

@p6rt
Copy link
Author

p6rt commented Oct 24, 2016

From cygx@cpan.org

Minimal testcase​:

  $ cat Foo.pm
  role Foo is export {}

  $ cat foo.p6
  use lib '.';
  use Foo;

  class Bar does Foo {}

  say Bar.^roles;
  say Bar.new ~~ Foo;

  $ perl6 foo.p6
  ((Foo))
  False

Using .WHICH or nqp​::eqaddr (after decont) confirms that we're indeed
dealing with the same type object.

@usev6
Copy link

usev6 commented Oct 7, 2023

This seems to work now:

$ mkdir gh5774; echo 'role Foo is export {}' >gh5774/Foo.rakumod
$ ./rakudo-m -Igh5774 -e 'use Foo; class Bar does Foo {}; say Bar.^roles; say Bar.new ~~ Foo'
((Foo))
True

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