= getUniqSM `thenSM` \ uniq ->
let
-- Give the new Id a similar occurrence name to the old one
+ -- We used to add setIdNoDiscard if the old id was exported, to
+ -- avoid it being dropped as dead code, but that's not necessary any more.
name = idName old_id
new_id = mkUserLocal (mkSpecOcc (nameOccName name)) uniq new_ty (getSrcLoc name)
-
- -- If the old Id was exported, make the new one non-discardable,
- -- else we will discard it since it doesn't seem to be called.
- new_id' | isExportedId old_id = setIdNoDiscard new_id
- | otherwise = new_id
in
- returnSM new_id'
+ returnSM new_id
newTyVarSM
= getUniqSM `thenSM` \ uniq ->