Skip to content

NamedDefaults: require the class to be standard

sheaf requested to merge sheaf/ghc:T25778 into master

This MR rectifies the oversight noticed in #25775 (closed) by implementing the plan outlined by @simonpj in #25778 (closed).

Now, we only default type variables if they only appear in constraints of the form C v, where C is either a standard class or a class with an in-scope default declaration.

This rectifies an oversight in the original implementation of the NamedDefaults extension: that implementation allowed type variables to appear in unary constraints which had arbitrary classes at the head.

The documentation effort for these subtleties is proceeding separately, in !14072 and !14057 (closed).

Edited by sheaf

Merge request reports

Loading