-
Notifications
You must be signed in to change notification settings - Fork 10.7k
[SR-16108] Inconsistency between Any.Protocol and (any Any).Type #58367
Copy link
Copy link
Closed
Labels
compilerThe Swift compiler itselfThe Swift compiler itselfexistentialsFeature: values of types like `any Collection`, `Any` and `AnyObject`; type-erased valuesFeature: values of types like `any Collection`, `Any` and `AnyObject`; type-erased valuesmetatypesFeature → types: MetatypesFeature → types: Metatypestype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysistypesFeature: typesFeature: typesunexpected behaviorBug: Unexpected behavior or incorrect outputBug: Unexpected behavior or incorrect output
Metadata
Metadata
Assignees
Labels
compilerThe Swift compiler itselfThe Swift compiler itselfexistentialsFeature: values of types like `any Collection`, `Any` and `AnyObject`; type-erased valuesFeature: values of types like `any Collection`, `Any` and `AnyObject`; type-erased valuesmetatypesFeature → types: MetatypesFeature → types: Metatypestype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysistypesFeature: typesFeature: typesunexpected behaviorBug: Unexpected behavior or incorrect outputBug: Unexpected behavior or incorrect output
Environment
Xcode Version 13.3 (13E113), playground.
Additional Detail from JIRA
md5: 4161fe58e12b7763211c3196a2aed02c
Issue Description:
According to the proposal, https://github.com/apple/swift-evolution/blob/main/proposals/0335-existential-any.md#metatypes:
also,
However, the following code shows the two are not the same considering
Any:It seems,
(any Any).Typeis transformed intoAny.Typeby the compiler.Also, it is illegal to write something like
A same problem exists for
AnyObject.