swift
4d2f3378 - [region-isolation] Do not ignore non-trivial results that are Sendable to be more permissive in the face of lazy typechecker issues.

Commit
1 year ago
[region-isolation] Do not ignore non-trivial results that are Sendable to be more permissive in the face of lazy typechecker issues. We have found certain cases due to the requestified typechecker, a type is initially Sendable and then is later non-Sendable. This can be seen by the attached test case where the first time one calls isNonSendableType on the test value, one would get that it is Sendable and then the second time one would get it was non-Sendable. The result of this is that the pass gets into an inconsistent state. This patch is a small patch that makes the pass more permissive in the face of such an error by making it so that we do not ignore Sendable results of instructions (that is we make sure to track a value for them), so we do not break invariants. The longer term better fix is to make it so that we have a cache in the pass for this query that way we just always use the first answer returned from the typechecker and cache that. If the typechecker has such a bug, we may get bogus results, but we at least do not break invariants. As an example of this type of behavior, in the test case in this patch, we first find the Sendable conformance of MySubClass and then the typechecker after doing some more type checking while performing that query, the second time finds the inherited non-Sendable conformance of MyParentClass causing MySubClass to be considered to be non-Sendable. rdar://132347404 (cherry picked from commit 8604480d12628277617ecb0828cbba78000e14fe)
Author
Committer
Parents
Loading