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

Autovivifcation in 'use' directives #1952

Closed
p6rt opened this issue Jul 20, 2010 · 6 comments
Closed

Autovivifcation in 'use' directives #1952

p6rt opened this issue Jul 20, 2010 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Jul 20, 2010

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

Searchable as RT76606$

@p6rt
Copy link
Author

p6rt commented Jul 20, 2010

From @ashgti

Autovivifcation works in a single file, but if you try to do it across files
and use 'use Name' to import an object it doesn't work​:

john@​Strudel /tmp $ cat t.pm
class foo​::a {
};

class foo {
};

say 'done'

john@​Strudel /tmp $ perl6 t.pm

done

That worked as expected​:

john@​Strudel /tmp $ cat foo.pm
use foo​::a;
class foo {
}
john@​Strudel /tmp $ cat foo/a.pm
class foo​::a {
};
john@​Strudel /tmp $ perl6 -e 'use foo'
===SORRY!===
Illegal redeclaration of symbol 'foo'

if you change foo.pm to be​:
class foo {...};
use foo​::a;
class foo {
}

it will work fine, no illegal redeclaration of symbol error.

--
John Harrison

@p6rt
Copy link
Author

p6rt commented Oct 22, 2011

From @coke

On Tue Jul 20 11​:36​:38 2010, ash_gti wrote​:

Autovivifcation works in a single file, but if you try to do it across files
and use 'use Name' to import an object it doesn't work​:

john@​Strudel /tmp $ cat t.pm
class foo​::a {
};

class foo {
};

say 'done'

john@​Strudel /tmp $ perl6 t.pm

done

That worked as expected​:

john@​Strudel /tmp $ cat foo.pm
use foo​::a;
class foo {
}
john@​Strudel /tmp $ cat foo/a.pm
class foo​::a {
};
john@​Strudel /tmp $ perl6 -e 'use foo'
===SORRY!===
Illegal redeclaration of symbol 'foo'

if you change foo.pm to be​:
class foo {...};
use foo​::a;
class foo {
}

it will work fine, no illegal redeclaration of symbol error.

--
John Harrison

This works now​:

$ cat foo/a.pm
class foo​::a {
};
$ cat foo.pm
use foo​::a;
class foo {
}
say "alive";
$ ./perl6 foo.pm
alive

Closable with tests.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Oct 22, 2011

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

@p6rt
Copy link
Author

p6rt commented Oct 22, 2014

From @usev6

I added a test to S10-packages/basic.t with commit Raku/roast@698a635b43

I'm closing this ticket now.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 22, 2014

From @usev6

I added a test to S10-packages/basic.t with commit Raku/roast@698a635b43

I'm closing this ticket now.

@p6rt
Copy link
Author

p6rt commented Oct 22, 2014

@usev6 - 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