Skip to content

[SR-5719] Ban autoclosure forwarding  #48289

Description

@DevAndArtist
Previous ID SR-5719
Radar rdar://problem/37321597
Original Reporter @DevAndArtist
Type Bug
Status Resolved
Resolution Done
Environment

Xcode 8.3.3

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

md5: 401a3fa1c8f5f08e5385cee515f04b79

is duplicated by:

Issue Description:

func autoclosureFoo(_ c: @autoclosure () -> Int) {
    print(c())
}

func autoclosureBar(_ c: @autoclosure () -> Int) {
    autoclosureFoo(c) // <-- This one here
    autoclosureFoo(c())
}

func baz(_ c: () -> Int) {
    autoclosureFoo(c) // does not work as expected
}

autoclosureBar(42)

If this requires a full review on the evolution side, let me know, I'll start a new thread.

Metadata

Metadata

Assignees

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itself

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions