| Summary: | False-positive warning for Array.prototype.reduce() | ||
|---|---|---|---|
| Product: | [Applications] kdevelop | Reporter: | Francis Herne <mail> |
| Component: | Language Support: QML/JavaScript | Assignee: | kdevelop-bugs-null |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | git master | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | Screenshot of issue | ||
Could you check if this is still valid in newer KDevelop? There's no error indicated with KDevelop 5.2 here. Not reproducible for me either with 5.2. |
Created attachment 94929 [details] Screenshot of issue I have code: var foo = ["aaa", "bbb", "ccc"]; foo.reduce(function(previousValue, currentValue, index, array) { return previousValue + currentValue; }, ""); The area within the reduce() brackets (including the "" argument) is highlighted green with the following tooltip: Problem in Semantic analysis: Possible type mismatch between the argument type (function void ()) and the value passed as argument (function mixed (mixed, mixed, mixed, mixed)) Obviously the first argument to reduce() can't be void.tg