[ModuleInterface] Allow conformances to be missing value witnesses (#18932)

It's not clear whether we'll actually need this feature in the long
run, but we certainly need it now because non-@usableFromInline
members can (currently) satisfy public requirements when a
@usableFromInline internal type conforms to a public protocol. In
these cases, we'll treat the witnesses as present but opaque, and
clients will perform dynamic dispatch when using them even when
a generic function gets specialized.

With this, we're able to generate a textual interface for the standard
library, compile it back to a swiftmodule, and use it to build a Hello
World program!
This commit is contained in:
Jordan Rose
2018-08-23 16:46:06 -07:00
committed by GitHub
parent 04b5eb501d
commit eeb8f330f9
4 changed files with 146 additions and 73 deletions

View File

@@ -2697,6 +2697,7 @@ ModuleFile::getDeclCheckedImpl(DeclID DID) {
return nullptr;
}
theStruct->setAddedImplicitInitializers();
if (isImplicit)
theStruct->setImplicit();
theStruct->setIsObjC(isObjC);
@@ -3604,6 +3605,7 @@ ModuleFile::getDeclCheckedImpl(DeclID DID) {
return nullptr;
}
theEnum->setAddedImplicitInitializers();
if (isImplicit)
theEnum->setImplicit();
theEnum->setIsObjC(isObjC);