Commit 902cf01b authored by eir@cis.upenn.edu's avatar eir@cis.upenn.edu

Added test cases for closed type families in .hs-boot files.

parent fd20b873
Roles12.hs:5:6:
Type constructor ‛T’ has conflicting definitions in the module and its hs-boot file
Type constructor ‛T’ has conflicting definitions in the module
and its hs-boot file
Main module: data T a@P
No C type associated
RecFlag Recursive, Promotable
......
{-# LANGUAGE TypeFamilies #-}
module ClosedFam1 where
import {-# SOURCE #-} ClosedFam1
type family Foo a where
Foo Int = Bool
Foo [a] = Maybe a
\ No newline at end of file
{-# LANGUAGE TypeFamilies #-}
module ClosedFam1 where
type family Foo b where
Foo Int = Bool
Foo [different] = Maybe different
\ No newline at end of file
{-# LANGUAGE TypeFamilies #-}
module ClosedFam2 where
import {-# SOURCE #-} ClosedFam2
type family Foo a where
Foo Int = Bool
Foo [a] = Maybe a
\ No newline at end of file
{-# LANGUAGE TypeFamilies #-}
module ClosedFam2 where
type family Foo b where ..
......@@ -228,3 +228,7 @@ test('T8011',
test('T8018', normal, compile, [''])
test('T8020', normal, compile, [''])
test('ClosedFam1', extra_clean(['ClosedFam1.o-boot', 'ClosedFam1.hi-boot']),
multimod_compile, ['ClosedFam1', '-v0'])
test('ClosedFam2', extra_clean(['ClosedFam2.o-boot', 'ClosedFam2.hi-boot']),
multimod_compile, ['ClosedFam2', '-v0'])
\ No newline at end of file
{-# LANGUAGE TypeFamilies #-}
module ClosedFam3 where
import {-# SOURCE #-} ClosedFam3
type family Foo a where
Foo Int = Bool
Foo Double = Char
type family Bar a where
Bar Int = Bool
Bar Double = Double
type family Baz a where
Baz Int = Bool
\ No newline at end of file
{-# LANGUAGE TypeFamilies, PolyKinds #-}
module ClosedFam3 where
type family Foo a where
Foo Int = Bool
type family Bar a where
Bar Int = Bool
Bar Double = Char
type family Baz (a :: k) where
Baz Int = Bool
\ No newline at end of file
ClosedFam3.hs-boot:5:13:
Type constructor ‛Foo’ has conflicting definitions in the module
and its hs-boot file
Main module: closed type family Foo a@N :: * where
Foo Int = Bool
Foo Double = Char
Boot file: closed type family Foo a@N :: * where Foo Int = Bool
ClosedFam3.hs-boot:8:13:
Type constructor ‛Bar’ has conflicting definitions in the module
and its hs-boot file
Main module: closed type family Bar a@N :: * where
Bar Int = Bool
Bar Double = Double
Boot file: closed type family Bar a@N :: * where
Bar Int = Bool
Bar Double = Char
ClosedFam3.hs-boot:12:13:
Type constructor ‛Baz’ has conflicting definitions in the module
and its hs-boot file
Main module: closed type family Baz a@N :: * where Baz Int = Bool
Boot file: closed type family Baz (k::BOX)@N (a::k)@N :: * where
Baz * Int = Bool
{-# LANGUAGE TypeFamilies #-}
module ClosedFam4 where
type family Foo a where ..
\ No newline at end of file
ClosedFam4.hs:5:1:
You may omit the equations in a closed type family
only in a .hs-boot file
In the family declaration for ‛Foo’
......@@ -101,3 +101,7 @@ test('NoGood', normal, compile_fail, [''])
test('T7967', normal, compile_fail, [''])
test('T7938', normal, compile_fail, [''])
test('ClosedFam3', extra_clean(['ClosedFam3.o-boot', 'ClosedFam3.hi-boot']),
multimod_compile_fail, ['ClosedFam3', '-v0'])
test('ClosedFam4', normal, compile_fail, [''])
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment