Egregious bug in tcLHsConResTy
[ghc-hetmet.git] / compiler / typecheck / TcHsType.lhs
index e4b1267..b7e5b0b 100644 (file)
@@ -561,8 +561,8 @@ tcLHsConResTy res_ty
     get_largs (L _ ty) args = get_args ty args
     get_args (HsAppTy fun arg)                   args = get_largs fun (arg:args)
     get_args (HsParTy ty)                        args = get_largs ty  args
-    get_args (HsOpTy ty1 (L span tc) ty2) args = get_args (HsTyVar tc) (ty1:ty2:args)
-    get_args ty                          args = (ty, reverse args)
+    get_args (HsOpTy ty1 (L span tc) ty2) args = (HsTyVar tc, ty1:ty2:args)
+    get_args ty                          args = (ty, args)
 
 gadtResCtxt ty
   = hang (ptext SLIT("In the result type of a data constructor:"))
@@ -613,7 +613,7 @@ tcTyVarBndrs bndrs thing_inside
 
 -----------------------------------
 tcDataKindSig :: Maybe Kind -> TcM [TyVar]
--- GADT decls can have a (perhpas partial) kind signature
+-- GADT decls can have a (perhaps partial) kind signature
 --     e.g.  data T :: * -> * -> * where ...
 -- This function makes up suitable (kinded) type variables for 
 -- the argument kinds, and checks that the result kind is indeed *