[SR-13906] Error message is unclear when a type conforms to AnyObject or a composition of it #56304
Labels
compiler
The Swift compiler in itself
diagnostics QoI
Bug: Diagnostics Quality of Implementation
good first issue
Good for newcomers
improvement
inheritance
Feature → type declarations → class: Subclassing and inheritance of class members
swift 5.3
type checker
Area → compiler: Semantic analysis
Environment
Apple Swift version 5.3.2 (swiftlang-1200.0.44.1 clang-1200.0.32.28)
macOS 10.15.7 (19H15); x86_64-apple-darwin19.6.0
Additional Detail from JIRA
md5: fc60657a00f25cb82f7af51339e8e32b
Issue Description:
Currently, the error message is "Inheritance from non-protocol type ..." when a type tries to conform to
AnyObject
or a composition ofAnyObject
and some other protocols:It would be better if the error message is "non-protocol 'T' cannot conform to 'AnyObject'":
The text was updated successfully, but these errors were encountered: