mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The crash on `SILFunction type mismatch` provides little information and tends to be difficult to reproduce. Let's print some of the available information and distinguish the two failure sites. I'm not confident all required information is written down so we may need to improve this further in the future. This version still crashes the compiler, we may want a proper type-check to prevent this failure with a clean diagnostic for the example used here. rdar://53821031
14 lines
402 B
Swift
14 lines
402 B
Swift
// RUN: not --crash %target-swift-frontend -c %s 2>&1 | %FileCheck %s
|
|
// CHECK: *** DESERIALIZATION FAILURE ***
|
|
// CHECK: SILFunction type mismatch for 'asinf': '$@convention(thin) (Float) -> Float' != '$@convention(c) (Float) -> Float'
|
|
|
|
// REQUIRES: VENDOR=apple
|
|
|
|
import Darwin
|
|
|
|
@_silgen_name("asinf") internal func quux(_ x: Float) -> Float
|
|
|
|
public func bar(_ x: Float) -> Float {
|
|
return quux(x)
|
|
}
|