[Serialization] Distinguish between protocol/extension for types too. (#7794)

Replace an existing flag for cross-references to member types (that
wasn't getting much use) with one consistent with how we lookup
values. This fixes the case where someone actually has a useful type
as a member of a protocol extension, and that type gets referenced in
another module; Dispatch does exactly this.

Because you can currently only define typealiases in protocol
extensions, not new types, there's always a workaround for someone
hitting this issue: just use the underlying type.

https://bugs.swift.org/browse/SR-4076
This commit is contained in:
Jordan Rose
2017-02-28 10:36:46 -08:00
committed by GitHub
parent 48c10aa00b
commit 3639343c53
6 changed files with 14 additions and 10 deletions

View File

@@ -54,7 +54,7 @@ const uint16_t VERSION_MAJOR = 0;
/// in source control, you should also update the comment to briefly
/// describe what change you made. The content of this comment isn't important;
/// it just ensures a conflict if two people change the module format.
const uint16_t VERSION_MINOR = 320; // Last change: inherited protocols
const uint16_t VERSION_MINOR = 321; // Last change: restrict to extension
using DeclID = PointerEmbeddedInt<unsigned, 31>;
using DeclIDField = BCFixed<31>;
@@ -1181,7 +1181,7 @@ namespace decls_block {
using XRefTypePathPieceLayout = BCRecordLayout<
XREF_TYPE_PATH_PIECE,
IdentifierIDField, // name
BCFixed<1> // only in nominal
BCFixed<1> // restrict to protocol extension
>;
using XRefValuePathPieceLayout = BCRecordLayout<