Skip to content

[SR-563] if statements break infered closure return type #43180

@swift-ci

Description

@swift-ci
Previous ID SR-563
Radar None
Original Reporter revanistT3 (JIRA User)
Type Bug
Status Resolved
Resolution Won't Do
Environment

ubuntu 15.10

Swift version 2.2-dev (LLVM 3ebdbb2c7e, Clang f66c5bb67b, Swift 54dcd16)
Target: x86_64-unknown-linux-gnu

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

md5: d461b2a9257f701e02837cec155b5b67

Issue Description:

//compiles
let y = {
true
}
//does not compile
let y = {
if $1 > 1 {false}
true
}
//returns error "unable to infer closure type in the current context"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions