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,331
    • Issues 4,331
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 370
    • Merge Requests 370
  • 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
  • #1482

Closed
Open
Opened Jul 01, 2007 by yeoh@cs.wisc.edu@trac-yeoh

unsafeCoerce# doesn't always fully coerce

{-# OPTIONS_GHC -fglasgow-exts #-}

import GHC.Prim( unsafeCoerce# )

e1 = unsafeCoerce# (+)
e2 = unsafeCoerce# shows

e1 coerces fine, even with the Num constraint, but e2 does not. The error for e2 is

    Ambiguous type variable `a' in the constraint:
      `Show a' arising from use of `shows' at T.lhs:7:20-24
    Probable fix: add a type signature that fixes these type variable(s)

Weirder still, ghci coerces shows fine:

*Main> :t unsafeCoerce# shows
unsafeCoerce# shows :: forall b. b
Trac metadata
Trac field Value
Version 6.6.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Type checker)
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#1482