Skip to content

Commit e285916

Browse files
committed
Simplify implementation of resolveInterfaceType a little
1 parent 6c00d89 commit e285916

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/Sema/CSDiagnostics.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,9 @@ Type FailureDiagnostic::resolveInterfaceType(Type type,
115115
auto &cs = getConstraintSystem();
116116
auto resolvedType = type.transform([&](Type type) -> Type {
117117
if (auto *tvt = type->getAs<TypeVariableType>()) {
118-
auto *loc = tvt->getImpl().getLocator();
119-
120118
// If this type variable is for a generic parameter, return that.
121-
if (loc->isForGenericParameter())
122-
return loc->getGenericParameter();
119+
if (auto *gp = tvt->getImpl().getGenericParameter())
120+
return gp;
123121

124122
// Otherwise resolve its fixed type, mapped out of context.
125123
if (auto fixed = cs.getFixedType(tvt))

0 commit comments

Comments
 (0)