[GHC] #5763: Confusing error message

GHC ghc-devs at haskell.org
Thu Nov 27 02:35:19 UTC 2014


#5763: Confusing error message
-------------------------------------+-------------------------------------
              Reporter:  simonpj     |            Owner:  simonpj
                  Type:  bug         |           Status:  new
              Priority:  normal      |        Milestone:  7.10.1
             Component:  Compiler    |          Version:  7.2.2
            Resolution:              |         Keywords:
      Operating System:              |     Architecture:  Unknown/Multiple
  Unknown/Multiple                   |       Difficulty:  Unknown
       Type of failure:              |       Blocked By:
  None/Unknown                       |  Related Tickets:
             Test Case:  indexed-    |
  types/should_fail/T5763            |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by thomie):

 Is this problem solved?

 `T4272` doesn't show the `Occurs check` message anymore (as also noted by
 SPJ in da71a9524ffff0865222127bef09fd04a1359a53), but maybe this is
 incidental? I can not find test `T5763` anywhere, so I'll leave this open
 for now.

 Output of running the command "git show
 0b3c3c81792c88ee40687f86bed4935e721dabe0 testsuite/tests/indexed-
 types/should_fail/T4272.stderr":

 {{{
 Author: Dimitrios.Vytiniotis <>
 Date:   Wed Apr 4 14:41:11 2012 +0100

     Error message modifications following ghc-new-solver modifications

 diff --git a/testsuite/tests/indexed-types/should_fail/T4272.stderr
 b/testsuite/tests/indexed-types/should_fail/T4272.stderr
 index 24f0cbd..e809d9c 100644
 --- a/testsuite/tests/indexed-types/should_fail/T4272.stderr
 +++ b/testsuite/tests/indexed-types/should_fail/T4272.stderr
 @@ -1,29 +1,6 @@

 -T4272.hs:11:16:
 -    Couldn't match type `TermFamily (TermFamily x0 x0)'
 -                  with `TermFamily x0'
 -    NB: `TermFamily' is a type function, and may not be injective
 -    The type variable `x0' is ambiguous
 -    Possible fix: add a type signature that fixes these type variable(s)
 -    Expected type: TermFamily x0 x0
 -      Actual type: TermFamily a a
 -    In the first argument of `prune', namely `t'
 -    In the expression: prune t (terms (undefined :: TermFamily a a))
 -    In an equation for `laws':
 -        laws t = prune t (terms (undefined :: TermFamily a a))
 -
 -T4272.hs:11:16:
 -    Occurs check: cannot construct the infinite type:
 -      x0 = TermFamily x0 x0
 -    Expected type: TermFamily x0 x0
 -      Actual type: TermFamily a a
 -    In the first argument of `prune', namely `t'
 -    In the expression: prune t (terms (undefined :: TermFamily a a))
 -    In an equation for `laws':
 -        laws t = prune t (terms (undefined :: TermFamily a a))
 -
 -T4272.hs:11:19:
 -    Could not deduce (a ~ TermFamily x0 x0)
 +T4272.hs:11:26:
 +    Could not deduce (a ~ TermFamily a a)
      from the context (TermLike a)
        bound by the type signature for
                   laws :: TermLike a => TermFamily a a -> b
 @@ -31,7 +8,10 @@ T4272.hs:11:19:
        `a' is a rigid type variable bound by
            the type signature for laws :: TermLike a => TermFamily a a ->
 b
            at T4272.hs:10:16
 -    In the return type of a call of `terms'
 +    Expected type: TermFamily a (TermFamily a a)
 +      Actual type: TermFamily a a
 +    In the first argument of `terms', namely
 +      `(undefined :: TermFamily a a)'
      In the second argument of `prune', namely
        `(terms (undefined :: TermFamily a a))'
      In the expression: prune t (terms (undefined :: TermFamily a a))
 }}}

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


More information about the ghc-tickets mailing list