Ticket #220 (new bug report)

Opened 6 years ago

Last modified 6 years ago

Parse error when TypeFamilies and ConstraintKinds collide

Reported by: NeilMitchell Owned by: nibro
Priority: major Milestone:
Component: parser Version:
Keywords: Cc: NeilMitchell


An HLint user reported: http://code.google.com/p/ndmitchell/issues/detail?id=543

» cat ParseError.hs                                                                                                                                     {-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ConstraintKinds #-}
class Foo a where type Bar a
type Bazable a b = (Bar a ~ Maybe b)
baz :: Bazable a b => a -> a
baz = id

Gives: Parse error in type: Bar a ~ Maybe b

The failure only occurs when I have a ~ constraint in a constraint kind. ~ constraints normally work, and constraint kinds normally work, but together HSE explodes.

Change History

Changed 6 years ago by NeilMitchell

  • cc NeilMitchell added
Note: See TracTickets for help on using tickets.