{"action":"created","issue":{"url":"https://api.github.com/repos/apple/swift/issues/9223","repository_url":"https://api.github.com/repos/apple/swift","labels_url":"https://api.github.com/repos/apple/swift/issues/9223/labels{/name}","comments_url":"https://api.github.com/repos/apple/swift/issues/9223/comments","events_url":"https://api.github.com/repos/apple/swift/issues/9223/events","html_url":"https://github.com/apple/swift/pull/9223","id":226007205,"number":9223,"title":"[swift-4.0 branch] [runtime] Fix assignment of Any with mismatched ty…","user":{"login":"aschwaighofer","id":15268288,"avatar_url":"https://avatars1.githubusercontent.com/u/15268288?v=3","gravatar_id":"","url":"https://api.github.com/users/aschwaighofer","html_url":"https://github.com/aschwaighofer","followers_url":"https://api.github.com/users/aschwaighofer/followers","following_url":"https://api.github.com/users/aschwaighofer/following{/other_user}","gists_url":"https://api.github.com/users/aschwaighofer/gists{/gist_id}","starred_url":"https://api.github.com/users/aschwaighofer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aschwaighofer/subscriptions","organizations_url":"https://api.github.com/users/aschwaighofer/orgs","repos_url":"https://api.github.com/users/aschwaighofer/repos","events_url":"https://api.github.com/users/aschwaighofer/events{/privacy}","received_events_url":"https://api.github.com/users/aschwaighofer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2017-05-03T14:34:07Z","updated_at":"2017-05-03T21:11:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apple/swift/pulls/9223","html_url":"https://github.com/apple/swift/pull/9223","diff_url":"https://github.com/apple/swift/pull/9223.diff","patch_url":"https://github.com/apple/swift/pull/9223.patch"},"body":"…pes.\r\n\r\nThe COW existential implementation sets the existential box's\r\nnew value but fails to set the box's new type. Hijinks ensue\r\nwhen the new value is later used as if it were of the old type.\r\n\r\nrdar://31955457\r\n(cherry picked from commit 2ad2f26024e159dd14f80440fc55ca06eda25510)\r\n\r\n• Explanation: The value witness for existential boxes in assignWith(Take/Copy) missed a copy of the  metadata field.\r\n\r\n• Scope of Issue:  This causes issues when we assign an existential of one type to an existential of another type because we loose.\r\n\r\n    var dict: [String: Any] = [\"foo\": 0x11111111 as NSNumber]\r\n    print(dict)  // succeeds\r\n    dict[\"foo\"] = 0x22222222\r\n    print(dict)  // crashes\r\n\r\n• Origination: This was introduced with COW existential (the original implementation had the copy).\r\n\r\n• Risk: Low. By adding the type copy we can only make the code more correct.\r\n\r\n• Reviewed By: Arnold (Authored by Greg)\r\n"},"comment":{"url":"https://api.github.com/repos/apple/swift/issues/comments/299036741","html_url":"https://github.com/apple/swift/pull/9223#issuecomment-299036741","issue_url":"https://api.github.com/repos/apple/swift/issues/9223","id":299036741,"user":{"login":"aschwaighofer","id":15268288,"avatar_url":"https://avatars1.githubusercontent.com/u/15268288?v=3","gravatar_id":"","url":"https://api.github.com/users/aschwaighofer","html_url":"https://github.com/aschwaighofer","followers_url":"https://api.github.com/users/aschwaighofer/followers","following_url":"https://api.github.com/users/aschwaighofer/following{/other_user}","gists_url":"https://api.github.com/users/aschwaighofer/gists{/gist_id}","starred_url":"https://api.github.com/users/aschwaighofer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aschwaighofer/subscriptions","organizations_url":"https://api.github.com/users/aschwaighofer/orgs","repos_url":"https://api.github.com/users/aschwaighofer/repos","events_url":"https://api.github.com/users/aschwaighofer/events{/privacy}","received_events_url":"https://api.github.com/users/aschwaighofer/received_events","type":"User","site_admin":false},"created_at":"2017-05-03T21:11:30Z","updated_at":"2017-05-03T21:11:30Z","body":"@swift-ci Please smoke test"}}
{"actor":{"display_login":"aschwaighofer"}}