The orphanRoleAnnotErr check is dead code
We have the following lines in RnSource.hs
:
mapM_ orphanRoleAnnotErr (nameEnvElts orphan_roles)
orphanRoleAnnotErr :: LRoleAnnotDecl GhcRn -> RnM ()
orphanRoleAnnotErr (dL->L loc decl)
= addErrAt loc $
hang (text "Role annotation for a type previously declared:")
2 (ppr decl) $$
parens (text "The role annotation must be given where" <+>
quotes (ppr $ roleAnnotDeclName decl) <+>
text "is declared.")
This check no longer fires since 6ab5da99, as the issue it was designed to prevent (#8485 (closed)) is solved more directly by using lookupSigCtxtOccRn
instead of lookupGlobalOccRn
.
I'm going to remove this dead code, patch coming.