@@ -216,36 +216,24 @@ class alignas(1 << TypeReprAlignInBits) TypeRepr
216216// / A TypeRepr for a type with a syntax error. Can be used both as a
217217// / top-level TypeRepr and as a part of other TypeRepr.
218218// /
219- // / The client can either emit a detailed diagnostic at the construction time
220- // / (in the parser) or store a zero-arg diagnostic in this TypeRepr to be
221- // / emitted after parsing, during type resolution.
222- // /
223219// / All uses of this type should be ignored and not re-diagnosed.
224220class ErrorTypeRepr : public TypeRepr {
225221 SourceRange Range;
226- std::optional<ZeroArgDiagnostic> DelayedDiag;
227222
228- ErrorTypeRepr (SourceRange Range, std::optional<ZeroArgDiagnostic> Diag )
229- : TypeRepr(TypeReprKind::Error), Range(Range), DelayedDiag(Diag) {}
223+ ErrorTypeRepr (SourceRange Range)
224+ : TypeRepr(TypeReprKind::Error), Range(Range) {}
230225
231226public:
232227 static ErrorTypeRepr *
233- create (ASTContext &Context, SourceRange Range,
234- std::optional<ZeroArgDiagnostic> DelayedDiag = std::nullopt ) {
235- assert ((!DelayedDiag || Range) && " diagnostic needs a location" );
236- return new (Context) ErrorTypeRepr (Range, DelayedDiag);
228+ create (ASTContext &Context, SourceRange Range) {
229+ return new (Context) ErrorTypeRepr (Range);
237230 }
238231
239232 static ErrorTypeRepr *
240- create (ASTContext &Context, SourceLoc Loc = SourceLoc(),
241- std::optional<ZeroArgDiagnostic> DelayedDiag = std::nullopt ) {
242- return create (Context, SourceRange (Loc), DelayedDiag);
233+ create (ASTContext &Context, SourceLoc Loc = SourceLoc()) {
234+ return create (Context, SourceRange (Loc));
243235 }
244236
245- // / If there is a delayed diagnostic stored in this TypeRepr, consumes and
246- // / emits that diagnostic.
247- void dischargeDiagnostic (ASTContext &Context);
248-
249237 static bool classof (const TypeRepr *T) {
250238 return T->getKind () == TypeReprKind::Error;
251239 }
0 commit comments