diff options
author | David Terei <code@davidterei.com> | 2015-05-11 16:05:37 -0700 |
---|---|---|
committer | David Terei <code@davidterei.com> | 2015-05-11 18:21:11 -0700 |
commit | 4fffbc34c024231c3c9fac7a2134896cc09c7fb7 (patch) | |
tree | a4b775d9f04997c2834303b2249dcae5ac42c642 /testsuite/tests/safeHaskell/safeInfered/UnsafeInfered02.hs | |
parent | eecef1733d5de342383665943b955bc1c96472f4 (diff) | |
download | haskell-4fffbc34c024231c3c9fac7a2134896cc09c7fb7.tar.gz |
New handling of overlapping inst in Safe Haskell
We do much better now due to the newish per-instance flags. Rather than
mark any module that uses `-XOverlappingInstances`,
`-XIncoherentInstances` or the new `OVERLAP*` pragmas as unsafe, we
regard them all as safe and defer the check until an overlap occurs.
An type-class method call that involves overlapping instances is
considered _unsafe_ when:
1) The most specific instance, Ix, is from a module marked `-XSafe`
2) Ix is an orphan instance or a MPTC
3) At least one instance that Ix overlaps, Iy, is:
a) from a different module than Ix
AND
b) Iy is not marked `OVERLAPPABLE`
This check is only enforced in modules compiled with `-XSafe` or
`-XTrustworthy`.
This fixes Safe Haskell to work with the latest overlapping instance
pragmas, and also brings consistent behavior. Previously, Safe Inferred
modules behaved differently than `-XSafe` modules.
Diffstat (limited to 'testsuite/tests/safeHaskell/safeInfered/UnsafeInfered02.hs')
0 files changed, 0 insertions, 0 deletions