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-8807] Optional type annotation on a function declaration #51315

Open
swift-ci opened this issue Sep 20, 2018 · 1 comment
Open

[SR-8807] Optional type annotation on a function declaration #51315

swift-ci opened this issue Sep 20, 2018 · 1 comment
Labels
compiler The Swift compiler in itself feature A feature request or implementation improvement

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-8807
Radar None
Original Reporter BinkanSalaryman (JIRA User)
Type Improvement
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement, LanguageFeatureRequest
Assignee None
Priority Medium

md5: 3996b865d54561ed74e814cb8778d233

Issue Description:

It would be nice if we could put a type annotation on a function declaration, as we can can already for constants, variables, properties, structures and classes. The major motivation for this feature is to declare functions in a protocol whose signatures should match specific function type by typealias, where the functions may be passed later per reference.

As pointed out by rraphael in Make func type explicit (Stack Overflow) - the grammar of a function declaration doesn't allow this currently.

@belkadan
Copy link
Contributor

If you're interested in championing this, you should take it through the Swift Evolution Process.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler The Swift compiler in itself feature A feature request or implementation improvement
Projects
None yet
Development

No branches or pull requests

2 participants