Skip to content

Conversation

@calda
Copy link
Contributor

@calda calda commented Jan 4, 2026

This PR adds a proposal to add support for trailing closures following array and dictionary literals. This enables trailing closure syntax for init(_:)s defined on Array and Dictionary.

Example:

extension Array {
    init(@ArrayBuilder build: () -> [Element]) {
        self = build()
    }
}

let value = [String] {
    "a"
    "b"
    "c"
}

@calda calda force-pushed the cal--array-trailing-closures branch 2 times, most recently from 872c052 to dcfd9f9 Compare January 4, 2026 21:26
@calda calda force-pushed the cal--array-trailing-closures branch from dcfd9f9 to a2b1b52 Compare January 5, 2026 00:04
@rjmccall rjmccall added LSG Contains topics under the domain of the Language Steering Group new proposal Adds a new proposal document labels Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LSG Contains topics under the domain of the Language Steering Group new proposal Adds a new proposal document

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants