Unsaturated type synonyms as arguments work in 8.6.3 but not HEAD
Input, derived from code seen in the wild in hpack 0.31.1:
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE FlexibleContexts #-}
module Main where
type WithCommonOptions cSources cxxSources jsSources a = a
data Traverse m cSources cSources_ cxxSources cxxSources_ jsSources jsSources_ = Traverse {
traverseCSources :: cSources -> m cSources_
, traverseCxxSources :: cxxSources -> m cxxSources_
, traverseJsSources :: jsSources -> m jsSources_
}
type Traversal_ t = forall m cSources cSources_ cxxSources cxxSources_ jsSources jsSources_ a. Monad m
=> Traverse m cSources cSources_ cxxSources cxxSources_ jsSources jsSources_
-> t cSources cxxSources jsSources a
-> m (t cSources_ cxxSources_ jsSources_ a)
traverseWithCommonOptions :: Traversal_ WithCommonOptions
traverseWithCommonOptions = undefined
main = return ()
Using a GHC compiled from revision 074eae25, I get this error:
Main.hs:19:30: error:
• The type synonym ‘WithCommonOptions’ should have 4 arguments, but has been given none
• In the type signature:
traverseWithCommonOptions :: Traversal_ WithCommonOptions
|
19 | traverseWithCommonOptions :: Traversal_ WithCommonOptions
|
GHC 8.6.3 accepts the module without complaint.
I'm actually surprised that the previous code worked and I wouldn't complain if this is closed as working as intended. However, there's no mention of this change in the migration guide for 8.8 yet, so I'm not certain it's intentional.
Trac metadata
Trac field | Value |
---|---|
Version | 8.7 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |