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

Closed
Open
Opened Dec 07, 2018 by Ryan Scott@RyanGlScottMaintainer

GHC HEAD type family regression involving invisible arguments

The following code compiles on GHC 8.0.2 through 8.6.2:

{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
module Bug where

import Data.Kind

class C k where
  type S :: k -> Type

data D :: Type -> Type
data SD :: forall a. D a -> Type

instance C (D a) where
  type S = SD

But fails to compile on GHC HEAD (commit 73cce63f):

$ ~/Software/ghc2/inplace/bin/ghc-stage2 Bug.hs
[1 of 1] Compiling Bug              ( Bug.hs, Bug.o )

Bug.hs:15:3: error:
    • Type indexes must match class instance head
      Expected: S @(D a)
        Actual: S @(D a1)
    • In the type instance declaration for ‘S’
      In the instance declaration for ‘C (D a)’
   |
15 |   type S = SD
   |   ^^^^^^^^^^^

This regression prevents the stitch library from compiling.

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