[SR-13421] Type checker regression and crash in Xcode 12 beta 5 #55862
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
crash
Bug: A crash, i.e., an abnormal termination of software
regression
swift 5.3
type checker
Area → compiler: Semantic analysis
Environment
Xcode 12 beta 5 (12A8189h)
Apple Swift version 5.3 (swiftlang-1200.0.28.1 clang-1200.0.30.1) Target: x86_64-apple-darwin19.5.0
Nimble 8.1.1 and 9.0.0-rc.1
Additional Detail from JIRA
md5: 34d150037f0b6c1807d377f1be03a70c
relates to:
Issue Description:
The type checker in Swift distributed with Xcode 12 beta 5 fails on existing code (that has worked since at least Xcode 11). For smaller samples the type checker “just” fails with a
Ambiguous use of 'expect'
, however for targets with more cases it causes a crash (see below for a stack trace).I’ve also filed
FB8464226
for this.What did you do?
I installed Xcode 12 beta 5 and tried to build our existing (test) code:
What did you expect to happen?
I expected the code to compile.
What actually happened instead?
The code failed to compile with a `ambiguous use of 'expect'` error. With these two candidates:
Sources/Nimble/DSL.swift#L1-L8
public func expect<T>(_ expression: @autoclosure @escaping () throws -> T?, file: FileString = #file, line: UInt = #line) -> Expectation<T>
Sources/Nimble/DSL.swift#L10-L17
public func expect<T>(_ file: FileString = #file, line: UInt = #line, expression: @escaping () throws -> T?) -> Expectation<T>
Project that demonstrates the issue
https://github.com/rastersize/Xcode12Beta5Nimble
After cloning do the following:
Run
carthage.sh bootstrap
arm64
slice for both the simulator and device, and a universal binary can’t contain two slices for the same architecture.Open the Xcode project
Build for testing
Workaround
Change the call-site of
expect
to specify using the non-autoclosure function. That is:Not as pretty but it works for now.
Stack trace from crash
The text was updated successfully, but these errors were encountered: