[GHC] #15648: Core Lint error with source-level unboxed equality
GHC
ghc-devs at haskell.org
Tue Sep 18 23:24:04 UTC 2018
#15648: Core Lint error with source-level unboxed equality
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone: 8.8.1
Component: Compiler | Version: 8.4.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Compile-time | Unknown/Multiple
crash or panic | Test Case:
Blocked By: | Blocking:
Related Tickets: #15209 | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by RyanGlScott):
Replying to [comment:1 goldfire]:
> 1. Why does GHC type check `Jank` at type `JankyEquality a b`? There
must be something in the type checker which treats arguments of type `a ~#
b` as invisible. But these shouldn't be -- they are not `Constraint`s. To
fix: find this code and kill it.
I think there is a simpler explanation for why this happens: when we kind-
check the type `(a ~# b) -> c`, everything works since `(->)` is levity
polymorphic and `a ~# b` has kind `TYPE (TupleRep '[])`. This means that
resulting `Type` is `FunTy (TyConApp (~#) [TyVarTy a, TyVarTy b]) (TyVarTy
c)`—which GHC believes to be `(a ~# b) => c`—so things like `Jank` are
seemingly typechecked as if the value of type `a ~# b` were invisible.
From a certain perspective, this is a natural consequence of making `a ~#
b` have kind `TYPE (TupleRep '[])`. This suggests that one way to work
around this issue would be to change its kind.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15648#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list