Protocol existentials do not trigger warnings if they will never be executed #73649
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
diagnostics QoI
Bug: Diagnostics Quality of Implementation
existentials
Feature: values of types like `any Collection`, `Any` and `AnyObject`; type-erased values
missing warning
Bug: Missing warning
SILGen
Area → compiler: The SIL generation stage
swift 6.0
Description
Early returns do not trigger warnings for protocol existentials, see example below
Reproduction
Expected behavior
early return should cause a compiler warning on the code that will never be executed
Environment
$ swift-driver version: 1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
Target: arm64-apple-macosx14.0
Additional information
using a generic brings the warning back, e.g.
The text was updated successfully, but these errors were encountered: