X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Frename%2FRnTypes.lhs;h=cc0f0f3b94868a98e4a049971ed7c3d397777044;hb=3a49601be4ed68d59ca9a81589e3cb627ae268d7;hp=cf998b6200880c54f63d515c31791a1d844ec95a;hpb=1bade0c9060d3aec4fd4590803d411d54f0ea927;p=ghc-hetmet.git diff --git a/ghc/compiler/rename/RnTypes.lhs b/ghc/compiler/rename/RnTypes.lhs index cf998b6..cc0f0f3 100644 --- a/ghc/compiler/rename/RnTypes.lhs +++ b/ghc/compiler/rename/RnTypes.lhs @@ -5,8 +5,8 @@ \begin{code} module RnTypes ( rnHsType, rnContext, - rnHsSigType, rnHsTypeFVs, rnHsSigTypeFVs, - rnPat, rnPats, rnPatsAndThen, -- Here because it's not part + rnHsSigType, rnHsTypeFVs, + rnPat, rnPatsAndThen, -- Here because it's not part rnOverLit, litFVs, -- of any mutual recursion precParseErr, sectionPrecErr, dupFieldErr, patSigErr, checkTupSize ) where @@ -57,11 +57,6 @@ rnHsTypeFVs doc_str ty = rnHsType doc_str ty `thenM` \ ty' -> returnM (ty', extractHsTyNames ty') -rnHsSigTypeFVs :: SDoc -> RdrNameHsType -> RnM (RenamedHsType, FreeVars) -rnHsSigTypeFVs doc_str ty - = rnHsSigType doc_str ty `thenM` \ ty' -> - returnM (ty', extractHsTyNames ty') - rnHsSigType :: SDoc -> RdrNameHsType -> RnM RenamedHsType -- rnHsSigType is used for source-language type signatures, -- which use *implicit* universal quantification. @@ -167,11 +162,22 @@ rnHsTypes doc tys = mappM (rnHsType doc) tys \begin{code} +rnForAll doc exp [] [] ty = rnHsType doc ty + -- One reason for this case is that a type like Int# + -- starts of as (HsForAllTy Nothing [] Int), in case + -- there is some quantification. Now that we have quantified + -- and discovered there are no type variables, it's nicer to turn + -- it into plain Int. If it were Int# instead of Int, we'd actually + -- get an error, because the body of a genuine for-all is + -- of kind *. + rnForAll doc exp forall_tyvars ctxt ty = bindTyVarsRn doc forall_tyvars $ \ new_tyvars -> rnContext doc ctxt `thenM` \ new_ctxt -> rnHsType doc ty `thenM` \ new_ty -> returnM (HsForAllTy exp new_tyvars new_ctxt new_ty) + -- Retain the same implicit/explicit flag as before + -- so that we can later print it correctly \end{code}