- 
  Notifications
 You must be signed in to change notification settings 
- Fork 61
Add a Day type to provide better handling of day value #35
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
Conversation
Hey @tguichaoua, let me know once this is ready and I'll review it. The change looks like a good improvement, happy to merge it once ready. Thank you! 🙂
@fspoettel 
it should be ready now 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - the only real issue I found are that the tests in the scaffold template do not interpolateDAY_NUMBER yet, so they don't work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The unit tests still have references to DAY which should be DAY_NUMBER now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
advent_of_code::main! creates a const value DAY of type Day.
The DAY in unit tests refer to this const.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha, missed that.
Co-authored-by: Felix Spöttel <1682504+fspoettel@users.noreply.github.com>
Co-authored-by: Felix Spöttel <1682504+fspoettel@users.noreply.github.com>
Co-authored-by: Felix Spöttel <1682504+fspoettel@users.noreply.github.com>
Co-authored-by: Felix Spöttel <1682504+fspoettel@users.noreply.github.com>
Thank you for the contribution! 🙂
Uh oh!
There was an error while loading. Please reload this page.
Introduce a type
Dayto enforce static validity of the value and provide better error message to the user.Before / after example with an invalid value
image
Compile time checked value
image