Ticket #3830 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

weird error message from type qualification mistake

Reported by: guest Owned by:
Priority: normal Milestone:
Component: Compiler Version: 6.10.4
Keywords: Cc:
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: Incorrect warning at compile-time Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description (last modified by simonpj) (diff)

{-# LANGUAGE GADTs, RankNTypes  #-}

data Parity a where
  Odd :: Int -> forall a. Parity (Int,Int,a)

(the "forall a" is in the wrong place) gives the error message

    Malformed constructor result type:
      forall a :: k_a3Gz. Parity (Int, Int, a)

That k_a3Gz. is a little bit cryptic.

--solrize

Attachments

ladt.hs Download (102 bytes) - added by guest 3 years ago.
test case shown above, since wiki formatting messed it up

Change History

Changed 3 years ago by guest

test case shown above, since wiki formatting messed it up

Changed 3 years ago by simonpj

  • status changed from new to closed
  • resolution set to fixed
  • description modified (diff)

Good point. The message from 6.12 is better

T3830.hs:4:3:
    Data constructor `Odd' returns type `forall a.
                                         Parity (Int, Int, a)'
      instead of an instance of its parent type `Parity a'
    In the definition of data constructor `Odd'
    In the data type declaration for `Parity'

Nevertheless, I also added a little more info to HsTyVarBndr to prevent this kind of thing happening again.

Simon

Note: See TracTickets for help on using tickets.