Skip to content

Sema: Check worseThanBestSolution() in a better place #76682

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

Merged
merged 4 commits into from
Sep 25, 2024

Conversation

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Sep 24, 2024

This change speeds up this test case, but it remains exponential:

let x: Int? = nil

func f<T>(_: T?, _: T) -> T {}
func f<T>(_: T?, _: T?) -> T? {}

let _ = [f(x, 0), f(x, 0), f(x, 0), f(x, 0), f(x, 0), f(x, 0), f(x, 0), f(x, 0)]

Also, clean up DeepEquality for protocol compositions. This is one of the blockers towards enabling protocol compositions that contain parameterized protocol types, like any Sequence<Int> & Sendable, etc.

@slavapestov slavapestov force-pushed the worse-than-best-solution branch from 32b58ca to 4ad93dc Compare September 24, 2024 23:12
@slavapestov slavapestov marked this pull request as ready for review September 24, 2024 23:13
@slavapestov slavapestov force-pushed the worse-than-best-solution branch from 4ad93dc to 4d980ec Compare September 25, 2024 01:50
@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov slavapestov merged commit 680541d into swiftlang:main Sep 25, 2024
5 checks passed
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.

1 participant