Skip to content
Snippets Groups Projects
Commit f903e551 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Fix corner case in typeKind, plus refactoring

This is a continuation of

    commit 9d600ea6
    Author: Simon Peyton Jones <simonpj@microsoft.com>
    Date:   Fri Jun 1 16:36:57 2018 +0100

        Expand type synonyms when Linting a forall

That patch pointed out that there was a lurking hole in
typeKind, where it could return an ill-scoped kind, because
of not expanding type synonyms enough.

This patch fixes it, quite nicely

* Use occCheckExpand to expand those synonyms (it was always
  designed for that exact purpose), and call it from
         Type.typeKind
         CoreUtils.coreAltType
         CoreLint.lintTYpe

* Consequently, move occCheckExpand from TcUnify.hs to
  Type.hs, and generalise it to take a list of type variables.

I also tidied up lintType a bit.
parent 807ab222
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment