+ {-
+ If a signature decl is being loaded and we're ignoring interface pragmas,
+ toss away unfolding information.
+
+ Also, if the signature is loaded from a module we're importing from source,
+ we do the same. This is to avoid situations when compiling a pair of mutually
+ recursive modules, peering at unfolding info in the interface file of the other,
+ e.g., you compile A, it looks at B's interface file and may as a result change
+ it's interface file. Hence, B is recompiled, maybe changing it's interface file,
+ which will the ufolding info used in A to become invalid. Simple way out is to
+ just ignore unfolding info.
+ -}
+ decl' =
+ case decl of
+ SigD (IfaceSig name tp ls loc) | as_source || opt_IgnoreIfacePragmas ->
+ SigD (IfaceSig name tp [] loc)
+ _ -> decl
+