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

Importing a module with a MAIN sub causes Rakudo to die inappropriately #2369

Closed
p6rt opened this issue Feb 16, 2011 · 5 comments
Closed

Importing a module with a MAIN sub causes Rakudo to die inappropriately #2369

p6rt opened this issue Feb 16, 2011 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Feb 16, 2011

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

Searchable as RT84266$

@p6rt
Copy link
Author

p6rt commented Feb 16, 2011

From @masak

$ cat A.pm
use v6;
sub MAIN {
}

$ cat foo
use v6;
use A;

$ perl6 foo
Method 'chars' not found for invocant of class 'Failure'
  in 'Cool​::substr' at line 2394​:CORE.setting
  in 'process-cmd-args' at line 7489​:CORE.setting
  in <anon> at line 7567​:CORE.setting
  in 'MAIN_HELPER' at line 1
  in main program body at line 1​:A.pm

@p6rt
Copy link
Author

p6rt commented Jan 14, 2014

From @coke

On Wed Feb 16 15​:14​:08 2011, masak wrote​:

$ cat A.pm
use v6;
sub MAIN {
}

$ cat foo
use v6;
use A;

$ perl6 foo
Method 'chars' not found for invocant of class 'Failure'
in 'Cool​::substr' at line 2394​:CORE.setting
in 'process-cmd-args' at line 7489​:CORE.setting
in <anon> at line 7567​:CORE.setting
in 'MAIN_HELPER' at line 1
in main program body at line 1​:A.pm

This now completes without error. Closable with tests.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Jan 14, 2014

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

@p6rt
Copy link
Author

p6rt commented Jan 15, 2014

From @coke

On Tue Jan 14 13​:43​:50 2014, coke wrote​:

On Wed Feb 16 15​:14​:08 2011, masak wrote​:

$ cat A.pm
use v6;
sub MAIN {
}

$ cat foo
use v6;
use A;

$ perl6 foo
Method 'chars' not found for invocant of class 'Failure'
in 'Cool​::substr' at line 2394​:CORE.setting
in 'process-cmd-args' at line 7489​:CORE.setting
in <anon> at line 7567​:CORE.setting
in 'MAIN_HELPER' at line 1
in main program body at line 1​:A.pm

This now completes without error. Closable with tests.

A test for a condition very much like this is in S06-other/main. t- it makes sure that the external file loads and that MAIN isn't run. Calling that sufficient, closing ticket.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Jan 15, 2014

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