mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #40994 from compnerd/undeserialized
AST,Sema: track and emit un-deserialized members
This commit is contained in:
7
test/Serialization/Inputs/CLibrary.h
Normal file
7
test/Serialization/Inputs/CLibrary.h
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
#ifndef CLibrary_h
|
||||
#define CLibrary_h
|
||||
|
||||
typedef struct __attribute__((__objc_bridge__(Object))) CObject *CObjectRef;
|
||||
|
||||
#endif
|
||||
4
test/Serialization/Inputs/module.modulemap
Normal file
4
test/Serialization/Inputs/module.modulemap
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
module CLibrary {
|
||||
header "CLibrary.h"
|
||||
}
|
||||
@@ -87,7 +87,19 @@ public class UserDynamicConvenienceSub: UserDynamicConvenience {
|
||||
}
|
||||
_ = UserDynamicConvenienceSub(conveniently: 0)
|
||||
|
||||
public class UserSub : User {} // expected-error {{cannot inherit from class 'User' because it has overridable members that could not be loaded}}
|
||||
public class UserSub : User {}
|
||||
// expected-error@-1 {{cannot inherit from class 'User' because it has overridable members that could not be loaded}}
|
||||
// expected-note@-2 {{could not deserialize 'wrappedProp'}}
|
||||
// expected-note@-3 {{could not deserialize 'returnsWrappedMethod()'}}
|
||||
// expected-note@-4 {{could not deserialize 'constrainedWrapped'}}
|
||||
// expected-note@-5 {{could not deserialize 'subscript(_:)'}}
|
||||
// expected-note@-6 {{could not deserialize 'subscript(_:)'}}
|
||||
// expected-note@-7 {{could not deserialize 'init(wrapped:)'}}
|
||||
// expected-note@-8 {{could not deserialize 'init(generic:)'}}
|
||||
// expected-note@-9 {{could not deserialize 'init(wrappedRequired:)'}}
|
||||
// expected-note@-10 {{could not deserialize 'init(wrappedRequiredInSub:)'}}
|
||||
// expected-note@-11 {{could not deserialize 'init(wrappedDynamic:)'}}
|
||||
// expected-note@-12 {{could not deserialize 'init(wrappedRequiredDynamic:)'}}
|
||||
|
||||
#endif // VERIFY
|
||||
|
||||
|
||||
25
test/Serialization/implementation-only-open.swift
Normal file
25
test/Serialization/implementation-only-open.swift
Normal file
@@ -0,0 +1,25 @@
|
||||
// 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
|
||||
Reference in New Issue
Block a user