[Git][ghc/ghc][wip/cfuneqcan-refactor] Use tcSplitTyConApp_maybe in can_eq_nc'

Richard Eisenberg gitlab at gitlab.haskell.org
Thu Nov 12 20:38:36 UTC 2020



Richard Eisenberg pushed to branch wip/cfuneqcan-refactor at Glasgow Haskell Compiler / GHC


Commits:
5df5c897 by Richard Eisenberg at 2020-11-12T15:38:17-05:00
Use tcSplitTyConApp_maybe in can_eq_nc'

- - - - -


1 changed file:

- compiler/GHC/Tc/Solver/Canonical.hs


Changes:

=====================================
compiler/GHC/Tc/Solver/Canonical.hs
=====================================
@@ -1032,8 +1032,12 @@ can_eq_nc' _flat _rdr_env _envs ev eq_rel
 
 -- Decompose type constructor applications
 -- NB: we have expanded type synonyms already
-can_eq_nc' _flat _rdr_env _envs ev eq_rel (TyConApp tc1 tys1) _ (TyConApp tc2 tys2) _
-  | not (isTypeFamilyTyCon tc1)
+can_eq_nc' _flat _rdr_env _envs ev eq_rel ty1 _ ty2 _
+  | Just (tc1, tys1) <- tcSplitTyConApp_maybe ty1
+  , Just (tc2, tys2) <- tcSplitTyConApp_maybe ty2  --
+   -- we want to catch e.g. Maybe Int ~ (Int -> Int) here for better
+   -- error messages; hence no direct match on TyConApp
+  , not (isTypeFamilyTyCon tc1)
   , not (isTypeFamilyTyCon tc2)
   = canTyConApp ev eq_rel tc1 tys1 tc2 tys2
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5df5c897bf27d1906d50999c0059d95289a74570

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5df5c897bf27d1906d50999c0059d95289a74570
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20201112/0781c62c/attachment.html>


More information about the ghc-commits mailing list