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

Optional<some Any> is transformed to some Any? which doesn't compile #586

Closed
dnadoba opened this issue Aug 10, 2023 · 2 comments · Fixed by #589
Closed

Optional<some Any> is transformed to some Any? which doesn't compile #586

dnadoba opened this issue Aug 10, 2023 · 2 comments · Fixed by #589

Comments

@dnadoba
Copy link

dnadoba commented Aug 10, 2023

func foo(bar: Optional<some Any>) {}

is transformed to

func foo(bar: some Any?) {}

but afterwards no longer compiles.

It either needs braces:

func foo(bar: (some Any)?) {}

or kept as is.

Tested with latest main 8337523533bbd153cdac74c8fff4a1ac79a0b805

@allevato
Copy link
Member

Thanks for reporting this! It will be fixed by #589.

@dnadoba
Copy link
Author

dnadoba commented Aug 11, 2023

Awesome! That was really quick! Thanks a lot

allevato added a commit to allevato/swift-format that referenced this issue Sep 14, 2023
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 a pull request may close this issue.

2 participants