PR52905 was originally papered over in a different way, but I believe this is the actually proper fix, or at least closer to it. We need to detect placeholder types as close to the front-end as possible, and cause them to fail constraints, rather than letting them persist into later stages.
Fixes https://llvm.org/PR52905
Fixes https://llvm.org/PR52909
Fixes https://llvm.org/PR53075
Btw, I strongly suspect that the presence of placeholder type UnknownAny all the way down in here is a bug (@rjmccall, thoughts?). But I found that the test suite didn't pass without this exception, and I'm not terribly interested in tracking down why; I don't have any idea what UnknownAny is, myself.