Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,251
    • Issues 4,251
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 397
    • Merge Requests 397
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #9225

Closed
Open
Opened Jun 22, 2014 by Edward Z. Yang@ezyangDeveloper

Missing syntax error for package qualified import with version number

Consider the following test file:

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

where we have

ezyang@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@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.

Trac metadata
Trac field Value
Version 7.8.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Parser)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
8.0.1
Milestone
8.0.1 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#9225