You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Swift version 4.2 (swiftlang-1000.0.16.4 clang-1000.0.25.3) (Xcode 10 b1 version)
Additional Detail from JIRA
Votes
0
Component/s
Compiler
Labels
Bug
Assignee
None
Priority
Medium
md5: 70dcd571eb932fc888f8fe5e27f96a5d
relates to:
SR-8704 Cast from Any? to as? Value where Value == Any produces unexpected result in Xcode 10
Issue Description:
I'm seeing a weird behavior on Swift 4.2 when fetching values from a dictionary and casting them to Any.
To give more background, we have a storage that wraps a dictionary. The type of the underlying dictionary is [String: Any]?.
We typically access this from Swift with the following subscript:
The text was updated successfully, but these errors were encountered:
I'm not sure about your actual project, but the behavior of your REPL interactions makes sense to me. You've got a value of type Optional<Any>, and you try to convert that (statically or dynamically) to Any. The "easiest" way to do that conversion is to put the Optional itself in another layer of Any, without looking at what's inside.
Environment
Swift version 4.2 (swiftlang-1000.0.16.4 clang-1000.0.25.3) (Xcode 10 b1 version)
Additional Detail from JIRA
md5: 70dcd571eb932fc888f8fe5e27f96a5d
relates to:
Any?
toas? Value
where Value == Any produces unexpected result in Xcode 10Issue Description:
I'm seeing a weird behavior on Swift 4.2 when fetching values from a dictionary and casting them to
Any
.To give more background, we have a storage that wraps a dictionary. The type of the underlying dictionary is
[String: Any]?
.We typically access this from Swift with the following subscript:
The text was updated successfully, but these errors were encountered: