Skip to content

Fix equivalence check for Date/Time/TimeZone#2291

Merged
Gabriella439 merged 1 commit intomasterfrom
gabriel/fix_time_support
Aug 23, 2021
Merged

Fix equivalence check for Date/Time/TimeZone#2291
Gabriella439 merged 1 commit intomasterfrom
gabriel/fix_time_support

Conversation

@Gabriella439
Copy link
Collaborator

This is fixing a bug where a temporal literal fails to type-check
when given a type annotation (or more generally, when the type-checker
checks it against an expected type).

For example, the expression 00:00:00 : Date would not type-check.

The reason why is that Dhall.Eval.conv was missing cases for
the Date / Time / TimeZone types and their respective literals,
which this change fixes.

I also fixed the test suite to catch future issues like this. We do
have standard tests that check that temporal literals against
expected types, but we were running the tests in such a way that we
were not exercising the Dhall.Eval.conv code path that had this
bug.

So I updated the test suite so that it now catches this issue and
future issues like this. I verified that the updated test suite
now fails without this fix and passes with the fix.

This is fixing a bug where a temporal literal fails to type-check
when given a type annotation (or more generally, when the type-checker
checks it against an expected type).

For example, the expression `00:00:00 : Date` would not type-check.

The reason why is that `Dhall.Eval.conv` was missing cases for
the `Date` / `Time` / `TimeZone` types and their respective literals,
which this change fixes.

I also fixed the test suite to catch future issues like this.  We do
have standard tests that check that temporal literals against
expected types, but we were running the tests in such a way that we
were not exercising the `Dhall.Eval.conv` code path that had this
bug.

So I updated the test suite so that it now catches this issue and
future issues like this.  I verified that the updated test suite
now fails without this fix and passes with the fix.
@Gabriella439
Copy link
Collaborator Author

I also plan to cut a small dhall-1.40.1 release with this fix when it's merged

@Gabriella439 Gabriella439 merged commit c3351ea into master Aug 23, 2021
@Gabriella439 Gabriella439 deleted the gabriel/fix_time_support branch August 23, 2021 20:38
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

Successfully merging this pull request may close these issues.

2 participants

Comments