Skip to content

[CSStep] Skip default Void for closure result in presence of other …#90035

Open
xedin wants to merge 1 commit into
swiftlang:mainfrom
xedin:dont-attempt-void-for-closure-result
Open

[CSStep] Skip default Void for closure result in presence of other …#90035
xedin wants to merge 1 commit into
swiftlang:mainfrom
xedin:dont-attempt-void-for-closure-result

Conversation

@xedin

@xedin xedin commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

…successful choices

TypeVariableStep::shouldSkip would always produce false in diagnostic mode. This creates unnecessary work for closure result type variables if there is a contextual type available, because Void binding would always produce a worse solution in this case due to conversion mismatch with the contextual type and could be safely skipped.

…successful choices

`TypeVariableStep::shouldSkip` would always produce `false` in
diagnostic mode. This creates unnecessary work for closure result
type variables if there is a contextual type available, because `Void`
binding would always produce a worse solution in this case due to
conversion mismatch with the contextual type and could be safely
skipped.
@slavapestov

Copy link
Copy Markdown
Contributor

Test case?

@xedin

xedin commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

@slavapestov I don’t know how to form one that would test that there is no effect here of not attempting Void besides what we already have in test/expr/closure

@xedin

xedin commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

@swift-ci please smoke test

@xedin

xedin commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

@swift-ci please smoke test macOS platform

1 similar comment
@xedin

xedin commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

@swift-ci please smoke test macOS platform

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.

2 participants