Type-level skolem capture leads to core lint error
The following ill-typed code is accepted.
{-# LANGUAGE PolyKinds, RankNTypes #-}
module Bug where
data SameKind :: k -> k -> *
foo :: forall b. (forall (a :: k). SameKind a b) -> ()
foo = undefined
Indeed, Core Lint catches this. But the type-checker should. The problem is that SameKind forces a and b to have the same kind. But they can't, because a's kind is out of scope at b's binding site. The program should be rejected.
Trac metadata
| Trac field | Value |
|---|---|
| Version | 7.10.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |