Fix egregious instantiation bug in matchOneConLike (fixing Trac #9023)
We simply weren't giving anything like the right instantiating types to patSynInstArgTys in matchOneConLike. To get these instantiating types would have involved matching the result type of the pattern synonym with the pattern type, which is tiresome. So instead I changed ConPatOut so that instead of recording the type of the *whole* pattern (in old field pat_ty), it not records the *instantiating* types (in new field pat_arg_tys). Then we canuse TcHsSyn.conLikeResTy to get the pattern type when needed. There are lots of knock-on incidental effects, but they mostly made the code simpler, so I'm happy. (cherry picked from commit 0a55a3ca)
Showing
- compiler/basicTypes/PatSyn.lhs 23 additions, 2 deletionscompiler/basicTypes/PatSyn.lhs
- compiler/deSugar/Check.lhs 15 additions, 17 deletionscompiler/deSugar/Check.lhs
- compiler/deSugar/DsExpr.lhs 1 addition, 1 deletioncompiler/deSugar/DsExpr.lhs
- compiler/deSugar/DsUtils.lhs 1 addition, 2 deletionscompiler/deSugar/DsUtils.lhs
- compiler/deSugar/Match.lhs 5 additions, 6 deletionscompiler/deSugar/Match.lhs
- compiler/deSugar/MatchCon.lhs 15 additions, 18 deletionscompiler/deSugar/MatchCon.lhs
- compiler/deSugar/MatchLit.lhs 3 additions, 3 deletionscompiler/deSugar/MatchLit.lhs
- compiler/hsSyn/Convert.lhs 2 additions, 2 deletionscompiler/hsSyn/Convert.lhs
- compiler/hsSyn/HsPat.lhs 20 additions, 11 deletionscompiler/hsSyn/HsPat.lhs
- compiler/hsSyn/HsUtils.lhs 1 addition, 1 deletioncompiler/hsSyn/HsUtils.lhs
- compiler/parser/RdrHsSyn.lhs 1 addition, 1 deletioncompiler/parser/RdrHsSyn.lhs
- compiler/rename/RnPat.lhs 1 addition, 1 deletioncompiler/rename/RnPat.lhs
- compiler/typecheck/TcHsSyn.lhs 16 additions, 8 deletionscompiler/typecheck/TcHsSyn.lhs
- compiler/typecheck/TcPat.lhs 9 additions, 9 deletionscompiler/typecheck/TcPat.lhs
Loading
Please register or sign in to comment