mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #15497 from DougGregor/remove-name-alias-type
[AST] Fully replace NameAliasType with the new, sugary-sweet BoundNameAliasType
This commit is contained in:
@@ -2731,10 +2731,22 @@ public:
|
||||
Builder.addTextChunk(TAD->getName().str());
|
||||
if (TAD->hasInterfaceType()) {
|
||||
auto underlyingType = TAD->getUnderlyingTypeLoc().getType();
|
||||
if (underlyingType->hasError())
|
||||
addTypeAnnotation(Builder, TAD->getDeclaredInterfaceType());
|
||||
else
|
||||
if (underlyingType->hasError()) {
|
||||
Type parentType;
|
||||
if (auto nominal =
|
||||
TAD->getDeclContext()
|
||||
->getAsNominalTypeOrNominalTypeExtensionContext()) {
|
||||
parentType = nominal->getDeclaredInterfaceType();
|
||||
}
|
||||
addTypeAnnotation(
|
||||
Builder,
|
||||
NameAliasType::get(const_cast<TypeAliasDecl *>(TAD),
|
||||
parentType, SubstitutionMap(),
|
||||
underlyingType));
|
||||
|
||||
} else {
|
||||
addTypeAnnotation(Builder, underlyingType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2927,9 +2939,9 @@ public:
|
||||
Optional<Type> Result = None;
|
||||
if (auto AT = MT->getInstanceType()) {
|
||||
if (!CD->getInterfaceType()->is<ErrorType>() &&
|
||||
isa<NameAliasType>(AT.getPointer()) &&
|
||||
AT->getDesugaredType() ==
|
||||
CD->getResultInterfaceType().getPointer())
|
||||
(isa<NameAliasType>(AT.getPointer()) &&
|
||||
AT->getDesugaredType() ==
|
||||
CD->getResultInterfaceType().getPointer()))
|
||||
Result = AT;
|
||||
}
|
||||
addConstructorCall(CD, Reason, None, Result);
|
||||
|
||||
Reference in New Issue
Block a user