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

[SR-13575] The compiler is unable to type-check an expression in reasonable time after upgrading to Swift 5.3 #56013

Closed
iby opened this issue Sep 21, 2020 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself type checker Area → compiler: Semantic analysis

Comments

@iby
Copy link

iby commented Sep 21, 2020

Previous ID SR-13575
Radar rdar://problem/69307556
Original Reporter @iby
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, TypeChecker
Assignee None
Priority Medium

md5: dad6add2c632692e079d40d0afe7ecff

Issue Description:

After upgrading to Xcode 12 and Swift 5.3 I'm seeing the compiler error:

The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions

For this code, which isn't particularly complex:

private func updateSize(_ newSize: CGSize?) {
    self.size = newSize.map({ $0 == CGSize.zero || $0.width <= 0 || $0.height <= 0 }) == true ? nil : newSize
}
private var size: CGSize?

This doesn't feel right and the error wasn't there before. Perhaps a regression or something similar? Also, a replacing the above with the following works without any problems:

newSize.map({ $0 == CGSize.zero || $0.width <= 0 || $0.height <= 0 }) ?? false ? nil : newSize
@typesanitizer
Copy link

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@iby
Copy link
Author

iby commented Sep 17, 2022

This seems to be resolved now.

@iby iby closed this as completed Sep 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

2 participants