[GHC] #9225: Missing syntax error for package qualified import with version number

GHC ghc-devs at haskell.org
Sun Jun 22 16:30:19 UTC 2014


#9225: Missing syntax error for package qualified import with version number
-------------------------+-------------------------------------------------
       Reporter:         |             Owner:  ezyang
  ezyang                 |            Status:  new
           Type:  bug    |         Milestone:
       Priority:         |           Version:  7.8.2
  normal                 |  Operating System:  Unknown/Multiple
      Component:         |   Type of failure:  Incorrect warning at
  Compiler (Parser)      |  compile-time
       Keywords:         |         Test Case:
   Architecture:         |          Blocking:
  Unknown/Multiple       |
     Difficulty:         |
  Unknown                |
     Blocked By:         |
Related Tickets:         |
-------------------------+-------------------------------------------------
 Consider the following test file:

 {{{
 {-# LANGUAGE PackageImports #-}
 module Foo where
 import "containers-0.5.0.0" Data.Map
 }}}

 where we have

 {{{
 ezyang at sabre:~$ ghc-pkg list | grep containers
     containers-0.5.0.0
     unordered-containers-0.2.3.0
 }}}

 GHC will fail to compile this, but in an unusual way:

 {{{
 ezyang at sabre:~$ ghc test.hs
 [1 of 1] Compiling Foo              ( test.hs, test.o )

 test.hs:3:1:
     Failed to load interface for `Data.Map'
     It is not a module in the current program, or in any known package.
 }}}

 That's misleading: the real reason the import failed is because this is a
 package qualified import (not package ID qualified imports). For my
 purposes, it would be useful to also support package ID imports, but in
 the meantime, it would be a good idea to run Cabal's syntax check on the
 package name, which requires every hyphenated component to contain an
 alphabetic character.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9225>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list