Skip to content

Fix linting of unused type variables - #3464

Merged
LiamGoodacre merged 1 commit into
purescript:masterfrom
LiamGoodacre:fix/linting-unused-type-vars
Dec 2, 2018
Merged

Fix linting of unused type variables#3464
LiamGoodacre merged 1 commit into
purescript:masterfrom
LiamGoodacre:fix/linting-unused-type-vars

Conversation

@LiamGoodacre

Copy link
Copy Markdown
Member

Fixes #3380

The original algorithm didn't appear to be caring about the scope of type variables introduced with forall - it just asked for "all the type variables" that appear in some type.

This PR changes this so it walks the type and respects variable scope.

With the following code:

type X a =
  { a :: forall f. f a
  , b :: forall f. a
  }

type Y a =
  { a :: forall g. g a
  , b :: forall h. a
  }

Output diff (trimmed):

+   Type variable f is ambiguous...
    Type variable h is ambiguous...

@LiamGoodacre
LiamGoodacre merged commit d9b1620 into purescript:master Dec 2, 2018
@LiamGoodacre

Copy link
Copy Markdown
Member Author

Thanks for the review @garyb

@LiamGoodacre
LiamGoodacre deleted the fix/linting-unused-type-vars branch December 2, 2018 17:19
@garyb garyb mentioned this pull request Jan 12, 2019
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants