Skip to content
  • Ryan Scott's avatar
    Don't typecheck too much (or too little) in DerivingVia (#16923) · b507aceb
    Ryan Scott authored and Marge Bot's avatar Marge Bot committed
    Previously, GHC would typecheck the `via` type once per class in a
    `deriving` clause, which caused the problems observed in #16923.
    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.
    b507aceb