Skip to content

hs-boot modification doesn't induce recompilation

Consider these modules:

X.hs-boot

module X where

Y.hs

module Y where
import {-# SOURCE #-} X
data T = T
data S = S T

X.hs

module X where
import Y

ghc --make Y.hs will compile fine. Now, modify X.hs-boot to add a data T (which will cause an ambiguous identifier error in Y.hx. Run ghc --make Y.hs and nothing happens!

(You might also notice something else a bit funny, which is that X.hs gets compiled, even though it's not directly in the import chain of Y. I think this might be intentional but I'm not sure.)

Discovered this while poking around #10182 (closed).

Edited by Edward Z. Yang
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information