@@ -216,36 +216,24 @@ class alignas(1 << TypeReprAlignInBits) TypeRepr
216
216
// / A TypeRepr for a type with a syntax error. Can be used both as a
217
217
// / top-level TypeRepr and as a part of other TypeRepr.
218
218
// /
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
- // /
223
219
// / All uses of this type should be ignored and not re-diagnosed.
224
220
class ErrorTypeRepr : public TypeRepr {
225
221
SourceRange Range;
226
- std::optional<ZeroArgDiagnostic> DelayedDiag;
227
222
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) {}
230
225
231
226
public:
232
227
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);
237
230
}
238
231
239
232
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));
243
235
}
244
236
245
- // / If there is a delayed diagnostic stored in this TypeRepr, consumes and
246
- // / emits that diagnostic.
247
- void dischargeDiagnostic (ASTContext &Context);
248
-
249
237
static bool classof (const TypeRepr *T) {
250
238
return T->getKind () == TypeReprKind::Error;
251
239
}
0 commit comments