[GHC] #7220: Confusing error message in type checking related to type family, fundep, and higher-rank type

GHC ghc-devs at haskell.org
Tue Nov 11 10:36:09 UTC 2014


#7220: Confusing error message in type checking related to type family, fundep,
and higher-rank type
-------------------------------------+-------------------------------------
              Reporter:  tsuyoshi    |            Owner:  simonpj
                  Type:  bug         |           Status:  closed
              Priority:  normal      |        Milestone:  7.8.1
             Component:  Compiler    |          Version:  7.6.1-rc1
  (Type checker)                     |         Keywords:
            Resolution:  fixed       |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:              |  Related Tickets:
  None/Unknown                       |
             Test Case:              |
  typecheck/should_fail/T7220        |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 Richard's fix for #9404 makes this compile.  He says:

 The reason this went wrong before is that the old method of inferring a
 type would get caught when unifying a `TauTv` (the metavariable given as
 the guess for `f`'s type) with a polytype, deferring to the solver. If we
 defer, then we don't have enough information to type-check `u`
 successfully, and we fail.
 With the new inferring types with `PolyTv`, no deferring happens, and `u`
 type-checks fine.

 But with the #9404 fix, `f` is inferred to have the type as given. Then,
 `u` is checked (by `tcPolyExprNC`) to have the argument type of `f`, which
 it does. No problems.

 I actually think that success is the right behavior here, so I chalk this
 up to a success of this patch.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/7220#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list