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-12632] @_functionBuilder not working with one value #55076

Closed
swift-ci opened this issue Apr 20, 2020 · 2 comments
Closed

[SR-12632] @_functionBuilder not working with one value #55076

swift-ci opened this issue Apr 20, 2020 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-12632
Radar rdar://problem/62894520
Original Reporter hannesoid (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate
Environment

Xcode Version 11.4.1 (11E503a) (Swift 5.2)
macOS catalina 10.15.4

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: b9e9363e6c94a6abab1bf840516a03b0

duplicates:

  • SR-11628 Function Builder not working when only one value?

Issue Description:

The following code doesn't compile. shouldn't it ?

@_functionBuilder
public struct SomeBuilder {
    public static func buildBlock(_ children: Int...) -> Bool { return true }
}

func yo(@SomeBuilder numbers: () -> Bool) {}

yo { // this compiles
    1
    2
}

yo { // this doesn't
    1 // Cannot convert value of type 'Int' to closure result type 'Bool'
}

This may be duplicate of https://bugs.swift.org/browse/SR-11628 - but not sure and that one is resolved already.

@beccadax
Copy link
Contributor

beccadax commented May 5, 2020

@swift-ci create

@DougGregor
Copy link
Member

Yes, it's a dupe of https://bugs.swift.org/browse/SR-11628. It's fixed for Swift 5.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
Projects
None yet
Development

No branches or pull requests

3 participants