Commit c464741
committed
Sema: Allow _diagnoseUnavailableCodeReached() to not exist in the stdlib.
Sometimes the compiler may need to build with an out-of-date standard library
and we can't assume recently added well-known declarations are present. When
synthesizing Hashable and Equatable conformances, if
`_diagnoseUnavailableCodeReached()` isn't present then just generate the body
of the case normally instead. This isn't ideal, but there isn't any existing
infrastructure to generate a call to `fatalError()` at the AST level and this
should be a rare edge case where we're simply falling back to the previous
behavior where unavailable cases weren't handled at all.
No tests because it isn't straight forward to compile with an intentionally
broken standard library that's missing some declarations.
Resolves rdar://1205541831 parent 2c2f05e commit c464741
1 file changed
+7
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
496 | 496 | | |
497 | 497 | | |
498 | 498 | | |
| 499 | + | |
499 | 500 | | |
500 | 501 | | |
501 | 502 | | |
| |||
939 | 940 | | |
940 | 941 | | |
941 | 942 | | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
942 | 949 | | |
943 | 950 | | |
944 | 951 | | |
| |||
0 commit comments