mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
When using `-experimental-skip-all-function-bodies` we don’t run the `TypeCheckSourceFileRequest` and thus don’t go through the decl checker, which calls `InheritedTypeRequest` on all inheritance clauses. This means that the inherited entries are not populated by the time we serialize the module. Trigger the computation of inherited entries by calling `InheritedTypeRequest` during serialization. Unfortunately, we can’t use the type returned by `getResolvedType` for the serialization because `getResolvedType` returns an inverted protocol type for suppressed conformances but during serialization, we want to serialize the suppressed type with a `isSuppressedBit`. We thus need to call `getEntry(i).getType()` again to get the type to serialize. rdar://141440011
9 lines
470 B
Swift
9 lines
470 B
Swift
public protocol MyProto {}
|
|
public struct MyStruct: MyProto {}
|
|
|
|
// RUN: %empty-directory(%t)
|
|
// RUN: %swift -emit-module -o %t/swift_mod.swiftmodule %s -parse-as-library -experimental-skip-all-function-bodies -experimental-skip-non-exportable-decls -experimental-lazy-typecheck -target %target-triple
|
|
// RUN: %target-swift-synthesize-interface -module-name swift_mod -I %t -o - -target %target-triple | %FileCheck %s
|
|
|
|
// CHECK: public struct MyStruct : swift_mod.MyProto
|