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

fix index in MismatchedListElements #1448

Merged

Conversation

philandstuff
Copy link
Contributor

If you run dhall --explain to explain a type error from a list with
mismatched elements, the index of the offending term was wrong. For a
minimal example, you can run:

dhall --explain <<<'[0, True]'

The problem is that i is an index into the tail of the list, not into
the whole list. The fix is just to add one to it to correct for the
missing head.

If you run `dhall --explain` to explain a type error from a list with
mismatched elements, the index of the offending term was wrong.  For a
minimal example, you can run:

    dhall --explain <<<'[0, True]'

The problem is that `i` is an index into the tail of the list, not into
the whole list.  The fix is just to add one to it to correct for the
missing head.
Copy link
Collaborator

@sjakobi sjakobi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! 👍

@mergify mergify bot merged commit 1fed252 into dhall-lang:master Oct 20, 2019
@philandstuff philandstuff deleted the fix-mismatched-list-explanation branch October 20, 2019 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants