@@ -117,6 +117,18 @@ Type InheritedTypeRequest::operator()(
117
117
return inheritedType ? inheritedType : ErrorType::get (tc.Context );
118
118
}
119
119
120
+ void InheritedTypeRequest::diagnoseCycle (DiagnosticEngine &diags) const {
121
+ const auto &storage = getStorage ();
122
+ auto &typeLoc = getTypeLoc (std::get<0 >(storage), std::get<1 >(storage));
123
+ diags.diagnose (typeLoc.getLoc (), diag::circular_reference);
124
+ }
125
+
126
+ void InheritedTypeRequest::noteCycleStep (DiagnosticEngine &diags) const {
127
+ const auto &storage = getStorage ();
128
+ auto &typeLoc = getTypeLoc (std::get<0 >(storage), std::get<1 >(storage));
129
+ diags.diagnose (typeLoc.getLoc (), diag::circular_reference_through);
130
+ }
131
+
120
132
Optional<Type> InheritedTypeRequest::getCachedResult () const {
121
133
const auto &storage = getStorage ();
122
134
auto &typeLoc = getTypeLoc (std::get<0 >(storage), std::get<1 >(storage));
@@ -218,15 +230,15 @@ Type EnumRawTypeRequest::operator()(Evaluator &evaluator,
218
230
219
231
void EnumRawTypeRequest::diagnoseCycle (DiagnosticEngine &diags) const {
220
232
// FIXME: Improve this diagnostic.
221
- auto classDecl = std::get<0 >(getStorage ());
222
- std::string className = " '" + std::string (classDecl ->getNameStr ()) + " '" ;
223
- diags.diagnose (classDecl , diag::circular_class_inheritance , className);
233
+ auto enumDecl = std::get<0 >(getStorage ());
234
+ std::string className = " '" + std::string (enumDecl ->getNameStr ()) + " '" ;
235
+ diags.diagnose (enumDecl , diag::circular_enum_inheritance , className);
224
236
}
225
237
226
238
void EnumRawTypeRequest::noteCycleStep (DiagnosticEngine &diags) const {
227
- auto classDecl = std::get<0 >(getStorage ());
239
+ auto enumDecl = std::get<0 >(getStorage ());
228
240
// FIXME: Customize this further.
229
- diags.diagnose (classDecl , diag::circular_reference_through);
241
+ diags.diagnose (enumDecl , diag::circular_reference_through);
230
242
}
231
243
232
244
Optional<Type> EnumRawTypeRequest::getCachedResult () const {
0 commit comments