Skip to content

Type family injectivity annotations ignored in hs-boot files

Here's the test case:

-- A.hs-boot
{-# LANGUAGE TypeFamilies #-}

module A where

type family Id x = r | r -> x where ..
-- needed to avoid illegal self-import
module B where

import {-# SOURCE #-} A
{-# LANGUAGE TypeFamilies #-}

module A where

import B

type family Id x = r | r -> x where
  Id a = a

I get

A.hs-boot:6:1: error:
    Type constructor ‘Id’ has conflicting definitions in the module
    and its hs-boot file
    Main module: type family Id x = r :: * | r -> x where
                     Id a = a
    Boot file:   type family Id x :: *

Even when declaring an abstract closed type family, it should still be able to be injective.

Trac metadata
Trac field Value
Version 7.11
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Type checker)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information