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,324
    • Issues 4,324
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 373
    • Merge Requests 373
  • 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
  • #502

Closed
Open
Opened Dec 14, 2000 by Manuel M T Chakravarty@mchakravartyReporter

Type error message pretty-prints unboxed tuples wrongly

I get

PASysDep.hs:51:
    Couldn't match
	`(State# s, MutableByteArray# s)'
	against
	`(State# t, MutableByteArray# t)'
	Expected type: (State# s, MutableByteArray# s)
	Inferred type: (State# t, MutableByteArray# t)
    In the application `newByteArray# (wORD_SCALE n#) s#'
    In the right-hand side of an equation for `newIntArray#':
	newByteArray# (wORD_SCALE n#) s#

where the actual error is that I have used boxed instead of unboxed tuples in a type signature.  In other words, the inferred type should have been reported as

  (# State# t, MutableByteArray# t #)

The code producing this error is as follows:

import PrelByteArr (cHAR_SCALE, wORD_SCALE, fLOAT_SCALE, dOUBLE_SCALE)
import PrelGHC

newIntArray# :: Int# -> State# s -> (State# s, MutableByteArray# s)
newIntArray# n# s# = newByteArray# (wORD_SCALE n#) s#
Trac metadata
Trac field Value
Version None
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution ResolvedFixed
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#502