diff options
| author | Manuel M T Chakravarty <chak@cse.unsw.edu.au> | 2006-09-18 23:47:17 +0000 |
|---|---|---|
| committer | Manuel M T Chakravarty <chak@cse.unsw.edu.au> | 2006-09-18 23:47:17 +0000 |
| commit | a357abfc2ed4f0ac6eae1cf542fe4fb3bebe686e (patch) | |
| tree | 0c5edb333d1bbea4406d34b2310a5fd04ec8821b | |
| parent | 60f4aa3d033451da1daed159d9cb8780bf56e724 (diff) | |
| download | haskell-a357abfc2ed4f0ac6eae1cf542fe4fb3bebe686e.tar.gz | |
comment for getLocalDeclBinders
Sat Sep 9 20:46:25 EDT 2006 Manuel M T Chakravarty <chak@cse.unsw.edu.au>
* comment for getLocalDeclBinders
| -rw-r--r-- | compiler/rename/RnNames.lhs | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/compiler/rename/RnNames.lhs b/compiler/rename/RnNames.lhs index 6b98283afd..31ab4c78c8 100644 --- a/compiler/rename/RnNames.lhs +++ b/compiler/rename/RnNames.lhs @@ -411,17 +411,20 @@ used for source code. *** See "THE NAMING STORY" in HsDecls **** -Associated data types: Instances declarations may contain definitions of -associated data types whose data constructors we need to collect, too. -However, we need to be careful with the handling of the data type constructor -of each asscociated type, as it is already defined in the corresponding -class. We make a new name for it, but don't return it in the 'AvailInfo' (to -avoid raising a duplicate declaration error; see the helper -'unavail_main_name'). +Instances of indexed types +~~~~~~~~~~~~~~~~~~~~~~~~~~ +Indexed data/newtype instances contain data constructors that we need to +collect, too. Moreover, we need to descend into the data/newtypes instances +of associated families. + +We need to be careful with the handling of the type constructor of each type +instance as the family constructor is already defined, and we want to avoid +raising a duplicate declaration error. So, we make a new name for it, but +don't return it in the 'AvailInfo'. \begin{code} getLocalDeclBinders :: TcGblEnv -> HsGroup RdrName -> RnM [Name] -getLocalDeclBinders gbl_env (HsGroup {hs_valds = ValBindsIn val_decls val_sigs, +getLocalDeclBinders gbl_env (HsGroup {hs_valds = ValBindsIn val_decls val_sigs, hs_tyclds = tycl_decls, hs_instds = inst_decls, hs_fords = foreign_decls }) |
