Opened 2 years ago

Last modified 12 hours ago

#13571 new bug

Injective type family syntax accepted without TypeFamilyDependencies

Reported by: jstolarek Owned by:
Priority: low Milestone:
Component: Compiler (Parser) Version: 8.0.1
Keywords: TypeFamilies, InjectiveFamilies Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

This program compiles fine although it names the result type variable, which is a piece of syntax that should only be available with TypeFamilyDependencies (injective type families):

{-# LANGUAGE TypeFamilies #-}

module Foo where

type family F a = r where
    F a = a

If I say:

type family F a = r | r -> a where
    F a = a

only then the definition is rejected.

Change History (2)

comment:1 Changed 2 years ago by simonpj

Keywords: InjectiveFamilies added; Injective removed

comment:2 Changed 12 hours ago by Marge Bot <ben+marge-bot@…>

In 9c21b2fd/ghc:

Fix #13571 by adding an extension flag check

Test case: indexed-types/should_fail/T13571
Note: See TracTickets for help on using tickets.