• Michael Sloan's avatar
    Add a broken test for lingering state from TH unique names #9693 · fbe162f5
    Michael Sloan authored
    The stderr output is
    Loading with T9693_initial.hs
        Same exact name in multiple name-spaces:
          type constructor or class ‘X’, declared at: T9693_main.hs:4:1
          data constructor ‘X’, declared at: T9693_main.hs:4:1
          Probable cause: you bound a unique Template Haskell name (NameU),
          perhaps via newName, in different name-spaces.
          If that's it, then -ddump-splices might be useful
    Reloading with T9693_modified.hs
        Data constructor ‘X’ used as a type constructor
    The strange thing is that the modified version uses (mkName "X"), which should
    be fine for simultaneous use in both a data constructor and type constructor.
    Indeed, on a fresh load, the modified version works fine. So there is some sort
    of state left over from the prior load when (newName "X") was used.
    Test Plan: testsuite/tests/th/T9693.script
    Reviewers: bgamari, sighingnow, RyanGlScott
    Reviewed By: sighingnow, RyanGlScott
    Subscribers: RyanGlScott, sighingnow, rwbarton, thomie, carter
    Differential Revision: https://phabricator.haskell.org/D4926
all.T 18.6 KB