[SR-8753] wrong error message is given when you attempt to mutate parameters inside a reduce block #51261
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
diagnostics QoI
Bug: Diagnostics Quality of Implementation
type checker
Area → compiler: Semantic analysis
Environment
Swift 4.1.2
Xcode 9.4.1
Additional Detail from JIRA
md5: 2e445a28e7ba51855d170331b7ee7e6a
Issue Description:
As recorded on stackoverflow:
{code:none}
var nums = [1,2,3]
let emptyArray : [Int] = []
let sum1 = nums.reduce(emptyArray){ $0.append($1)}
Then the error would correctly come as:
The text was updated successfully, but these errors were encountered: