@@ -221,22 +221,22 @@ isTransparent(Info const& info)
221
221
}
222
222
}
223
223
224
- Info const *
224
+ Expected< Info const *>
225
225
CorpusImpl::
226
- lookup (SymbolID const & context, std::string_view name) const
226
+ lookup (SymbolID const & context, std::string_view const name) const
227
227
{
228
228
return lookupImpl (*this , context, name);
229
229
}
230
230
231
- Info const *
231
+ Expected< Info const *>
232
232
CorpusImpl::
233
233
lookup (SymbolID const & context, std::string_view name)
234
234
{
235
235
return lookupImpl (*this , context, name);
236
236
}
237
237
238
238
template <class Self >
239
- Info const *
239
+ Expected< Info const *>
240
240
CorpusImpl::
241
241
lookupImpl (Self&& self, SymbolID const & context, std::string_view name)
242
242
{
@@ -246,16 +246,33 @@ lookupImpl(Self&& self, SymbolID const& context, std::string_view name)
246
246
}
247
247
if (auto [info, found] = self.lookupCacheGet (context, name); found)
248
248
{
249
+ if (!info)
250
+ {
251
+ return Unexpected (formatError (
252
+ " Failed to find '{}' from context '{}'" ,
253
+ name,
254
+ self.Corpus ::qualifiedName (*self.find (context))));
255
+ }
249
256
return info;
250
257
}
251
258
Expected<ParsedRef> const s = parseRef (name);
252
259
if (!s)
253
260
{
254
- report::warn (" Failed to parse '{}'\n {}" , name, s.error ().reason ());
255
- self.lookupCacheSet (context, name, nullptr );
256
- return nullptr ;
261
+ return Unexpected (formatError (" Failed to parse '{}'\n {}" , name, s.error ().reason ()));
257
262
}
258
263
Info const * res = lookupImpl (self, context, *s, name, false );
264
+ if (!res)
265
+ {
266
+ auto const contextPtr = self.find (context);
267
+ if (!contextPtr)
268
+ {
269
+ return Unexpected (formatError (" Failed to find '{}'" , context));
270
+ }
271
+ return Unexpected (formatError (
272
+ " Failed to find '{}' from context '{}'" ,
273
+ name,
274
+ self.Corpus ::qualifiedName (*contextPtr)));
275
+ }
259
276
return res;
260
277
}
261
278
@@ -600,7 +617,6 @@ CorpusImpl::finalize()
600
617
report::debug (" Finalizing javadoc" );
601
618
JavadocFinalizer finalizer (*this );
602
619
finalizer.build ();
603
- finalizer.emitWarnings ();
604
620
}
605
621
606
622
0 commit comments