Skip to content

Don't typecheck too much (or too little) in DerivingVia (#16923)

Ryan Scott requested to merge RyanGlScott/ghc:wip/T16923 into master

Previously, GHC would typecheck the via type once per class in a deriving clause, which caused the problems observed in #16923 (closed). This patch restructures some of the functionality in TcDeriv and TcHsType to avoid this problem. We now typecheck the via type exactly once per deriving clause and then typecheck all of the classes in the clause. See Note [Don't typecheck too much in DerivingVia] in TcDeriv for the full details.

Fixes #16923 (closed).

Edited by Ryan Scott

Merge request reports