Skip to content
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-215] Incorrect fix-it for misplaced @noescape #42837

Closed
gparker42 mannequin opened this issue Dec 13, 2015 · 4 comments
Closed

[SR-215] Incorrect fix-it for misplaced @noescape #42837

gparker42 mannequin opened this issue Dec 13, 2015 · 4 comments
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

Comments

@gparker42
Copy link
Mannequin

gparker42 mannequin commented Dec 13, 2015

Previous ID SR-215
Radar None
Original Reporter @gparker42
Type Bug
Status Closed
Resolution Invalid
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, StarterBug
Assignee jgarnham (JIRA)
Priority Medium

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`).

@swift-ci
Copy link
Collaborator

Comment by Josh Garnham (JIRA)

Looks like this occurs for all declaration attributes (not just @NoEscape) except for @autoclosure which already had some special handling. I've implemented a fix in PR #673 (#673).

@lattner
Copy link
Mannequin

lattner mannequin commented Mar 3, 2016

FYI, as of this patch:
c3c6bea

@NoEscape is allowed as a type attribute, so this isn't strictly necessary. It is still useful for other decl-only attributes (like @autoclosure) though.

@Dante-Broggi
Copy link
Contributor

I believe this is no longer valid. If so, it should be closed.

@swift-ci
Copy link
Collaborator

Comment by Josh Garnham (JIRA)

No longer valid due to changes to @NoEscape in Swift 3.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants