Emerge Portage – Multiple package instances within a single package resulting slot conflict

As usual at least once a month, I came across a bug in The Portage Tree of Gentoo Linux.
root@v-teq-laptop $ emerge -Dup world # --deep --update --pretend !!! Multiple package instances within a single package slot have been pulled !!! into the dependency graph, resulting in a slot conflict: sys-libs/readline:0 ('ebuild', '/', 'sys-libs/readline-5.2_p13', 'merge') pulled in by =sys-libs/readline-5* required by ('ebuild', '/', 'dev-lang/ghc-6.8.2', 'merge') (and 16 more) ('installed', '/', 'sys-libs/readline-6.0', 'nomerge') pulled in by sys-libs/readline:0 required by world sys-libs/readline required by system sys-libs/readline required by world (and 13 more) It may be possible to solve this problem by using package.mask to prevent one of those packages from being selected. However, it is also possible that conflicting dependencies exist such that they are impossible to satisfy simultaneously. If such a conflict exists in the dependencies of two different packages, then those packages can not be installed simultaneously. For more information, see MASKED PACKAGES section in the emerge man page or refer to the Gentoo Handbook.
To get rid of such package conflict you have to add package name into package.mask file. And even better is to put there only one version of those conflicted packages.
There you can see example solution of this kind of bug:
echo ">=sys-libs/readline-6.0" >> /etc/portage/package.mask
