Skip to content

HasCallStack doesn't work with QualifiedDo or RebindableSyntax

Summary

>> and such called by QualifiedDo aren't given callstacks.

Steps to reproduce

module Do ((Do.>>)) where

  import GHC.Stack (HasCallStack, callStack, prettyCallStack)

  (>>) :: HasCallStack => String -> String -> String
  _ >> _ = prettyCallStack callStack

module Main where

  import qualified Do

  x :: String
  x = Do.do
    "ddd"
    "fff"

  y :: String
  y = "ddd" Do.>> "fff"

y and x are not equal, which is a bug. The same also happens without QualifiedDo and with RebindableSyntax instead.

Expected behavior

x and y should be equal, modulo the src loc in the callstack.

Environment

  • GHC version used: 9.2.4
Edited by Las Safin
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information