X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fparser%2FRdrHsSyn.lhs;h=6fb6e86d6874e77a404d34e78b1ed37d16cf3bfe;hb=252abd9e355fe12e8f6f1e0192542a0df6ddccac;hp=781b085fe15881ce9c0dc88042a341dcc555bf80;hpb=6a56f3ba02d33c38c95ff8f8da8a28d07f02ede9;p=ghc-hetmet.git diff --git a/ghc/compiler/parser/RdrHsSyn.lhs b/ghc/compiler/parser/RdrHsSyn.lhs index 781b085..6fb6e86 100644 --- a/ghc/compiler/parser/RdrHsSyn.lhs +++ b/ghc/compiler/parser/RdrHsSyn.lhs @@ -762,17 +762,16 @@ patFail loc = parseError loc "Parse error in pattern" checkValDef :: LHsExpr RdrName -> Maybe (LHsType RdrName) - -> GRHSs RdrName + -> Located (GRHSs RdrName) -> P (HsBind RdrName) -checkValDef lhs opt_sig grhss +checkValDef lhs opt_sig (L rhs_span grhss) | Just (f,inf,es) <- isFunLhs lhs [] = if isQual (unLoc f) then parseError (getLoc f) ("Qualified name in function definition: " ++ showRdrName (unLoc f)) else do ps <- checkPatterns es - return (FunBind f inf [L (getLoc f) (Match ps opt_sig grhss)]) - -- TODO: span is wrong + return (FunBind f inf [L rhs_span (Match ps opt_sig grhss)]) | otherwise = do lhs <- checkPattern lhs return (PatBind lhs grhss)