Don't skip validity checks for built-in classes (#17355)

Authored by RyanGlScott on Oct 14 2019, 10:21 AM.

Description

Don't skip validity checks for built-in classes (Trac #17355)

Issue Trac #17355 occurred because the control flow for
TcValidity.check_valid_inst_head was structured in such a way that
whenever it checked a special, built-in class (like Generic or
HasField), it would skip the most important check of all:
checkValidTypePats, which rejects nonsense like this:

hs
instance Generic (forall a. a)

This fixes the issue by carving out checkValidTypePats from
check_valid_inst_head so that checkValidTypePats is always
invoked. check_valid_inst_head has also been renamed to
check_special_inst_head to reflect its new purpose of _only_
checking for instances headed by special classes.

Fixes Trac #17355.

(cherry picked from commit f375e3fb060653beb12b05b48ac0fd3f88eb2f45)

Details

Committed
bgamariSun, Nov 3, 12:17 PM
Parents
rGHCe8175beda87c: Bump stm submodule
Branches
Unknown
Tags
Unknown