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

Can't declare a class A after importing a file which defines a type A::B in Rakudo #1853

Closed
p6rt opened this issue Jun 18, 2010 · 6 comments
Closed

Comments

@p6rt
Copy link

p6rt commented Jun 18, 2010

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

Searchable as RT75852$

@p6rt
Copy link
Author

p6rt commented Jun 18, 2010

From @masak

$ cat A/B.pm
class A​::B {}

$ perl6 -e 'use A​::B; class A {}'
===SORRY!===
Illegal redeclaration of symbol 'A'

$ perl6 -e 'class A​::B {}; class A {}; say "alive"'
alive

In the failing program, if 'class A​::B {}' is replaced by 'role A​::B
{}', things still fail. If the '{}' is replaced by a semicolong,
things still fail. However, if 'class A' is replaced by 'role A',
things work.

@p6rt
Copy link
Author

p6rt commented Jun 18, 2010

From @masak

<pmichaud> workaround​: class A { ... }; use A​::B; class A { # definitions } # maybe?
<pmichaud> where the ... is literal here
<masak> yes, it worked. pmichaud++
* masak adds the workaround to the RT ticket

@p6rt
Copy link
Author

p6rt commented Jun 18, 2010

@masak - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jan 11, 2012

From @coke

On Fri Jun 18 07​:36​:28 2010, masak wrote​:

$ cat A/B.pm
class A​::B {}

$ perl6 -e 'use A​::B; class A {}'
===SORRY!===
Illegal redeclaration of symbol 'A'

$ perl6 -e 'class A​::B {}; class A {}; say "alive"'
alive

In the failing program, if 'class A​::B {}' is replaced by 'role A​::B
{}', things still fail. If the '{}' is replaced by a semicolong,
things still fail. However, if 'class A' is replaced by 'role A',
things work.

This works now​:

$ cat A/B.pm
class A​::B {}
$ ./perl6 -e 'use A​::B; class A {}; say "alive"'
alive

Closable with tests.
--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Feb 3, 2012

From @moritz

This is tested in t/spec/S10-packages/joined-namespaces.t.

@p6rt
Copy link
Author

p6rt commented Feb 3, 2012

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

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

1 participant