Commit 950c5e9
committed
AST: Improve handling of missing @objc async protocol witnesses.
Serialization now enumerates the value witnesses of conformances with a
resolver in order to facilitate lazy type checking
(#68262). This change in behavior introduced
an assertion failure when compiling modules from swiftinterface when the
interface contains a conformance to an `@objc` protocol that has a requirement
that is imported with an `async` variant. The `forEachValueWitness()`
invocation during serialization was causing the missing witness for an objc
async protocol requirement to be resolved after conformance check was already
marked "complete". This witness had not been previously resolved because
`ConformanceChecker::resolveValueWitnesses()` had special logic to skip objc
protocol requirements with witnessed siblings, whereas `forEachValueWitness()`
did not.
There are multiple potential solutions to this problem, but the one that seemed
least disruptive to me was to stop skipping resolution of these sibling
witnesses during `ConformanceChecker::resolveValueWitnesses()`. When I looked
into why they were being skipped, I discovered that this seemed to be a
concession to bugs in the logic for pruning missing witnesses. When I adjusted
the pruning logic it no longer became necessary to skip witnesses in
`ConformanceChecker::resolveValueWitnesses()` in order to avoid incorrect
diagnostics.
Resolves rdar://1194352531 parent f08f86c commit 950c5e9
File tree
2 files changed
+59
-39
lines changed- lib/Sema
- test/Serialization
2 files changed
+59
-39
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3804 | 3804 | | |
3805 | 3805 | | |
3806 | 3806 | | |
3807 | | - | |
| 3807 | + | |
3808 | 3808 | | |
3809 | 3809 | | |
3810 | 3810 | | |
| |||
3814 | 3814 | | |
3815 | 3815 | | |
3816 | 3816 | | |
3817 | | - | |
3818 | | - | |
3819 | | - | |
3820 | | - | |
3821 | | - | |
3822 | | - | |
3823 | | - | |
3824 | | - | |
3825 | 3817 | | |
3826 | 3818 | | |
3827 | 3819 | | |
| |||
3857 | 3849 | | |
3858 | 3850 | | |
3859 | 3851 | | |
| 3852 | + | |
| 3853 | + | |
| 3854 | + | |
| 3855 | + | |
| 3856 | + | |
| 3857 | + | |
| 3858 | + | |
| 3859 | + | |
| 3860 | + | |
| 3861 | + | |
| 3862 | + | |
| 3863 | + | |
| 3864 | + | |
| 3865 | + | |
| 3866 | + | |
| 3867 | + | |
| 3868 | + | |
| 3869 | + | |
| 3870 | + | |
3860 | 3871 | | |
3861 | 3872 | | |
3862 | 3873 | | |
3863 | | - | |
3864 | | - | |
3865 | | - | |
| 3874 | + | |
| 3875 | + | |
| 3876 | + | |
| 3877 | + | |
3866 | 3878 | | |
3867 | 3879 | | |
3868 | 3880 | | |
3869 | 3881 | | |
3870 | | - | |
3871 | | - | |
3872 | | - | |
3873 | | - | |
3874 | | - | |
3875 | | - | |
3876 | | - | |
3877 | | - | |
| 3882 | + | |
| 3883 | + | |
| 3884 | + | |
| 3885 | + | |
3878 | 3886 | | |
3879 | 3887 | | |
3880 | 3888 | | |
3881 | | - | |
3882 | | - | |
3883 | | - | |
| 3889 | + | |
| 3890 | + | |
| 3891 | + | |
3884 | 3892 | | |
3885 | 3893 | | |
3886 | 3894 | | |
| |||
5402 | 5410 | | |
5403 | 5411 | | |
5404 | 5412 | | |
5405 | | - | |
5406 | | - | |
5407 | | - | |
5408 | | - | |
5409 | | - | |
5410 | | - | |
5411 | | - | |
5412 | | - | |
5413 | | - | |
5414 | | - | |
5415 | | - | |
5416 | | - | |
5417 | | - | |
5418 | | - | |
5419 | | - | |
5420 | | - | |
5421 | 5413 | | |
5422 | 5414 | | |
5423 | 5415 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
0 commit comments