X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FhsSyn%2FConvert.lhs;h=77e9e082243518701ea98018676ceb1dd0a55127;hb=7f546581e86c816ece1f7c877560ffa1cf385165;hp=6c14c11893008f64848cc9795853ed85d754f099;hpb=0065d5ab628975892cea1ec7303f968c3338cbe1;p=ghc-hetmet.git diff --git a/compiler/hsSyn/Convert.lhs b/compiler/hsSyn/Convert.lhs index 6c14c11..77e9e08 100644 --- a/compiler/hsSyn/Convert.lhs +++ b/compiler/hsSyn/Convert.lhs @@ -47,7 +47,11 @@ convertToHsDecls :: SrcSpan -> [TH.Dec] -> Either Message [LHsDecl RdrName] convertToHsDecls loc ds = initCvt loc (mapM cvtTop ds) convertToHsExpr :: SrcSpan -> TH.Exp -> Either Message (LHsExpr RdrName) -convertToHsExpr loc e = initCvt loc (cvtl e) +convertToHsExpr loc e + = case initCvt loc (cvtl e) of + Left msg -> Left (msg $$ (ptext SLIT("When converting TH expression") + <+> text (show e))) + Right res -> Right res convertToHsType :: SrcSpan -> TH.Type -> Either Message (LHsType RdrName) convertToHsType loc t = initCvt loc (cvtType t)