Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
    • Insights
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
    • Locked Files
  • Issues 3,610
    • Issues 3,610
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 200
    • Merge Requests 200
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Security & Compliance
    • Security & Compliance
    • Dependency List
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #16745

Closed
Open
Opened Jun 04, 2019 by dredozubov@trac-dredozubov
  • Report abuse
  • New issue
Report abuse New issue

A combination of DuplicateRecordFields and import hiding triggers a GHC panic

Summary

GHC panics with:

ghc: panic! (the 'impossible' happened)
  (GHC version 8.6.3 for x86_64-apple-darwin):
	filterImports/combine
  (field, field, Nothing)
  ($sel:field:R, R{R, R; field}, Nothing)
  Call stack:
      CallStack (from HasCallStack):
        callStackDoc, called at compiler/utils/Outputable.hs:1160:37 in ghc:Outputable
        pprPanic, called at compiler/rename/RnNames.hs:901:23 in ghc:RnNames

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

Steps to reproduce

A.hs:

module Main where

import B hiding (field)

main = print "ok"

B.hs:

{-# LANGUAGE DuplicateRecordFields #-}

module B
  ( R(..)
  , module C
  ) where

import C

data R = R { field :: Int}

C.hs:

module C where
field = (++ "foo")

Expected behavior

compile time error instead of ghc panic

Environment

  • GHC version used: 8.6.3

Optional:

  • Operating System: OS X Sierra
  • System Architecture: x86_64
Edited Jun 04, 2019 by dredozubov

Related issues

  • Discussion
  • Designs
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
3
Labels
bug compiler crash OverloadedRecordFields
Assign labels
  • View project labels
Reference: ghc/ghc#16745