From 45198dc0eeaa6d7d2da2ebd083101a20d5ce808f Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Wed, 18 Jun 2025 16:28:16 -0700 Subject: [PATCH] [reflection] Fine-tune error messages --- stdlib/public/RemoteInspection/TypeLowering.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/stdlib/public/RemoteInspection/TypeLowering.cpp b/stdlib/public/RemoteInspection/TypeLowering.cpp index 7f8e06e43e896..fdc3273aaccae 100644 --- a/stdlib/public/RemoteInspection/TypeLowering.cpp +++ b/stdlib/public/RemoteInspection/TypeLowering.cpp @@ -1559,7 +1559,7 @@ std::string TypeConverter::takeLastError() { if (!LastError.first) return {}; std::stringstream s; - s << ": " << LastError.first; + s << LastError.first << ": "; if (LastError.second) LastError.second->dump(s); @@ -2680,8 +2680,11 @@ TypeConverter::getTypeInfo(const TypeRef *TR, // Compute the result and cache it auto *TI = LowerType(*this, ExternalTypeInfo).visit(TR); Cache.insert({{TR, ExternalTypeInfoId}, TI}); - if (!TI && ErrorCache) + if (!TI && ErrorCache) { + if (!LastError.first) + LastError = {"cannot decode or find", TR}; ErrorCache->insert({{TR, ExternalTypeInfoId}, LastError}); + } RecursionCheck.erase(TR);