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 does not validate month and day ranges if passed as named arguments #5877

Closed
p6rt opened this issue Dec 11, 2016 · 4 comments
Closed
Labels
Bug LHF Low-hanging fruit, easy to resolve regression Issue did not exist previously

Comments

@p6rt
Copy link

p6rt commented Dec 11, 2016

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

Searchable as RT130313$

@p6rt
Copy link
Author

p6rt commented Dec 11, 2016

From @moritz

< moritz> m​: say Date.new('2017-02-29')
<+camelia> rakudo-moar 8d4dbb​: OUTPUT«Day out of range. Is​: 29, should be
  in 1..28␤ in block <unit> at <tmp> line 1␤␤»
< moritz> m​: say Date.new(year => 2017, month => 42, day => 29)
<+camelia> rakudo-moar 8d4dbb​: OUTPUT«2017-42-29␤»

All constructor variants should do the same bounds checking for month
and day.

An automatic bisect [1] identified this commit [2] as the culprit.

[1] https://gist.github.com/Whateverable/7e080e976a205a729d77e335428f8f6b
[2]
rakudo/rakudo@585619f

--
Moritz Lenz
https://deploybook.com/ -- https://perlgeek.de/ -- https://perl6.org/

@p6rt
Copy link
Author

p6rt commented Dec 12, 2016

From @zoffixznet

On Sun, 11 Dec 2016 11​:52​:40 -0800, moritz wrote​:

< moritz> m​: say Date.new('2017-02-29')
<+camelia> rakudo-moar 8d4dbb​: OUTPUT«Day out of range. Is​: 29, should
be
in 1..28␤ in block <unit> at <tmp> line 1␤␤»
< moritz> m​: say Date.new(year => 2017, month => 42, day => 29)
<+camelia> rakudo-moar 8d4dbb​: OUTPUT«2017-42-29␤»

All constructor variants should do the same bounds checking for month
and day.

An automatic bisect [1] identified this commit [2] as the culprit.

[1]
https://gist.github.com/Whateverable/7e080e976a205a729d77e335428f8f6b
[2]
rakudo/rakudo@585619f

Thank you for the report. This is now fixed \o/

Fix​: rakudo/rakudo@aa27d5ce94
Tests​: Raku/roast@fecfa6518b

@p6rt
Copy link
Author

p6rt commented Dec 12, 2016

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

@p6rt p6rt closed this as completed Dec 12, 2016
@p6rt
Copy link
Author

p6rt commented Dec 12, 2016

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

@p6rt p6rt added Bug LHF Low-hanging fruit, easy to resolve regression Issue did not exist previously labels Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug LHF Low-hanging fruit, easy to resolve regression Issue did not exist previously
Projects
None yet
Development

No branches or pull requests

1 participant