Files
swift-mirror/test/Serialization/implementation-only-open.swift
Saleem Abdulrasool 86de45a8e4 Sema: track and emit un-deserialized members
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.
2022-01-24 21:03:32 -08:00

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