* [Diagnostics] Use DeclDescriptiveKind on data flow diagnostics to improve diagnostic message
* [tests] Add regression tests to SILOptimizer/return.swift
* [tests] Adapt other tests to changes of SR-14505
* [Diagnostics] Adapt message for missing return diagnostics, remove article
* [Diagnostics] Adapt message for missing return diagnostics to have a note with fix
* [tests] Adjust tests in validation suit
The problem was that the unreachable instruction after the IUO unwrapping error call was interpreted as missing-return-unreachable.
rdar://problem/36611041
Turn on the noreturn diagnostic for cases where a reachable unreachable
could be encountered. Previously, the diagnostic would not fire if the
function was marked noreturn and any of its reachable unreachable calls
were around. While this makes sense from a SILGen perspective (it Just
Crashes tm), it is still wrong. We need to diagnose *everything* that
has reachable unreachables.
Previously, isNever would return true for an equivalence class of
uninhabited enums. The rest of the compiler, however, is using this in
places that actually expect just the Never type. This means that code
like this would compile properly
enum Uninhabited {}
func do() -> Uninhabited { /* No body here */ }
and we wouldn’t diagnose the missing return.