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,334
    • Issues 4,334
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 371
    • Merge Requests 371
  • 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
  • #1006

Closed
Open
Opened Nov 16, 2006 by SamB@trac-SamB

'impossible' happened in reportNoInstance?

This program, though it shouldn't typecheck, shouldn't make the compiler panic like this either:

ghc-6.5: panic! (the 'impossible' happened)
  (GHC version 6.5 for i386-unknown-linux):
        reportNoInstance
    $dPrintfType{v alY} :: {<pred>base:Text.Printf.PrintfType{tc r5j} (a{tv alO} [sk]
                                                                       -> b{tv alP} [sk])}

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

Presumably the problem is in the phex part...

{-# OPTIONS_GHC -fglasgow-exts #-}
#!haskell

-- Actually, this exercises prelude/PrelRules, but this is the closest
-- place I could find to put it...

import GHC.Exts
import Numeric
import Text.Printf

main = do phex (I# (uncheckedIShiftL#  (negateInt# 5#) 2#))
          phex (I# (uncheckedIShiftRA# (negateInt# 5#) 1#))
          phex (I# (uncheckedIShiftRL# (negateInt# 5#) 1#))
          phex (W# (uncheckedShiftL#   (int2Word# (negateInt# 5#)) 2#))
          phex (W# (uncheckedShiftRL#  (int2Word# (negateInt# 5#)) 1#))

-- this doesn't work on negative numbers :-(
-- phex x = putStrLn ("0x" ++ showHex x "") 

phex :: a -> b
phex x = printf "0x%x" x
Trac metadata
Trac field Value
Version 6.7
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Type checker)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown
Architecture Unknown
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#1006