Skip to content

-fwarn-missing-exported-sigs doesn't respect qualified names

Trying to help @mpickering with D1258, I looked at the code in tcRnSrcDecls and was surprised to see that exports are renamed after this function is complete. This didn't make any sense to me. And, indeed, it's wrong, witness by this example:

{-# OPTIONS_GHC -fwarn-missing-exported-sigs #-}

module Bug (Data.List.intercalate, x) where

import qualified Data.List

intercalate = True

x :: Bool
x = intercalate

This produces

Bug.hs:7:1: Warning:
    Top-level binding with no type signature: intercalate :: Bool

This warning should not be emitted, because Bug.intercalate is not exported.

I'm not all that concerned about this scenario biting in the wild, but it suggests that refactoring this code is a good thing, and not something D1258 should take pains to avoid.

Edited by Simon Peyton Jones
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information