Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,842
    • Issues 4,842
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 456
    • Merge requests 456
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #8011

Closed
Open
Created Jun 22, 2013 by dsf@trac-dsf

-ddump-minimal-imports creates incorrect imports for associated types

If you have a module URL.hs:

{-# LANGUAGE TypeFamilies #-}

module URL (ToURL(toURL, nullURL, errorURL), URLT) where

class ToURL a where
    type URLT a
    toURL :: a -> URLT a
    nullURL :: a
    errorURL :: a -> URLT a

And a module that uses it Tmp.hs:

{-# LANGUAGE FlexibleContexts #-}
module Tmp ( clean ) where

import Data.Char (isAlphaNum)
import Data.List (dropWhile)
import URL

clean :: (ToURL url, Show (URLT url)) => url -> String
clean = filter isAlphaNum . show . toURL

when you run ghc -ddump-minimal-imports Tmp.hs the resulting Tmp.imports will contain the line

import URL ( ToURL(URLT, toURL) )

but it should contain

import URL ( ToURL(toURL), URLT )

This affects both associated type and associated type synonym declarations.

Trac metadata
Trac field Value
Version 7.6.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking