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-1793] Type inference does not work with autoclosure #44402

Open
swift-ci opened this issue Jun 16, 2016 · 1 comment
Open

[SR-1793] Type inference does not work with autoclosure #44402

swift-ci opened this issue Jun 16, 2016 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself type checker Area → compiler: Semantic analysis

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-1793
Radar rdar://problem/21786778
Original Reporter fpg1503 (JIRA User)
Type Bug
Environment

Xcode 8.0 beta (8S128d) Playgrounds (Happens at least since Swift 2.0)

Additional Detail from JIRA
Votes 2
Component/s Compiler
Labels Bug, TypeChecker
Assignee None
Priority Medium

md5: a6cf52ed16f45c857930e752fd76c7b6

is duplicated by:

  • SR-7488 [Bool].reduce can't work with && simply

Issue Description:

General Swift cannot infer autoclosure when you apply a high order function, i.e.

func reduceBools(values: [Bool]) -> Bool {
    return values.reduce(false, combine: ||)
}

Gives the error "Ambiguous reference to member '||'"

Expected results: Code compiles and works fine.

@typesanitizer
Copy link

Related question on Swift forums today: https://forums.swift.org/t/adding-autoclosure-breaks-the-functions-usage/37738

@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
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

2 participants