Skip to content

Commit 630d7e3

Browse files
committed
Merge remote-tracking branch 'origin/master' into master-rebranch
2 parents 5d015dc + 90c4891 commit 630d7e3

File tree

3 files changed

+2
-21
lines changed

3 files changed

+2
-21
lines changed

include/swift/AST/Decl.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3319,7 +3319,6 @@ class NominalTypeDecl : public GenericTypeDecl, public IterableDeclContext {
33193319

33203320
protected:
33213321
Type DeclaredTy;
3322-
Type DeclaredTyInContext;
33233322
Type DeclaredInterfaceTy;
33243323

33253324
NominalTypeDecl(DeclKind K, DeclContext *DC, Identifier name,
@@ -3378,10 +3377,6 @@ class NominalTypeDecl : public GenericTypeDecl, public IterableDeclContext {
33783377
/// any generic parameters bound if this is a generic type.
33793378
Type getDeclaredType() const;
33803379

3381-
/// getDeclaredTypeInContext - Retrieve the type declared by this entity, with
3382-
/// context archetypes bound if this is a generic type.
3383-
Type getDeclaredTypeInContext() const;
3384-
33853380
/// getDeclaredInterfaceType - Retrieve the type declared by this entity, with
33863381
/// generic parameters bound if this is a generic type.
33873382
Type getDeclaredInterfaceType() const;

lib/AST/Decl.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3446,18 +3446,6 @@ Type NominalTypeDecl::getDeclaredType() const {
34463446
return DeclaredTy;
34473447
}
34483448

3449-
Type NominalTypeDecl::getDeclaredTypeInContext() const {
3450-
if (DeclaredTyInContext)
3451-
return DeclaredTyInContext;
3452-
3453-
auto *decl = const_cast<NominalTypeDecl *>(this);
3454-
3455-
auto interfaceType = getDeclaredInterfaceType();
3456-
decl->DeclaredTyInContext = mapTypeIntoContext(interfaceType);
3457-
3458-
return DeclaredTyInContext;
3459-
}
3460-
34613449
Type NominalTypeDecl::getDeclaredInterfaceType() const {
34623450
if (DeclaredInterfaceTy)
34633451
return DeclaredInterfaceTy;

lib/AST/DeclContext.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,8 @@ GenericTypeParamType *DeclContext::getProtocolSelfType() const {
106106
}
107107

108108
Type DeclContext::getDeclaredTypeInContext() const {
109-
if (auto *ED = dyn_cast<ExtensionDecl>(this))
110-
return ED->mapTypeIntoContext(getDeclaredInterfaceType());
111-
if (auto *NTD = dyn_cast<NominalTypeDecl>(this))
112-
return NTD->getDeclaredTypeInContext();
109+
if (auto declaredType = getDeclaredInterfaceType())
110+
return mapTypeIntoContext(declaredType);
113111
return Type();
114112
}
115113

0 commit comments

Comments
 (0)