- returnRn (InstD (InstDecl inst_ty' mbinds' new_uprags dfun_name' src_loc))
- where
- rn_dfun Nothing = newDfunName src_loc `thenRn` \ n' ->
- returnRn (Just n')
- rn_dfun (Just n) = lookupOccRn n `thenRn` \ n' ->
- -- The dfun is not optional, because we use its version number
- -- to identify the version of the instance declaration
- returnRn (Just n')
+ newDfunName maybe_dfun src_loc `thenRn` \ dfun_name ->
+ addOccurrenceName Compulsory dfun_name `thenRn_`
+ -- The dfun is not optional, because we use its version number
+ -- to identify the version of the instance declaration