mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Remote mirrors was hitting an assertion failure due to a generic parameter not being concrete. This check catches that case early and returns a clean failure from getSubstMap, which callers can then handle appropriately. It also hit a casting failure in visitDependentMemberTypeRef, which assumed that SubstBase was either a NominalTypeRef or a BoundGenericTypeRef. This does a dynamic cast with a graceful failure. In general there is a tension in this code between its use in the runtime, where we usually want to treat bad data as a horrible bug and fail loudly, and its use in remote mirrors, where we need to assume that the data we're examining might be horribly broken and we just want to do the best we can. Longer term we might want to make this code configurable so that we can have an "assert and die" mode for the runtime, and a "fail gracefully" mode for remote mirrors. rdar://problem/40136609