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

Using exported type symbol as attribute type fails with goofy error #4445

Closed
p6rt opened this issue Jul 29, 2015 · 4 comments
Closed

Using exported type symbol as attribute type fails with goofy error #4445

p6rt opened this issue Jul 29, 2015 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jul 29, 2015

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

Searchable as RT125715$

@p6rt
Copy link
Author

p6rt commented Jul 29, 2015

From @LLFourn

MyMod.pm


class Foo {}
#Foo aliased to Bar
sub EXPORT(|){ { 'Bar' => Foo } }

main.pl


use lib 'lib';
use MyMod;

my class Baz {
  has Bar $.bar;
}

sub test(Bar $) { say "works!" }

test(Bar.new); #->works!

Baz.new(bar => Bar.new );
#!Type check failed in assignment to '$!bar'; expected 'Foo' but got 'Foo'

perl6 -v
This is perl6 version 2015.07.1-12-g174049f built on MoarVM version 2015.07

@p6rt
Copy link
Author

p6rt commented Jul 30, 2015

From @jnthn

On Wed Jul 29 01​:22​:48 2015, lloyd.fourn@​gmail.com wrote​:

MyMod.pm
-----
class Foo {}
#Foo aliased to Bar
sub EXPORT(|){ { 'Bar' => Foo } }

main.pl
----------
use lib 'lib';
use MyMod;

my class Baz {
has Bar $.bar;
}

sub test(Bar $) { say "works!" }

test(Bar.new); #->works!

Baz.new(bar => Bar.new );
#!Type check failed in assignment to '$!bar'; expected 'Foo' but got 'Foo'

perl6 -v
This is perl6 version 2015.07.1-12-g174049f built on MoarVM version 2015.07

Fixed, and test added in S11-modules/export.t.

@p6rt
Copy link
Author

p6rt commented Jul 30, 2015

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

@p6rt
Copy link
Author

p6rt commented Jul 30, 2015

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

@p6rt p6rt closed this as completed Jul 30, 2015
@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
Labels
Projects
None yet
Development

No branches or pull requests

1 participant