; (matches', fvs) <- bindSigTyVarsFV (sig_fn plain_name) $
-- bindSigTyVars tests for Opt_ScopedTyVars
; (matches', fvs) <- bindSigTyVarsFV (sig_fn plain_name) $
-- bindSigTyVars tests for Opt_ScopedTyVars
- return (L loc (FunBind { fun_id = name,
- fun_infix = inf,
- fun_matches = matches',
- bind_fvs = fvs',
- fun_co_fn = idHsWrapper,
- fun_tick = Nothing }),
+
+ return (L loc (FunBind { fun_id = name,
+ fun_infix = is_infix,
+ fun_matches = matches',
+ bind_fvs = fvs',
+ fun_co_fn = idHsWrapper,
+ fun_tick = Nothing }),
-> [Name]
-> LHsBindLR RdrName RdrName
-> RnM (Bag (LHsBindLR Name Name), FreeVars)
-> [Name]
-> LHsBindLR RdrName RdrName
-> RnM (Bag (LHsBindLR Name Name), FreeVars)
fun_matches = MatchGroup matches _ }))
= setSrcSpan loc $ do
sel_name <- wrapLocM (lookupInstDeclBndr cls) name
let plain_name = unLoc sel_name
-- We use the selector name as the binder
fun_matches = MatchGroup matches _ }))
= setSrcSpan loc $ do
sel_name <- wrapLocM (lookupInstDeclBndr cls) name
let plain_name = unLoc sel_name
-- We use the selector name as the binder
- bindSigTyVarsFV (sig_fn plain_name) $ do
- (new_matches, fvs) <- mapFvRn (rn_match plain_name) matches
- let
- new_group = MatchGroup new_matches placeHolderType
+ (new_matches, fvs) <- bindSigTyVarsFV (sig_fn plain_name) $
+ mapFvRn (rn_match (FunRhs plain_name is_infix)) matches
+ let new_group = MatchGroup new_matches placeHolderType
- checkPrecMatch inf plain_name new_group
- return (unitBag (L loc (FunBind {
- fun_id = sel_name, fun_infix = inf,
+ when is_infix $ checkPrecMatch plain_name new_group
+ return (unitBag (L loc (FunBind {
+ fun_id = sel_name, fun_infix = is_infix,
where
-- Truly gruesome; bring into scope the correct members of the generic
-- type variables. See comments in RnSource.rnSourceDecl(ClassDecl)
where
-- Truly gruesome; bring into scope the correct members of the generic
-- type variables. See comments in RnSource.rnSourceDecl(ClassDecl)
where
tvs = map (rdrNameOcc.unLoc) (extractHsTyRdrTyVars ty)
gen_tvs = [tv | tv <- gen_tyvars, nameOccName tv `elem` tvs]
where
tvs = map (rdrNameOcc.unLoc) (extractHsTyRdrTyVars ty)
gen_tvs = [tv | tv <- gen_tyvars, nameOccName tv `elem` tvs]
-- Can't handle method pattern-bindings which bind multiple methods.
rnMethodBind _ _ _ (L loc bind@(PatBind {})) = do
-- Can't handle method pattern-bindings which bind multiple methods.
rnMethodBind _ _ _ (L loc bind@(PatBind {})) = do