From b56025f448646de40446a133f140f62c8a49cabf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20=C3=89rdi?= Date: Mon, 21 Nov 2022 02:49:17 +0000 Subject: Don't specialise incoherent instance applications Using incoherent instances, there can be situations where two occurrences of the same overloaded function at the same type use two different instances (see #22448). For incoherently resolved instances, we must mark them with `nospec` to avoid the specialiser rewriting one to the other. This marking is done during the desugaring of the `WpEvApp` wrapper. Fixes #22448 Metric Increase: T15304 --- docs/users_guide/9.8.1-notes.rst | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'docs') diff --git a/docs/users_guide/9.8.1-notes.rst b/docs/users_guide/9.8.1-notes.rst index ad6f6f3709..a4230ffcca 100644 --- a/docs/users_guide/9.8.1-notes.rst +++ b/docs/users_guide/9.8.1-notes.rst @@ -27,6 +27,12 @@ Compiler This is convenient for TH code generation, as you can now uniformly use record wildcards regardless of number of fields. +- Incoherent instance applications are no longer specialised. The previous implementation of + specialisation resulted in nondeterministic instance resolution in certain cases, breaking + the specification described in the documentation of the `INCOHERENT` pragma. See GHC ticket + #22448 for further details. + + GHCi ~~~~ -- cgit v1.2.1