Skip to content

Commit 0a037e7

Browse files
authored
Merge pull request swiftlang#31104 from xedin/compute-diag-anchors-on-demand
[Diagnostics] Refactor `FailureDiagnostic` to operate on `TypedNode`
2 parents 682b375 + 967b3a3 commit 0a037e7

File tree

5 files changed

+447
-379
lines changed

5 files changed

+447
-379
lines changed

include/swift/AST/Expr.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3759,7 +3759,12 @@ class ClosureExpr : public AbstractClosureExpr {
37593759
assert(hasExplicitResultType() && "No explicit result type");
37603760
return ExplicitResultType;
37613761
}
3762-
3762+
3763+
TypeRepr *getExplicitResultTypeRepr() const {
3764+
assert(hasExplicitResultType() && "No explicit result type");
3765+
return ExplicitResultType.getTypeRepr();
3766+
}
3767+
37633768
void setExplicitResultType(SourceLoc arrowLoc, TypeLoc resultType) {
37643769
ArrowLoc = arrowLoc;
37653770
ExplicitResultType = resultType;

lib/Sema/CSApply.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,17 @@ ConstraintLocator *Solution::getCalleeLocator(ConstraintLocator *locator,
166166
}
167167

168168
ConstraintLocator *
169-
Solution::getConstraintLocator(Expr *anchor,
169+
Solution::getConstraintLocator(const Expr *anchor,
170170
ArrayRef<LocatorPathElt> path) const {
171171
auto &cs = getConstraintSystem();
172-
return cs.getConstraintLocator(anchor, path);
172+
return cs.getConstraintLocator(const_cast<Expr *>(anchor), path);
173+
}
174+
175+
ConstraintLocator *
176+
Solution::getConstraintLocator(ConstraintLocator *base,
177+
ArrayRef<LocatorPathElt> path) const {
178+
auto &cs = getConstraintSystem();
179+
return cs.getConstraintLocator(base, path);
173180
}
174181

175182
/// Return the implicit access kind for a MemberRefExpr with the

0 commit comments

Comments
 (0)