mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
We want this to be a "toll-free" adoption of the class reference without requiring a second box allocation. Swift SVN r26711
13 lines
468 B
Swift
13 lines
468 B
Swift
// RUN: %target-swift-frontend -emit-silgen -sdk %S/Inputs -I %S/Inputs -enable-source-import %s | FileCheck %s
|
|
|
|
// REQUIRES: objc_interop
|
|
|
|
import Foundation
|
|
|
|
// CHECK-LABEL: sil hidden @_TF10objc_error25NSError_ErrorType_erasureFCSo7NSErrorPSs10_ErrorType_
|
|
// CHECK: [[ERROR_TYPE:%.*]] = init_existential_ref %0 : $NSError : $NSError, $_ErrorType
|
|
// CHECK: return [[ERROR_TYPE]]
|
|
func NSError_ErrorType_erasure(x: NSError) -> _ErrorType {
|
|
return x
|
|
}
|