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.
Showing
- compiler/coreSyn/CoreLint.hs 16 additions, 21 deletionscompiler/coreSyn/CoreLint.hs
- compiler/coreSyn/CoreUtils.hs 6 additions, 6 deletionscompiler/coreSyn/CoreUtils.hs
- compiler/typecheck/TcFlatten.hs 2 additions, 3 deletionscompiler/typecheck/TcFlatten.hs
- compiler/typecheck/TcUnify.hs 5 additions, 148 deletionscompiler/typecheck/TcUnify.hs
- compiler/types/Coercion.hs-boot 1 addition, 0 deletionscompiler/types/Coercion.hs-boot
- compiler/types/Type.hs 162 additions, 11 deletionscompiler/types/Type.hs
Loading
Please register or sign in to comment