[flang] Fix bug with generic and specific having same name
If a generic interface had a specific procedure with the same name that
is specified by an interface body, it was not handled correctly.
We were replacing the generic symbol with the symbol for the specific
procedure. Instead, leave the generic symbol in the scope and just
insert the new symbol for the specific into the generic.
Also, don't do distinguishability checks when one of the specific
procedures already has an error.
Fixes flang-compiler/f18#587.
Original-commit: flang-compiler/f18@
2e905656758d7214635fb96a612760405b368b09
Reviewed-on: https://github.com/flang-compiler/f18/pull/640