Enabling upcoming feature ExistentialAny
does not work for standard library protocols.
#65034
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
swift 5.9
type checker
Area → compiler: Semantic analysis
Description
Enabling upcoming feature
ExistentialAny
does not work for standard library protocols.For example, it should produce a compile error, considering
Decoder
is a bare protocol. However, the compiler does not produce any error or warning, even though for other non-standard library protocols it produces errors and warnings correctly.Steps to reproduce
swift repl -enable-upcoming-feature ExistentialAny
It produces an error
It works!
Expected behavior
Codable
should also produce a compile error, but it doesn't.Environment
As I checked, it seems
any P
check is not working for standard library protocols without associated types includingCodable
,Decoder
,Encoder
,CustomStringConvertible
,CustomDebugStringConvertible
,ExpressibleBy*Literal
, and so on.Forum thread: https://forums.swift.org/t/any-p-check-doesnt-work-for-standard-library-protocols/64276
The text was updated successfully, but these errors were encountered: