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,253
    • Issues 4,253
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 397
    • Merge Requests 397
  • 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
  • #10285

Closed
Open
Opened Apr 10, 2015 by Simon Peyton Jones@simonpjDeveloper

Bug in Coerciible

Richard and I uncovered this

{-# LANGUAGE RoleAnnotations #-}
module Bar( N ) where   -- Data constructor not exported

type role N representational
newtype N a = MkN Int

and

{-# LANGUAGE FlexibleContexts #-}
module Foo where

import Data.Coerce
import Data.Type.Coercion
import Bar

f :: Coercible (N a) (N b) => Coercion a b
f = Coercion

This compiles but it should not! It wrongly compiles by using nth (N a ~R N b); but (as Fig 4 of the Corcible paper says), we can't decompose a newtype at representational role.

Easy to fix.

Trac metadata
Trac field Value
Version 7.10.1
Type Bug
TypeOfFailure OtherFailure
Priority highest
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
7.10.2
Milestone
7.10.2 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#10285