Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Add implicit param HasCallStack to assertions #1421
The error message is not easy to localize since it points to the module and line number where the assertion is defined instead of the place where it is called.
Adding HasCallStack to each assertion fix the error message since it passes the CallStack to the HUnit matchers used by
@snoyberg thank you for the comment. I guess I could copy some of the content (just
#if MIN_VERSION_base(4,8,1) import qualified GHC.Stack as GHC #endif #if MIN_VERSION_base(4,9,0) import GHC.Stack (HasCallStack) #elif MIN_VERSION_base(4,8,1) type HasCallStack = (?callStack :: GHC.CallStack) #else import GHC.Exts (Constraint) type HasCallStack = (() :: Constraint) #endif type CallStack = [(String, SrcLoc)] callStack :: HasCallStack => CallStack #if MIN_VERSION_base(4,9,0) callStack = drop 1 $ GHC.getCallStack GHC.callStack #elif MIN_VERSION_base(4,8,1) callStack = drop 2 $ GHC.getCallStack ?callStack #else callStack =  #endif
However, I'm actually exposing a hidden package rather than adding a new dependency since