Check that AT instance is in a class
[ghc-hetmet.git] / compiler / types / Coercion.lhs
index 3e1d071..fb91a0d 100644 (file)
@@ -340,10 +340,10 @@ mkDataInstCoercion name tvs family instTys rep_tycon
   where
     coArity = length tvs
 
-    rule args = (substTyWith tvs tys $               -- with sigma = [tys/tvs]
-                  TyConApp family instTys,           --       sigma (F ts)
-                TyConApp rep_tycon (mkTyVarTys tvs), --   :=: R tys
-                rest)                                -- surplus arguments
+    rule args = (substTyWith tvs tys $              -- with sigma = [tys/tvs],
+                  TyConApp family instTys,          --       sigma (F ts)
+                TyConApp rep_tycon tys,             --   :=: R tys
+                rest)                               -- surplus arguments
       where
         tys  = take coArity args
         rest = drop coArity args