Opened 17 months ago

Last modified 16 months ago

#15084 new bug

Functions in HsUtils don't have the most general type

Reported by: mpickering Owned by:
Priority: high Milestone: 8.6.1
Component: Compiler Version: 8.2.2
Keywords: Cc: alanz
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

In 1aa1d405d8212a99ac24dcfd48024a17c3ffd296 the types of a lot of functions in HsUtils was changed and now they are too restrictive. For example, nlHsfunTy has the following type.

nlHsFunTy :: LHsType (GhcPass p) -> Rig -> LHsType (GhcPass p) -> LHsType (GhcPass p)

It should instead be given the more general type which will allow it to work as before in many situations.

nlHsFunTy :: (XFunTy p ~ PlaceHolder) => LHsType p -> Rig -> LHsType p -> LHsType p

Change History (6)

comment:1 Changed 17 months ago by simonpj

Alan/Shayan should say, but I think using GhcPass p rather than p might do the job more simply

comment:2 Changed 17 months ago by mpickering

It breaks downstream consumers such as Haddock which ends up with LHsType DocStringI.

comment:3 Changed 17 months ago by alanz

Cc: alanz added

comment:4 Changed 16 months ago by bgamari

We should try to sort this out. Alanz, is Matthew's suggested type okay with you?

comment:5 Changed 16 months ago by alanz

Yes, I am fine with this.

comment:6 Changed 16 months ago by bgamari

Yikes, there are a lot of these.

Do we really want to generalize everything in this module? These constraints are going to get quite noisy. Yuck.

I hate to suggest that users shouldn't be using HsUtils, but perhaps it's the more pragmatic option.

Last edited 16 months ago by bgamari (previous) (diff)
Note: See TracTickets for help on using tickets.