Skip to content

[SR-2567] @autoclosure cannot be applied to tuples #45172

@phausler

Description

@phausler
Previous ID SR-2567
Radar None
Original Reporter @phausler
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, LanguageFeatureRequest
Assignee None
Priority Medium

md5: 26ec68f0c98bd78588f384b8ab365f26

Issue Description:

given the tuple of

(() -> A, () -> B)

I would expect to be able to write:

(@autoclosure () -> A, @autoclosure () -> B)

However it claims this is only applicable to function parameters (which the tuple is a parameter to a function). Which in turn means that I need to explode the application of @autoclosure to all combinations of the tuple. In the two case it is fairly trivial but it could compose down from four functions down to one. Which would be considerably nicer for code-reuse

Metadata

Metadata

Assignees

No one assigned

    Labels

    @autoclosureFeature → attributes: the @autoclosure type attributeattributesFeature: Declaration and type attributescompilerThe Swift compiler itselftuple typesFeature → types: Tuple typestuplesFeature: tuplestypesFeature: types

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions