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

Allow separators to be omitted from lists. #22714

Closed
wants to merge 17 commits into from

Conversation

nate-chandler
Copy link
Contributor

@nate-chandler nate-chandler commented Feb 19, 2019

Enables newlines to be used in place of separators in some lists.

@nate-chandler
Copy link
Contributor Author

@swift-ci please test source compatibility

4 similar comments
@harlanhaskins
Copy link
Contributor

@swift-ci please test source compatibility

@AnnaZaks
Copy link
Contributor

@swift-ci please test source compatibility

@nate-chandler
Copy link
Contributor Author

@swift-ci please test source compatibility

@nate-chandler
Copy link
Contributor Author

@swift-ci please test source compatibility

@nate-chandler nate-chandler changed the title WIP: Allow separators to be omitted from lists. [WIP] Allow separators to be omitted from lists. Mar 13, 2019
@benlangmuir
Copy link
Contributor

benlangmuir commented Mar 22, 2019

@nate-chandler I wrote some tests for the IDE side; it looks like everything I've thought about is already working, which is great. I pushed an omit-comma-ide-tests branch to my swift fork: https://github.com/benlangmuir/swift/tree/omit-comma-ide-tests . You could probably just cherry-pick the two test commits at the top of that branch into this PR.

@nate-chandler
Copy link
Contributor Author

@benlangmuir Fantastic! Will do.

@nate-chandler
Copy link
Contributor Author

@benlangmuir Okay, the commits are cherry-picked to
cf8c2f6 and
97cfe0e .

@benlangmuir
Copy link
Contributor

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 28f1b7c

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 28f1b7c

@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 97cfe0eb01f8118717a7794e41d92fabfd17e94a

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 97cfe0eb01f8118717a7794e41d92fabfd17e94a

@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 8566d447e3545586c1aeb20a4ea8e9375ec87cb7

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 8566d447e3545586c1aeb20a4ea8e9375ec87cb7

@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Apr 1, 2019

Build failed
Swift Test Linux Platform
Git Sha - 11ffe3138759dbaadc802de834218ce7a0f236ca

@swift-ci
Copy link
Contributor

swift-ci commented Apr 1, 2019

Build failed
Swift Test OS X Platform
Git Sha - 11ffe3138759dbaadc802de834218ce7a0f236ca

@nate-chandler
Copy link
Contributor Author

@swift-ci please test source compatibility

@swift-ci
Copy link
Contributor

swift-ci commented Apr 5, 2019

Build failed
Swift Test Linux Platform
Git Sha - da4873b

@nate-chandler nate-chandler requested a review from xedin April 5, 2019 00:51
@swift-ci
Copy link
Contributor

swift-ci commented Apr 5, 2019

Build failed
Swift Test OS X Platform
Git Sha - acdd16f

@nate-chandler
Copy link
Contributor Author

@swift-ci Please clean test Linux platform

@swift-ci
Copy link
Contributor

swift-ci commented Apr 5, 2019

Build failed
Swift Test Linux Platform
Git Sha - acdd16f

@nate-chandler
Copy link
Contributor Author

@swift-ci please clean test

@swift-ci
Copy link
Contributor

swift-ci commented Apr 5, 2019

Build failed
Swift Test Linux Platform
Git Sha - acdd16f

@swift-ci
Copy link
Contributor

swift-ci commented Apr 5, 2019

Build failed
Swift Test OS X Platform
Git Sha - acdd16f

@nate-chandler nate-chandler requested a review from xedin April 5, 2019 17:34
Copy link
Contributor

@xedin xedin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@nate-chandler
Copy link
Contributor Author

@swift-ci please clean test

@swift-ci
Copy link
Contributor

swift-ci commented Apr 5, 2019

Build failed
Swift Test Linux Platform
Git Sha - faecb8d

@swift-ci
Copy link
Contributor

swift-ci commented Apr 5, 2019

Build failed
Swift Test OS X Platform
Git Sha - faecb8d

@nate-chandler
Copy link
Contributor Author

@swift-ci please test source compatibility

@tkremenek
Copy link
Member

@swift-ci build toolchain

@tkremenek
Copy link
Member

@swift-ci clean build toolchain

@tkremenek
Copy link
Member

@swift-ci clean build

@hartbit
Copy link
Contributor

hartbit commented Apr 11, 2019

I tried the toolchain and it doesn't seem to allow me eliding commas in parameter lists

@nate-chandler
Copy link
Contributor Author

I tried the toolchain and it doesn't seem to allow me eliding commas in parameter lists

Hi @hartbit,

Thanks for the report! What you're seeing is intentional behavior. The proposed change allows comma elision only in expression lists.

func foo(
    _ a: Int, // required here
    _ b: Int
)
    -> Int
{
    return a + b
}

let s = foo(
    1 // optional here
    2
)

@beccadax
Copy link
Contributor

Trying to build a toolchain with this feature and static subscripts.

@nate-chandler nate-chandler deleted the nate/omit-comma branch July 5, 2023 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants