mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AST: Remove TypeDecl::getDeclaredType()
A pointless use of polymorphism -- the result values are not interchangeable in any practical sense: - For GenericTypeParamDecls, this returned getDeclaredInterfaceType(), which is an interface type. - For AssociatedTypeDecls, this returned the sugared AssociatedTypeType, which desugars to an archetype. - For TypeAliasDecls, this returned TypeAliasDecl::getAliasType(), which desugars to a type containing archetypes. - For NominalTypeDecls, this returned NominalTypeDecl::getDeclaredType(), which is the unbound generic type, a special case used for inferring generic arguments when they're not written in source.
This commit is contained in:
@@ -1084,8 +1084,11 @@ ConstraintSystem::getTypeOfMemberReference(
|
||||
}
|
||||
|
||||
// FIXME: Totally bogus fallthrough.
|
||||
Type memberTy = isTypeReference? assocType->getDeclaredType()
|
||||
: assocType->getType();
|
||||
Type memberTy = isTypeReference
|
||||
? assocType->getDeclaredInterfaceType()
|
||||
: assocType->getInterfaceType();
|
||||
memberTy = ArchetypeBuilder::mapTypeIntoContext(
|
||||
assocType->getProtocol(), memberTy);
|
||||
auto openedType = FunctionType::get(baseObjTy, memberTy);
|
||||
return { openedType, memberTy };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user