Opened 12 months ago

Closed 9 months ago

#14544 closed bug (fixed)

doCorePass has at least one missing case

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

Description

There is a catch all at the end of doCorePass which hides the fact that doCorePass should be total. In particular doCorePass is not implemented for CoreOccurAnal and so either CoreOccurAnal should be removed from CoreToDo or implemented properly in doCorePass.

Change History (4)

comment:1 Changed 9 months ago by sjakobi

There are more missing cases: CoreDesugar, CoreDesugarOpt, CoreTidy, CorePrep, and – depending on CPP – CoreDoPluginPass.

Deleting the CoreOccurAnal constructor would be easy, but the other ones are actually in use.

A first step might be to expand the catch-all to make sure that additional constructors aren't forgotten in the same way.

comment:2 in reply to:  1 Changed 9 months ago by sjakobi

Differential Rev(s): Phab:D4435

Replying to sjakobi:

A first step might be to expand the catch-all to make sure that additional constructors aren't forgotten in the same way.

Addressed in the attached Diff.

comment:3 Changed 9 months ago by Ben Gamari <ben@…>

In 44ba60fe/ghc:

doCorePass: Expand catch-all

This doesn't remedy problem, but at least it's more explicit than
the catch-all

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #14544

Differential Revision: https://phabricator.haskell.org/D4435

comment:4 Changed 9 months ago by bgamari

Milestone: 8.6.1
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.