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 unbound variable bug #134

Merged
merged 2 commits into from Sep 14, 2017

Conversation

Projects
None yet
2 participants
@Gabriel439
Collaborator

Gabriel439 commented Sep 13, 2017

Related to #10

When type-checking the following expression:

let Day : Type = Natural in λ(x : Day)  x

... Dhall had a bug where it would add Day : Type to the context when
inferring the type of λ(a : Day) → x (which is ∀(x : Day) → Day), but Day
was missing from the context when inferring the kind of ∀(x : Day) → Day,
leading to an unbound variable error

This change fixes the bug and adds a regression test to prevent the bug from
recurring

Fix unbound variable bug
Related to #10

When type-checking the following expression:

```haskell
let Day : Type = Natural in λ(x : Day) → x
```

... Dhall had a bug where it would add `Day : Type` to the context when
inferring the type of `λ(a : Day) → x` (which is `∀(x : Day) → Day`), but `Day`
was missing from the context when inferring the kind of `∀(x : Day) → Day`,
leading to an unbound variable error

This change fixes the bug and adds a regression test to prevent the bug from
recurring
Show outdated Hide outdated tests/Regression.hs
@Gabriel439

This comment has been minimized.

Show comment
Hide comment
@Gabriel439

Gabriel439 Sep 13, 2017

Collaborator

Whoops! You can tell I was in a hurry and couldn't run tests locally this morning :)

Collaborator

Gabriel439 commented Sep 13, 2017

Whoops! You can tell I was in a hurry and couldn't run tests locally this morning :)

@bosu bosu merged commit 6bbff51 into master Sep 14, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment