mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This adds tracking of the vtable holes due to a failure to deserialize vtable entries. This allows for the user to be able to identify what member failed to be deserialied and can aid in understanding why an `open` class may not be subclassed. Future improvements here would allow tracing the XRefPath which failed to be deserialied. However, this still provides an improvement over the existing experience where there is no available information on why the class cannot be inherited from.
26 lines
836 B
Swift
26 lines
836 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %empty-directory(%t/swift)
|
|
// RUN: %target-swift-frontend -emit-module -emit-module-path %t/swift/SwiftLibrary.swiftmodule %s -module-name SwiftLibrary -I%S/Inputs
|
|
// RUN: %target-typecheck-verify-swift -DCLIENT -c %s -module-name client -I%t/swift
|
|
|
|
#if CLIENT
|
|
import SwiftLibrary
|
|
|
|
public class MyObject: Object {
|
|
// expected-error@-1 {{cannot inherit from class 'Object' because it has overridable members that could not be loaded}}
|
|
// expected-note@-2 {{could not deserialize 'raw'}}
|
|
// expected-note@-3 {{could not deserialize 'init(object:)'}}
|
|
}
|
|
#else
|
|
@_implementationOnly import CLibrary
|
|
|
|
open class Object {
|
|
internal var storage: AnyObject
|
|
internal var raw: CObject { unsafeBitCast(storage, to: CObject.self) }
|
|
|
|
fileprivate init(object: CObject) {
|
|
self.storage = object
|
|
}
|
|
}
|
|
#endif
|