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

BEGIN time error messages lack line numbers #2312

Closed
p6rt opened this issue Dec 31, 2010 · 6 comments
Closed

BEGIN time error messages lack line numbers #2312

p6rt opened this issue Dec 31, 2010 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Dec 31, 2010

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

Searchable as RT81502$

@p6rt
Copy link
Author

p6rt commented Dec 31, 2010

From @moritz

moritz@​jacq​:~/p6/rakudo>./perl6 -e 'BEGIN { a() }'
===SORRY!===
Could not find sub &a
moritz@​jacq​:~/p6/rakudo>./perl6 -e 'a()'
Could not find sub &a
  in main program body at line 1

Any code run at BEGIN time lacks a stack trace, which is rather annoying.

@p6rt
Copy link
Author

p6rt commented May 30, 2013

From @coke

On Fri Dec 31 09​:02​:30 2010, moritz wrote​:

moritz@​jacq​:~/p6/rakudo>./perl6 -e 'BEGIN { a() }'
===SORRY!===
Could not find sub &a
moritz@​jacq​:~/p6/rakudo>./perl6 -e 'a()'
Could not find sub &a
in main program body at line 1

Any code run at BEGIN time lacks a stack trace, which is rather annoying.

Behavior has changed slightly, but is still broken​:

$ perl6 -e 'BEGIN { a() }'
===SORRY!===
Could not find sub &a
$ perl6 -e 'a()'
===SORRY!===
Undeclared routine​:
  a used at line 1

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented May 30, 2013

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

@p6rt
Copy link
Author

p6rt commented Jul 9, 2014

From @Siddhant

On Wed May 29 18​:50​:10 2013, coke wrote​:

On Fri Dec 31 09​:02​:30 2010, moritz wrote​:

moritz@​jacq​:~/p6/rakudo>./perl6 -e 'BEGIN { a() }'
===SORRY!===
Could not find sub &a
moritz@​jacq​:~/p6/rakudo>./perl6 -e 'a()'
Could not find sub &a
in main program body at line 1

Any code run at BEGIN time lacks a stack trace, which is rather annoying.

Behavior has changed slightly, but is still broken​:

$ perl6 -e 'BEGIN { a() }'
===SORRY!===
Could not find sub &a
$ perl6 -e 'a()'
===SORRY!===
Undeclared routine​:
a used at line 1

Behaviour is different on moar and parrot​:

$ perl6-p -e 'BEGIN { a() }'
===SORRY!===
Could not find sub &a
$ perl6-m -e 'BEGIN { a() }'
===SORRY!===
Cannot invoke null object

$ perl6-p --version
This is perl6 version 2014.06-76-g597f35f built on parrot 6.5.0 revision RELEASE_6_5_0
$ perl6-m --version
This is perl6 version 2014.06-76-g597f35f built on MoarVM version 2014.06-55-g55187a1

@p6rt
Copy link
Author

p6rt commented Apr 8, 2015

From @jnthn

On Fri Dec 31 09​:02​:30 2010, moritz wrote​:

moritz@​jacq​:~/p6/rakudo>./perl6 -e 'BEGIN { a() }'
===SORRY!===
Could not find sub &a
moritz@​jacq​:~/p6/rakudo>./perl6 -e 'a()'
Could not find sub &a
in main program body at line 1

Any code run at BEGIN time lacks a stack trace, which is rather annoying.

The one in this ticket now gives the correct compile-time error about an undeclared routine, before even trying to run the code​:

$ perl6-m -e "BEGIN { a() }"
===SORRY!=== Error while compiling -e
Undeclared routine​:
  a used at line 1

Actual errors in the runtime of BEGIN blocks now come with decent amounts of information​:

$ perl6-m -e "BEGIN { die 'oh noes' }"
===SORRY!=== Error while compiling -e
An exception occurred while evaluating a BEGIN
at -e​:1
Exception details​:
  oh noes
  in block at -e​:1

Tested both in S32-exceptions/misc.t.

@p6rt p6rt closed this as completed Apr 8, 2015
@p6rt
Copy link
Author

p6rt commented Apr 8, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant