Commit 84205e3
committed
[CodeCompletion] Fix a crash in collectPossibleReturnTypesFromContext
Avoid re-typechecking for nested closures. For example:
Something {
Other {
#^COMPLETE^#
}
}
If 'Something' is successfully type checked but 'Other' is failed, the
outer closure has type, but the inner closure doesn't. In such state,
when the type of 'Other' is requested, the outer closure used to be
re-typechecked. That may cause crash because it may contain expressions
CSGen doesn't expect.
rdar://problem/692468911 parent 7f2185d commit 84205e3
File tree
2 files changed
+18
-4
lines changed- lib/Sema
- validation-test/IDE/crashers_2_fixed
2 files changed
+18
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1933 | 1933 | | |
1934 | 1934 | | |
1935 | 1935 | | |
1936 | | - | |
| 1936 | + | |
1937 | 1937 | | |
1938 | | - | |
1939 | | - | |
1940 | | - | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
1941 | 1943 | | |
1942 | 1944 | | |
1943 | 1945 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
0 commit comments