mkWpFun_FRR: fix ordering of coercion composition

Ticket: #27639 (closed).

When the subsumption machinery generates an eta-expansion, we must perform a representation polymorphism check to ensure the lambda binder has a fixed runtime representation. This is done in GHC.Tc.Utils.mkWpFun_FRR.

This check involves composing quite a few coercions, arising from representation-polymorphism checks on both the actual and expected argument types. These coercions are then chained using HsWrapper composition, <.>. The ordering of composition was incorrect, leading to the Core Lint failure reported in #27639 (closed). This MR fixes that.

Edited by sheaf

Merge request reports

Loading