mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Serialization] Allow unbound generic types to cross-reference typealias decls
Ideally `UnboundGenericType` should never be serialized but it is currently allowed to make generic `typealias` declarations without specifying generic parameters, so it should be allowed to cross reference typealias decls in such types as well because `NameAliasType` can't be used until generic parameters are resolved. This is only a temporary fix and more comprehensive solution is still pending here, most likely such declarations should not produce `UnboundGenericType` but instead should copy generic parameters from underlying type and produce proper `NameAliasType`. Resolves: rdar://problem/37384120
This commit is contained in:
@@ -3943,7 +3943,9 @@ void Serializer::writeType(Type ty) {
|
||||
|
||||
unsigned abbrCode = DeclTypeAbbrCodes[UnboundGenericTypeLayout::Code];
|
||||
UnboundGenericTypeLayout::emitRecord(Out, ScratchRecord, abbrCode,
|
||||
addDeclRef(generic->getDecl()),
|
||||
addDeclRef(generic->getDecl(),
|
||||
/*forceSerialization*/false,
|
||||
/*allowTypeAliasXRef*/true),
|
||||
addTypeRef(generic->getParent()));
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user