Swift dictionary nil issue

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.

Thanks, logged as bugs://82211

bugs://82211 got closed with status fixed.

I’m afraid this still doesn’t work. Running the attached project causes ArgumentNullException. Using VS2017 and Silver .2399.

DictionaryNilTest.zip (303.0 KB)

bugs://82211 got reopened.

bugs://82211 got closed with status fixed.