diff options
Diffstat (limited to 'testsuite/tests/indexed-types/should_compile/T4120.hs')
-rw-r--r-- | testsuite/tests/indexed-types/should_compile/T4120.hs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/tests/indexed-types/should_compile/T4120.hs b/testsuite/tests/indexed-types/should_compile/T4120.hs new file mode 100644 index 0000000000..57dd21a39b --- /dev/null +++ b/testsuite/tests/indexed-types/should_compile/T4120.hs @@ -0,0 +1,26 @@ +{-# LANGUAGE Rank2Types, TypeFamilies #-} + +-- Unification yielding a coercion under a forall + +module Data.Vector.Unboxed where + +import Control.Monad.ST ( ST ) + + +data MVector s a = MV +data Vector a = V + +type family Mutable (v :: * -> *) :: * -> * -> * +type instance Mutable Vector = MVector + +create :: (forall s. MVector s a) -> Int +create = create1 +-- Here we get Couldn't match expected type `forall s. MVector s a' +-- with actual type `forall s. Mutable Vector s a1' +-- Reason: when unifying under a for-all we don't solve type +-- equalities. Think more about this. + +create1 :: (forall s. Mutable Vector s a) -> Int +create1 = error "urk" + + |