Skip to content

:type-at/:all-types and :r don't mix

Steps to reproduce:

  1. Put x = () in test.hs.
  2. Start ghci.
  3. Turn on collection with :set +c.
  4. Load the file with :l test.hs.
  5. Observe the following output from :all-types
test.hs:(1,1)-(1,2): ()
test.hs:(1,5)-(1,7): ()
  1. While ghci is still open, modify the file to say x = True.
  2. In the same ghci session as before, reload with :r, or load the file again with :l test.hs, chef's choice.
  3. Run :all-types again.

After step 8, ghci prints the exact same thing as before, indicating that both sides of the equation have type (). It should instead update the source spans and types to match the file, reporting Bool instead of () and (1,5)-(1,9) for the second span.

Manually exiting and restarting ghci appears to be the only way to freshen the collected type information.

Trac metadata
Trac field Value
Version 8.4.2
Type Bug
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