mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SIL: Use only interface types in the verifier.
Treat the interface types of SILFunctionTypes as the canonical representation in the verifier. Do a bunch of supporting and annoyingly irreducible work to enable this: - Stop trying to uncurry generic parameter lists during type lowering and preserve the structure of AST GenericParamLists. This makes mapping dependent types into contexts easier. - Properly walk generic parameter lists at all depths when grooming substitution vectors for use with substGenericArgs interfaces. - Reseat the generic parameter lists created for protocol_method results so that we don't expect the outer Self archetype to be unbound; it's provided by the extra data of the result. - Hack SILFunctionType serialization never to use a decl reference when serializing its generic param list. When this happens, we get incorrect archetypes. This is a gross hack, but when we're able to jump all the way to interface types, it can go away. Putting these ducks in a row nicely un-XFAILs TextFormatting.swift. Swift SVN r11989
This commit is contained in:
@@ -1487,6 +1487,10 @@ SILFunctionType::SILFunctionType(GenericParamList *genericParams, ExtInfo ext,
|
||||
auto getArchetypesAsDependentTypes = [&](Type t) -> Type {
|
||||
if (!t) return t;
|
||||
if (auto arch = t->getAs<ArchetypeType>()) {
|
||||
// As a kludge, we allow Self archetypes of protocol_methods to be
|
||||
// unapplied.
|
||||
if (arch->getSelfProtocol() && !archetypeMap.count(arch))
|
||||
return arch;
|
||||
return arch->getAsDependentType(archetypeMap);
|
||||
}
|
||||
return t;
|
||||
|
||||
Reference in New Issue
Block a user