$ bin/007 -e='say("foo".substr(4, 2))'
Earlier failure:
(HANDLED) Start argument to substr out of range. Is: 4, should be in 0..3; use *-4 if you want to index relative to the end
in sub substr at /home/masak/ours/007/lib/_007/Runtime.pm6 (_007::Runtime) line 409
in method call at /home/masak/ours/007/lib/_007/Runtime.pm6 (_007::Runtime) line 231
in method eval at /home/masak/ours/007/lib/_007/Q.pm6 (_007::Q) line 628
in method eval at /home/masak/ours/007/lib/_007/Q.pm6 (_007::Q) line 1
in method run at /home/masak/ours/007/lib/_007/Q.pm6 (_007::Q) line 849
in method run at /home/masak/ours/007/lib/_007/Q.pm6 (_007::Q) line 1062
in method run at /home/masak/ours/007/lib/_007/Runtime.pm6 (_007::Runtime) line 37
in block at bin/007 line 16
in sub run_007 at bin/007 line 47
in sub MAIN at bin/007 line 66
in block <unit> at bin/007 line 23
Final error:
Type check failed in assignment to $!value; expected Str but got Failure (&CORE::infix:<orelse>...)
in sub substr at /home/masak/ours/007/lib/_007/Runtime.pm6 (_007::Runtime) line 409
in method call at /home/masak/ours/007/lib/_007/Runtime.pm6 (_007::Runtime) line 231
in method eval at /home/masak/ours/007/lib/_007/Q.pm6 (_007::Q) line 628
in method eval at /home/masak/ours/007/lib/_007/Q.pm6 (_007::Q) line 1
in method run at /home/masak/ours/007/lib/_007/Q.pm6 (_007::Q) line 849
in method run at /home/masak/ours/007/lib/_007/Q.pm6 (_007::Q) line 1062
in method run at /home/masak/ours/007/lib/_007/Runtime.pm6 (_007::Runtime) line 37
in block at bin/007 line 16
in sub run_007 at bin/007 line 47
in sub MAIN at bin/007 line 66
in block <unit> at bin/007 line 23
I believe we might be missing a test for this case. Needless to say, there should be a 007-generated error here, not... whatever it is that happens above.
This is quite a spectacular error message:
I believe we might be missing a test for this case. Needless to say, there should be a 007-generated error here, not... whatever it is that happens above.