Skip to content

Add conditional CallStack constraints to common partial utility functions

There are a variety of common utility functions used throughout GHC which are partial (e.g. many of the helpers in Type, for instance, kindPrimRep). It would be great if [ImplicitCallStacks] would identify their callers. However, we likely don't want to pay the cost of passing around CallStacks during normal compilation so I propose we make them conditional on DEBUG. That is, define

#if DEBUG
type DebugCallStack = CallStack
#else
type DebugCallStack = (() :: Constraint)
#endif

Now we can sprinkle DebugCallStack constraints about GHC and get the best of both worlds!

Trac metadata
Trac field Value
Version 8.0.1
Type Task
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information