haskell / haskell-ide-engine

The engine for haskell ide-integration. Not an IDE
BSD 3-Clause "New" or "Revised" License
2.38k stars 213 forks source link

'id' has the wrong type in HIE #1744

Closed expipiplus1 closed 4 years ago

expipiplus1 commented 4 years ago

When reified in a TH splice it has the type forall a. b -> c

Using this TH splice to print the info for id I get different results in HIE compared to ghci or cabal build

idInfo :: Q [Dec]
idInfo = do
  idInfo <- reify 'id
  runIO $ writeFile "idInfo" (show idInfo)
  pure []

hie's version (where did a_283715364993 and a_283589853497 come from, and why are they different?!:

VarI
  GHC.Base.id
  (ForallT
     [ KindedTV a_283531855113 StarT ]
     []
     (AppT (AppT ArrowT (VarT a_283715364993)) (VarT a_283589853497)))
  Nothing

The expected output

VarI
  GHC.Base.id
  (ForallT
     [ KindedTV a_6989586621679079338 StarT ]
     []
     (AppT
        (AppT ArrowT (VarT a_6989586621679079338))
        (VarT a_6989586621679079338)))
  Nothing
expipiplus1 commented 4 years ago

Repro here: https://github.com/expipiplus1/hie-reload-example/tree/reify

It happens for me on 865 and 882

expipiplus1 commented 4 years ago

Repro improved https://github.com/expipiplus1/hie-reload-example/tree/reify

It now demonstrates the difference between hie-bios compiled with the haskell.nix infra and the nixpkgs infra.

wz1000 commented 4 years ago

hie-bios/ghc/nix bug trackers would be a better place for this report.

expipiplus1 commented 4 years ago

yeah, I've opened an issue against haskell.nix which seems at the moment to be the point of diverging behaviour: https://github.com/input-output-hk/haskell.nix/issues/553