Skip to content

Commit

Permalink
Merge branch 'partial-sigs' of github.com:mrBliss/ghc-head into parti…
Browse files Browse the repository at this point in the history
…al-sigs
  • Loading branch information
dominiquedevriese committed Feb 28, 2014
2 parents cafad09 + 79aa4ee commit 7ae47c6
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 0 deletions.
4 changes: 4 additions & 0 deletions compiler/parser/RdrHsSyn.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,10 @@ mkTyFamInstEqn :: LHsType RdrName
-> P (TyFamInstEqn RdrName)
mkTyFamInstEqn lhs rhs
= do { (tc, tparams) <- checkTyClHdr lhs
; let err xhs = ptext (sLit "In type family instance equation of") <+>
quotes (ppr tc) <> colon $$ ppr xhs
; checkNoPartialType (err lhs) lhs
; checkNoPartialType (err rhs) rhs
; return (TyFamInstEqn { tfie_tycon = tc
, tfie_pats = mkHsWithBndrs tparams
, tfie_rhs = rhs }) }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{-# LANGUAGE PartialTypeSignatures, TypeFamilies, InstanceSigs #-}
module WildcardInTypeFamilyInstanceLHS where

class Foo k where
type Dual k :: *

instance Foo Int where
type Dual _ = Maybe Int
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

WildcardInTypeFamilyInstanceLHS.hs:8:8:
Wildcard not allowed
In type family instance equation of ‛Dual’:
Dual _
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{-# LANGUAGE PartialTypeSignatures, TypeFamilies, InstanceSigs #-}
module WildcardInTypeFamilyInstanceRHS where

class Foo k where
type Dual k :: *

instance Foo Int where
type Dual Int = Maybe _
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

WildcardInTypeFamilyInstanceRHS.hs:8:19:
Wildcard not allowed
In type family instance equation of ‛Dual’:
Maybe _
2 changes: 2 additions & 0 deletions testsuite/tests/partial-sigs/should_fail/all.T
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ test('WildcardInDeriving', normal, compile_fail, [''])
test('WildcardInGADT1', normal, compile_fail, [''])
test('WildcardInGADT2', normal, compile_fail, [''])
test('WildcardInNewtype', normal, compile_fail, [''])
test('WildcardInTypeFamilyInstanceLHS', normal, compile_fail, [''])
test('WildcardInTypeFamilyInstanceRHS', normal, compile_fail, [''])
test('WildcardInTypeSynonymLHS', normal, compile_fail, [''])
test('WildcardInTypeSynonymRHS', normal, compile_fail, [''])

0 comments on commit 7ae47c6

Please sign in to comment.