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,322
    • Issues 4,322
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 362
    • Merge Requests 362
  • 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
  • #16181

Closed
Open
Opened Jan 14, 2019 by chessai@chessaiDeveloper

ghc panic when using DerivingVia

The following program results in a ghc panic:

{-# LANGUAGE DerivingVia #-}

import Data.Functor.Const (Const(..))
import Data.Functor.Classes

newtype FlipConst a b = FlipConst b
  deriving (Show1, Eq1) via (Const b)

Here is the output of the compile:

test/Spec/Contravariant.hs:52:13: error:
    • No instance for (Show b)
        arising from the 'deriving' clause of a data type declaration
      Possible fix:
        add (Show b) to the context of
          the deriving clause for ‘Show1 (FlipConst a)’
        or use a standalone 'deriving instance' declaration,
             so you can specify the instance context yourself
    • When deriving the instance for (Show1 (FlipConst a))
   |
52 |   deriving (Show1, Eq1) via (Const b)
   |             ^^^^^

test/Spec/Contravariant.hs:52:13: error:ghc: panic! (the 'impossible' happened)
  (GHC version 8.6.3 for x86_64-unknown-linux):
	No skolem info:
  [b_a3eO]
  Call stack:
      CallStack (from HasCallStack):
        callStackDoc, called at compiler/utils/Outputable.hs:1160:37 in ghc:Outputable
        pprPanic, called at compiler/typecheck/TcErrors.hs:2891:5 in ghc:TcErrors

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

I'm using GHC 8.6.3

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