[project @ 2001-04-30 10:50:00 by simonpj]
authorsimonpj <unknown>
Mon, 30 Apr 2001 10:50:00 +0000 (10:50 +0000)
committersimonpj <unknown>
Mon, 30 Apr 2001 10:50:00 +0000 (10:50 +0000)
Add comments in tcInstType

ghc/compiler/typecheck/TcType.lhs

index 2cee03e..4df862c 100644 (file)
@@ -188,8 +188,11 @@ fresh type variables, splits off the dictionary part, and returns the results.
 tcInstType :: TcType -> NF_TcM ([TcTyVar], TcThetaType, TcType)
 tcInstType ty
   = case splitForAllTys ty of
-       ([],     rho) -> tcSplitRhoTy rho                       `thenNF_Tc` \ (theta, tau) ->
+       ([],     rho) ->        -- There may be overloading but no type variables;
+                               --      (?x :: Int) => Int -> Int
+                        tcSplitRhoTy rho                       `thenNF_Tc` \ (theta, tau) ->
                         returnNF_Tc ([], theta, tau)
+
        (tyvars, rho) -> tcInstTyVars tyvars                    `thenNF_Tc` \ (tyvars', _, tenv)  ->
                         tcSplitRhoTy (substTy tenv rho)        `thenNF_Tc` \ (theta, tau) ->
                         returnNF_Tc (tyvars', theta, tau)