Skip to content

[SR-15774] Error "the compiler is unable to type-check this expression in reasonable time" for what should be a fairly trivial expression #58051

@swift-ci

Description

@swift-ci
Previous ID SR-15774
Radar None
Original Reporter aaargh! (JIRA User)
Type Bug
Environment

IDE/Compiler: XCode version 13.2.1 (13C100), Apple Swift version 5.5.2 (swiftlang-1300.0.47.5 clang-1300.0.29.30)

OS: macOS 12.1

Arch: Arm64

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: d350d8f547493a4f867fe9cd4741de79

Issue Description:

The following code causes the compiler to fail with an "the compiler is unable to type-check this expression in reasonable time" error.

fileprivate extension URLSessionTaskTransactionMetrics {
    
    var timeOfLastEvent: Date? {
        responseEndDate ?? responseStartDate ?? requestEndDate ?? requestStartDate ?? connectEndDate ?? secureConnectionEndDate ?? secureConnectionStartDate ?? connectStartDate ?? domainLookupEndDate ?? domainLookupStartDate ?? fetchStartDate
    }
}

All properties here are of type Date?

Metadata

Metadata

Assignees

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselftype checkerArea → compiler: Semantic analysis

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions