[GHC] #13775: Type family expansion is too lazy, allows accepting of ill-typed terms
GHC
ghc-devs at haskell.org
Mon Jun 5 09:18:17 UTC 2017
#13775: Type family expansion is too lazy, allows accepting of ill-typed terms
-------------------------------------+-------------------------------------
Reporter: fizruk | Owner: diatchki
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler (Type | Version: 8.0.2
checker) | Keywords:
Resolution: | CustomTypeErrors
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: |
-------------------------------------+-------------------------------------
Changes (by simonpj):
* owner: (none) => diatchki
Comment:
This is really a question for Iavor, who implemented user-specified type
errors. The [http://downloads.haskell.org/~ghc/master/users-
guide/glasgow_exts.html#custom-compile-time-errors user manual section on
custom errors] does not explain the behaviour of the feature (except with
a single example), and need some serious love.
What is happening is this:
* GHC only reports custom type errors if
* We have an ''unsolved'' constraint involving `TypeError`
* We have a declared or inferred type involving `TypeError`
* We get a constraint `Show (Proxy (TypeError "..."))`.
* But the instance for `Proxy` is
{{{
instance Show (Proxy s) where ...
}}}
so the `TypeError...` is discarded.
* All constraints are solved, so no error is reported.
Iavor: you may want to consider being more aggressive? Or at least
documenting the expected behaviour better. Thanks!
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13775#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list