Skip to content
GitLab
Projects Groups Snippets
  • /
  • 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 5,249
    • Issues 5,249
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 576
    • Merge requests 576
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #15796
Closed
Open
Issue created Oct 24, 2018 by Icelandjack@IcelandjackReporter

Core Lint error with invalid newtype declaration

This gives a Core Lint error

{-# Language QuantifiedConstraints #-}
{-# Language TypeApplications      #-}
{-# Language TypeOperators         #-}
{-# Language PolyKinds             #-}
{-# Language FlexibleInstances     #-}
{-# Language DataKinds             #-}
{-# Language TypeFamilies          #-}
{-# Language MultiParamTypeClasses #-}
{-# Language ConstraintKinds       #-}
{-# Language UndecidableInstances  #-}
{-# Language GADTs                 #-}

{-# Options_GHC -dcore-lint #-}

import Data.Kind

type Cat ob = ob -> ob -> Type

class Ríki (obj :: Type) where
  type (-->) :: Cat obj

class Varpi (f :: dom -> cod)

newtype
  (··>) :: Cat (a -> b) where
  Natu :: Varpi f
       => (forall xx. f xx --> f' xx)
       -> (f ··> f')

instance
     Ríki cod
  => -------------
     Ríki (dom -> cod)
  where

  type (-->) = (··>) @dom @cod
$ ghci -ignore-dot-ghci 568_bug.hs
GHCi, version 8.7.20181017: http://www.haskell.org/ghc/  :? for help
[1 of 1] Compiling Main             ( 568_bug.hs, interpreted )
ghc-stage2: panic! (the 'impossible' happened)
  (GHC version 8.7.20181017 for x86_64-unknown-linux):
        Core Lint error
  <no location info>: warning:
      In the type ‘(··>)’
      Found TcTyCon: ··>[tc]
  Call stack:
      CallStack (from HasCallStack):
        callStackDoc, called at compiler/utils/Outputable.hs:1160:37 in ghc:Outputable
        pprPanic, called at compiler/typecheck/FamInst.hs:171:31 in ghc:FamInst

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

> :q
Leaving GHCi.
Trac metadata
Trac field Value
Version 8.6.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
) :: Cat obj\r\n\r\nclass Varpi (f :: dom -> cod)\r\n\r\nnewtype\r\n (··>) :: Cat (a -> b) where\r\n Natu :: Varpi f\r\n => (forall xx. f xx --> f' xx)\r\n -> (f ··> f')\r\n\r\ninstance\r\n Ríki cod\r\n => -------------\r\n Ríki (dom -> cod)\r\n where\r\n\r\n type (-->) = (··>) @dom @cod\r\n}}}\r\n\r\n{{{\r\n$ ghci -ignore-dot-ghci 568_bug.hs\r\nGHCi, version 8.7.20181017: http://www.haskell.org/ghc/ :? for help\r\n[1 of 1] Compiling Main ( 568_bug.hs, interpreted )\r\nghc-stage2: panic! (the 'impossible' happened)\r\n (GHC version 8.7.20181017 for x86_64-unknown-linux):\r\n Core Lint error\r\n : warning:\r\n In the type ‘(··>)’\r\n Found TcTyCon: ··>[tc]\r\n Call stack:\r\n CallStack (from HasCallStack):\r\n callStackDoc, called at compiler/utils/Outputable.hs:1160:37 in ghc:Outputable\r\n pprPanic, called at compiler/typecheck/FamInst.hs:171:31 in ghc:FamInst\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n\r\n> :q\r\nLeaving GHCi.\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->
Edited Mar 10, 2019 by Ryan Scott
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking