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,393
    • Issues 4,393
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 377
    • Merge Requests 377
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #14561

Closed
Open
Opened Dec 06, 2017 by Richard Eisenberg@raeDeveloper

Panic on levity polymorphic very unsafe coerce

{-# LANGUAGE TypeInType #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE MagicHash #-}

module LevityId where

import GHC.Types
import GHC.Prim

levityPolymorphicId :: forall (a :: TYPE r). a -> a
levityPolymorphicId = unsafeCoerce#
  (GHC version 8.3.20170928 for x86_64-apple-darwin):
	runtimeRepPrimRep
  typePrimRep (a_aW0 :: TYPE r_aVZ)
  r_aVZ
  Call stack:
      CallStack (from HasCallStack):
        callStackDoc, called at compiler/utils/Outputable.hs:1144:37 in ghc:Outputable
        pprPanic, called at compiler/simplStg/RepType.hs:358:5 in ghc:RepType
        runtimeRepPrimRep, called at compiler/simplStg/RepType.hs:344:5 in ghc:RepType
        kindPrimRep, called at compiler/simplStg/RepType.hs:307:18 in ghc:RepType
        typePrimRep, called at compiler/simplStg/UnariseStg.hs:666:8 in ghc:UnariseStg

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

As originally mentioned here.

Trac metadata
Trac field Value
Version 8.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
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#14561