Don't warn about ambiguous identifiers when the candidate names belong to the same type
Don't warn about ambiguous identifiers when the candidate names belong to the same type

This also changes the defaulting heuristic for ambiguous identifiers.
We now prefer local names primarily, and type constructors or class
names secondarily.

Partially fixes #854.

(cherry picked from commit d504a2864a4e1982e142cf88c023e7caeea3b76f)

haskell/haddock,haskell/haddock,haskell/haddock,haskell/haddock,haskell/haddock