Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d2deaa9

Browse files
committed
[AST] Require a SourceRange for ErrorTypeRepr
1 parent e1bd903 commit d2deaa9

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

include/swift/AST/TypeRepr.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,6 @@ class ErrorTypeRepr : public TypeRepr {
229229
return new (Context) ErrorTypeRepr(Range);
230230
}
231231

232-
static ErrorTypeRepr *
233-
create(ASTContext &Context, SourceLoc Loc = SourceLoc()) {
234-
return create(Context, SourceRange(Loc));
235-
}
236-
237232
static bool classof(const TypeRepr *T) {
238233
return T->getKind() == TypeReprKind::Error;
239234
}

lib/Parse/ParseDecl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9935,7 +9935,8 @@ Parser::parseDeclSubscript(SourceLoc StaticLoc,
99359935

99369936
if (ElementTy.isNull()) {
99379937
// Always set an element type.
9938-
ElementTy = makeParserResult(ElementTy, ErrorTypeRepr::create(Context));
9938+
ElementTy = makeParserResult(
9939+
ElementTy, ErrorTypeRepr::create(Context, getTypeErrorLoc()));
99399940
}
99409941
}
99419942

0 commit comments

Comments
 (0)