Swift dictionary returns nil when it shouldn’t. It works fine in XCode. The code below will throw an exception in VS2017 .NET project:
public class Test {
public func test() {
var dict = [String: String]()
dict["test"] = "someString"
let hasValue: Bool = dict["test"] != nil
if !hasValue {
throw Exception("dict[test] is not nil!")
}
}
}
Update:
dict.keys.contains("test")
correctly returns true
.