diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2019-09-20 16:50:29 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-10-17 22:01:38 -0400 |
commit | 59d7c9f45b034809516703b57c84e3dac1834578 (patch) | |
tree | e1caa111d009cd3524293c06b6538a30abfb420b /testsuite/tests/backpack/should_compile/all.T | |
parent | b02a9ea79dddd98f6bbb42e1652d7ea38db7d55e (diff) | |
download | haskell-59d7c9f45b034809516703b57c84e3dac1834578.tar.gz |
Skip type family defaults with hs-boot and hsig files
Works around #17190, possible resolution for #17224. New design is is
according to accepted [GHC Propoal 320].
Instances in signatures currently unconditionally opt into associated
family defaults if no explicit instance is given. This is bad for two
reasons:
1. It constrains possible instantiations to use the default, rather
than possibly define the associated family differently.
2. It breaks compilation as type families are unsupported in
signatures.
This PR simply turns off the filling in of defaults in those cases.
Additionally, it squelches a missing definition warning for hs-boot too
that was only squelched for hsig before.
The downsides are:
1. There is no way to opt into the default, other than copying its
definition.
2. If we fixed type classes in signatures, and wanted instances to
have to explicitly *out of* rather than into the default, that would
now be a breaking change.
The change that is most unambiguously goood is harmonizing the warning
squelching between hs-boot or hsig. Maybe they should have the warning
(opt out of default) maybe they shouldn't (opt in to default), but
surely it should be the same for both.
Add hs-boot version of a backpack test regarding class-specified
defaults in instances that appear in an hs-boot file.
The metrics increase is very slight and makes no sense --- at least no
one has figured anything out after this languishing for a while, so I'm
just going to accept it.
Metric Increase:
T10421a
[GHC proposal 320]: https://github.com/ghc-proposals/ghc-proposals/pull/320
Diffstat (limited to 'testsuite/tests/backpack/should_compile/all.T')
-rw-r--r-- | testsuite/tests/backpack/should_compile/all.T | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/testsuite/tests/backpack/should_compile/all.T b/testsuite/tests/backpack/should_compile/all.T index 6655e09360..ac8c2a7ed8 100644 --- a/testsuite/tests/backpack/should_compile/all.T +++ b/testsuite/tests/backpack/should_compile/all.T @@ -48,6 +48,10 @@ test('bkp53', normal, backpack_compile, ['']) test('bkp54', normal, backpack_compile, ['']) test('bkp55', normal, backpack_compile, ['']) test('bkp56', normal, backpack_compile, ['']) +test('bkp57', normal, backpack_compile, ['']) +test('bkp58', normal, backpack_compile, ['']) +test('bkp59', normal, backpack_compile, ['']) +test('bkp60', normal, backpack_compile, ['']) test('T13140', normal, backpack_compile, ['']) test('T13149', expect_broken(13149), backpack_compile, ['']) |