
#11624: Cannot declare hs-boot declaration if there is already a value in scope -------------------------------------+------------------------------------- Reporter: ezyang | Owner: ezyang Type: bug | Status: closed Priority: highest | Milestone: 8.0.1 Component: Compiler (Type | Version: 8.0.1-rc2 checker) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: #10472 | Differential Rev(s): Phab:D1963 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed @@ -3,1 +3,1 @@ - {{{ + {{{#!hs @@ -49,1 +49,1 @@ - Is a regression from 7.10. The dodginess is proximal to renameSig but I + Is a regression from 7.10. The dodginess is proximal to `renameSig` but I New description: This code no longer works: {{{#!hs -- A.hs-boot module A where concat :: Int -> Int -- overlaps with Prelude's concat -- B.hs module B where import Prelude () import {-# SOURCE #-} A x = concat 3 -- A.hs module A where import B concat n = n + 2 }}} Building `ghc --make A`, this crashes with: {{{ [1 of 3] Compiling A[boot] ( A.hs-boot, A.o-boot ) [2 of 3] Compiling B ( B.hs, B.o ) B.hs:4:5: error: • Can't find interface-file declaration for variable concat Probable cause: bug in .hi-boot file, or inconsistent .hi file Use -ddump-if-trace to get an idea of which file caused the error • In the expression: concat 3 In an equation for ‘x’: x = concat 3 }}} The trouble is that renaming has botched up the top-level declaration for boot: {{{ ezyang@sabre:~$ ghc-8.0 -c A.hs-boot -ddump-rn -dppr-debug A.hs-boot:1:1: ==================== Renamer ==================== {A.hs-boot:2:1-20} base-4.9.0.0:Data.Foldable.concat{v r2S} :: {A.hs-boot:2:11-20} ghc-prim-0.5.0.0:GHC.Types.Int{(w) tc 3J} -> ghc-prim-0.5.0.0:GHC.Types.Int{(w) tc 3J} }}} Is a regression from 7.10. The dodginess is proximal to `renameSig` but I haven't quite narrowed it down yet. -- Comment: Merged to `ghc-8.0` as 88a86f126f0fb2439b832927d51fd6d6445135b7. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11624#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler