Skip to content

Commit 6335a4f

Browse files
committed
[Diagnostics] Resolve const-ness problems introduced by TypedNode
Since `TypedNode` elements are all marked as `const` diagnostics need to get some of the APIs adjusted to support passing `const Expr *`.
1 parent 08e09fc commit 6335a4f

File tree

3 files changed

+97
-89
lines changed

3 files changed

+97
-89
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;

0 commit comments

Comments
 (0)