Skip to content
  • Ryan Scott's avatar
    Ignore unary constraint tuples during typechecking (#17511) · 921d3238
    Ryan Scott authored and Marge Bot's avatar Marge Bot committed
    We deliberately avoid defining a magical `Unit%` class, for reasons
    that I have expounded upon in the newly added
    `Note [Ignore unary constraint tuples]` in `TcHsType`. However, a
    sneaky user could try to insert `Unit%` into their program by way of
    Template Haskell, leading to the interface-file error observed
    in #17511. To avoid this, any time we encounter a unary constraint
    tuple during typechecking, we drop the surrounding constraint tuple
    application. This is safe to do since `Unit% a` and `a` would be
    semantically equivalent (unlike other forms of unary tuples).
    
    Fixes #17511.
    921d3238