Skip to content

GHC 8.2.1 picks wrong instances with -O in a presence of an OVERLAPPABLE instance

We experienced code breakage while moving to 8.2.1 - in some circumstances it picks wrong instances if an instance in the lines of instance {-# OVERLAPPABLE #-} C a is defined. @s9gf4ult was really nice to create a repo demonstrating an issue, you can look at the repo here: https://github.com/s9gf4ult/isogen-minimal-example

Running chech.sh will trigger three builds:

GHC 8.0.2, -O, succeeds
GHC 8.2.1, -O0, succeeds
GHC 8.2.1, -O, fails

If you'll check out to either of fix- branches:

fix-move-to_string
fix-no-catchall-instance
fix-replace-to_string
fix-add-irrelevant-instance

then the last test should succeed also. Those branches contain changes over master which fix the application behavior in different ways.

Edited by dredozubov
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information