Fix another dark corner in the shortcut solver
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 8 Nov 2017 08:45:53 +0000 (08:45 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Wed, 8 Nov 2017 11:12:35 +0000 (11:12 +0000)
commit30058b0e45e920319916be999de9c4d77da136e7
tree948627521cf67ac580e43a3e248e189e00d03bd5
parent21970de8bf810970a9f4d634d53ea02b2cb248db
Fix another dark corner in the shortcut solver

The shortcut solver for type classes (Trac #12791) was eagerly
solving a constaint from an OVERLAPPABLE instance. It happened
to be the only one in scope, so it was unique, but since it's
specfically flagged as overlappable it's really a bad idea to
solve using it, rather than using the Given dictionary.

This led to Trac #14434, a nasty and hard to identify bug.
compiler/typecheck/TcInteract.hs
testsuite/tests/typecheck/should_compile/T14434.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/T14434.stdout [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/all.T