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

Date.new(Str) poor error message for digit with diacritic #5421

Closed
p6rt opened this issue Jul 5, 2016 · 5 comments
Closed

Date.new(Str) poor error message for digit with diacritic #5421

p6rt opened this issue Jul 5, 2016 · 5 comments
Labels
LTA Less Than Awesome; typically an error message that could be better uni

Comments

@p6rt
Copy link

p6rt commented Jul 5, 2016

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

Searchable as RT128545$

@p6rt
Copy link
Author

p6rt commented Jul 5, 2016

From zefram@fysh.org

Date.new("2016-07\x[308]-05").perl
Cannot convert string to number​: trailing characters after number in '0^7?' (indicated by ^)
  in block <unit> at <unknown file> line 1

It is quite correct that this should error, but the error message isn't
as good as the one elicited by using a more mundane non-digit​:

Date.new("2016-0z-05").perl
Invalid Date string '2016-0z-05'; use yyyy-mm-dd instead
  in block <unit> at <unknown file> line 1

Obviously this happens because the digit with the diacritic matches /\d/,
so Date.new thinks it's a digit that it can use, but the subsequent
coercion doesn't actually accept it. Either Date.new's syntax checking
needs to get stricter or its coercion needs to get more permissive.

-zefram

@p6rt
Copy link
Author

p6rt commented Sep 7, 2016

From @zoffixznet

So far it appears this issue will be automatically resolved if an unrelated issue is fixed​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=129221

@p6rt
Copy link
Author

p6rt commented Sep 8, 2016

From @zoffixznet

Thanks for the report.

Fixed in rakudo/rakudo@a2b6f74be1
Tests added in Raku/roast@3ed2af4c42

@p6rt
Copy link
Author

p6rt commented Sep 8, 2016

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

@p6rt
Copy link
Author

p6rt commented Sep 8, 2016

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

@p6rt p6rt closed this as completed Sep 8, 2016
@p6rt p6rt added LTA Less Than Awesome; typically an error message that could be better uni labels Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTA Less Than Awesome; typically an error message that could be better uni
Projects
None yet
Development

No branches or pull requests

1 participant