From a7068f13eccd841aa111c34ffcdc1c902efdea76 Mon Sep 17 00:00:00 2001 From: zhscn Date: Sun, 9 Nov 2025 11:51:45 +0800 Subject: [PATCH] indexer: Resolve the type alias correctly (#988) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The struct derived from an alias is missing from type hierarchy before this fix: ```cpp struct Base {}; struct Derived : Base {}; using BaseAlias = Base; struct DerivedAlias : BaseAlias {}; ``` ``` Derive from Base └╸Derived ``` The expected output is: ``` Derive from Base ├╸Derived └╸DerivedAlias ``` --- src/indexer.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/indexer.cc b/src/indexer.cc index df82ecc2..6d32077e 100644 --- a/src/indexer.cc +++ b/src/indexer.cc @@ -325,6 +325,9 @@ try_again: switch (tp->getTypeClass()) { case Type::Typedef: d = cast(tp)->getDecl(); + tp = cast(tp)->getDecl()->getUnderlyingType().getTypePtrOrNull(); + if (tp) + goto try_again; break; case Type::ObjCObject: d = cast(tp)->getInterface();