[SR-215] Incorrect fix-it for misplaced @noescape #42837
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
good first issue
Good for newcomers
Additional Detail from JIRA
md5: eec6dd21d19b08b9b93d51d4ffb55740
Issue Description:
In recent gtihub swift, the fixit for a misplaced @NoEscape is incorrect.
% cat test.swift
func f(g: @NoEscape ()->Void) {
g()
}
% xcrun swiftc test.swift
test.swift:1:12: error: attribute can only be applied to declarations, not types
func f(g: @NoEscape ()->Void) {
^~~~~~~~
@NoEscape
This fixit moves @NoEscape to the function attribute position, which is incorrect. @NoEscape should be applied to the parameter (i.e. before `g`).
The text was updated successfully, but these errors were encountered: