-
Notifications
You must be signed in to change notification settings - Fork 10.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SR-598] String initialized with [Any] causes runtime crash #43215
Comments
cc @atrick (according to https://twitter.com/jckarter/status/690567279428313088 ) |
I verified the crash on master.
As Jens pointed out, it's strange that we dispatch to String.init where Element == Character. At any rate, that attempts to initialize a String from a character with nil storage: (Character) $R2 = { I'm not sure why the code invokes the wrong String.init. It occurs at -Onone, with a debug stdlib and doesn't look like a runtime problem. |
Possibly related to https://bugs.swift.org/browse/SR-550 |
Seems to have been fixed. Could not reproduce in dev snapshot 2016-08-04. |
Additional Detail from JIRA
md5: 28a457a2eebf994c177f8f5e2ca4a7d3
Issue Description:
I have only tested this in swift-2.2-SNAPSHOT-2016-01-06-a-osx.pkg
(So maybe it's fixed in current master)
This program (cmd line prj, no imports) compiles fine but the resulting binary crashes at runtime:
Jumping to definition on the init of String.init(a) takes me here:
which seems a bit strange (since the elements of a are not Characters).
The text was updated successfully, but these errors were encountered: