[GHC] #7967: With dependent types, error reported in seemingly unrelated function