summaryrefslogtreecommitdiff
path: root/compiler/GHC/Rename/Expr.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Rename/Expr.hs')
-rw-r--r--compiler/GHC/Rename/Expr.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/compiler/GHC/Rename/Expr.hs b/compiler/GHC/Rename/Expr.hs
index fe8056f6c6..93949c5d83 100644
--- a/compiler/GHC/Rename/Expr.hs
+++ b/compiler/GHC/Rename/Expr.hs
@@ -232,9 +232,13 @@ rnExpr (HsVar _ (L l v))
| otherwise
-> finishHsVar (L (na2la l) name) ;
- Just (FieldGreName fl) ->
- let sel_name = flSelector fl in
- return ( HsRecSel noExtField (FieldOcc sel_name (L l v) ), unitFV sel_name) ;
+ Just (FieldGreName fl)
+ -> do { let sel_name = flSelector fl
+ ; this_mod <- getModule
+ ; when (nameIsLocalOrFrom this_mod sel_name) $
+ checkThLocalName sel_name
+ ; return ( HsRecSel noExtField (FieldOcc sel_name (L l v) ), unitFV sel_name)
+ }
}
}