[GHC] #14710: GHC 8.4.1-alpha allows the use of kind polymorphism without PolyKinds
GHC
ghc-devs at haskell.org
Fri Jan 26 19:06:25 UTC 2018
#14710: GHC 8.4.1-alpha allows the use of kind polymorphism without PolyKinds
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner: (none)
Type: bug | Status: new
Priority: high | Milestone: 8.4.1
Component: Compiler (Type | Version: 8.4.1-alpha1
checker) |
Resolution: | Keywords: PolyKinds
Operating System: Unknown/Multiple | Architecture:
Type of failure: GHC accepts | Unknown/Multiple
invalid program | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by goldfire):
You'll need to make a few changes to fix this:
- `TcHsType.tcLHsKindSig` should really call `checkValidType`. This was an
oversight from likely long ago.
- The `tc_infer_hs_type` case that deals with `HsKindSig` should, in turn,
use `tcLHsKindSig`.
- `checkValidType` will need to know whether it's checking a kind. If it
is, and if `-XPolyKinds` isn't on (which is implied by `-XTypeInType`, so
you don't need a separate `-XTypeInType` check), then complain about
variables.
Alternatively, you could conceivably catch this in the renamer.
`RnTypes.rnHsTyKi` knows when it's renaming a kind (vs. a type). In the
`HsTyVar` case, you could bleat with `-XNoPolyKinds` and spotting a
variable whose name is in the type variable namespace (as opposed to a
tycon, recalling tat `HsTyVar` includes both).
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14710#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list