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-ci opened this issue
Sep 5, 2016
· 3 comments
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfcrashBug: A crash, i.e., an abnormal termination of softwareparserArea → compiler: The legacy C++ parser
Xcode playground crashes when using array.map in the following code. The crashlog is attached to this bug report.
struct Day {
var day: String
}
var mondays: [Day] = []
for i in 0..<10 {
let day = Day(day: "Monday")
mondays.append(day)
}
print(mondays)
// create a new array where all days have the day property set to 'Tuesday'
let tuesdays = mondays.map { (var d) -> Day in
d.day = "Tuesday"
return d
}
print(tuesdays)
The text was updated successfully, but these errors were encountered:
We don't reject it at parse time, because we add a fixit to move it inside the declaration in Sema. The issue here seems to be that the var validation check is guarded by decl->getTypeLoc().getTypeRepr(), which lets it slide through Sema until it trips a sanity check in SILGen.
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfcrashBug: A crash, i.e., an abnormal termination of softwareparserArea → compiler: The legacy C++ parser
Attachment: Download
Environment
Xcode 8b6, Swift 3
Additional Detail from JIRA
md5: b14473829d27e08f50fd1fa7724f6baf
Issue Description:
(see also SO: http://stackoverflow.com/questions/39333617/use-map-to-change-struct-property-into-new-array/39334461#39334461)
Xcode playground crashes when using array.map in the following code. The crashlog is attached to this bug report.
The text was updated successfully, but these errors were encountered: