@@ -221,22 +221,22 @@ isTransparent(Info const& info)
221221}
222222}
223223
224- Info const *
224+ Expected< Info const *>
225225CorpusImpl::
226- lookup (SymbolID const & context, std::string_view name) const
226+ lookup (SymbolID const & context, std::string_view const name) const
227227{
228228 return lookupImpl (*this , context, name);
229229}
230230
231- Info const *
231+ Expected< Info const *>
232232CorpusImpl::
233233lookup (SymbolID const & context, std::string_view name)
234234{
235235 return lookupImpl (*this , context, name);
236236}
237237
238238template <class Self >
239- Info const *
239+ Expected< Info const *>
240240CorpusImpl::
241241lookupImpl (Self&& self, SymbolID const & context, std::string_view name)
242242{
@@ -246,16 +246,33 @@ lookupImpl(Self&& self, SymbolID const& context, std::string_view name)
246246 }
247247 if (auto [info, found] = self.lookupCacheGet (context, name); found)
248248 {
249+ if (!info)
250+ {
251+ return Unexpected (formatError (
252+ " Failed to find '{}' from context '{}'" ,
253+ name,
254+ self.Corpus ::qualifiedName (*self.find (context))));
255+ }
249256 return info;
250257 }
251258 Expected<ParsedRef> const s = parseRef (name);
252259 if (!s)
253260 {
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 ()));
257262 }
258263 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+ }
259276 return res;
260277}
261278
@@ -600,7 +617,6 @@ CorpusImpl::finalize()
600617 report::debug (" Finalizing javadoc" );
601618 JavadocFinalizer finalizer (*this );
602619 finalizer.build ();
603- finalizer.emitWarnings ();
604620}
605621
606622
0 commit comments