Ticket #37 (closed bug report: fixed)

Opened 5 years ago

Last modified 5 years ago

Multiple contexts are mis-handled

Reported by: nibro Owned by: nibro
Priority: major Milestone: Full code support
Component: parser Version: 0.5.4
Keywords: Cc:

Description

HSE complains about multiple class contexts in type signatures.

multipleCtx :: Eq a => Show a => a
multipleCtx = undefined

This should be accepted if explicit forall is enabled by any extension. HSE rejects it regardless of flags.

However, if the second context is parenthesised, i.e.

multipleCtxt :: Eq a => (Show a => a)

then HSE accepts it even without e.g. Rank2Types.

HSE's behavior should be the same with or without the parenthesis, and should exclude the type in both cases with no flags, and accept it in both cases when Rank2Types is not on.

Change History

Changed 5 years ago by nibro

  • status changed from new to assigned

As an update, I've now fixed it so that the second version (with parentheses) is accepted when e.g. Rank2Types is enabled, but not when it isn't. After digging in GHC a bit, I think the first version (without parentheses) is a bug, and should not parse correctly at all. I have posted a message to the ghc-users list asking for input on this, before I close this as fixed.

Changed 5 years ago by nibro

  • status changed from assigned to closed
  • resolution set to fixed

The news is that it should be allowed without the parentheses, so I've changed the production to allow chained ctypes. Case closed.

Note: See TracTickets for help on using tickets.