patch applied (ghc): Do pre-subsumption in the main subsumption
Simon Peyton Jones
simonpj at microsoft.com
Fri Aug 4 18:05:09 EDT 2006
Fri Aug 4 14:49:42 PDT 2006 simonpj at microsoft.com
* Do pre-subsumption in the main subsumption check
This patch improves the subsumption check (in TcUnify.tc_sub) so that
it does pre-subsumption first. The key code is in the case with
guard (isSigmaTy actual_ty); note the new call to preSubType.
Shorn of details, the question is this. Should this hold?
forall a. a->a <= Int -> (forall b. Int)
Really, it should; just instantiate 'a' to Int. This is just what
the pre-subsumption phase (which used in function applications),
I did a bit of refactoring to achieve this.
Fixes Trac #821. Test tc205 tests.
M ./compiler/rename/RnExpr.lhs -1 +1
M ./compiler/typecheck/TcExpr.lhs -31 +12
M ./compiler/typecheck/TcMType.lhs -9 +2
M ./compiler/typecheck/TcPat.lhs -2 +1
M ./compiler/typecheck/TcType.lhs -2 +2
M ./compiler/typecheck/TcUnify.lhs -58 +125
More information about the Cvs-ghc