Expand given superclasses more eagerly
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 22 Jun 2016 13:17:58 +0000 (14:17 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Wed, 22 Jun 2016 21:21:15 +0000 (22:21 +0100)
commitce97b7298d54bdfccd9dcf366a69c5617b4eb43f
treed240b730dccdd8b96284b1b5fa0d3b6bdf1ff4f5
parenta1b3359636ebfdf3b65c21dc2ae5b5814c012630
Expand given superclasses more eagerly

This patch fixes Trac #12175, another delicate corner case of
Note [Instance and Given overlap] in TcInteract.

In #12175 we were not expanding given superclasses eagerly
enough. It was easy to fix, and is actually rather neater than
before.

See Note [Eagerly expand given superclasses] in TcCanonical.
The main change is to move the eager expansion of given superclasses
to canClassNC.
compiler/typecheck/TcCanonical.hs
compiler/typecheck/TcInteract.hs
compiler/typecheck/TcRnTypes.hs
compiler/typecheck/TcSMonad.hs
compiler/typecheck/TcSimplify.hs
testsuite/tests/indexed-types/should_compile/T12175.hs [new file with mode: 0644]
testsuite/tests/indexed-types/should_compile/all.T