================
@@ -1913,7 +1916,7 @@ def type(self):
         return self._type
 
     @property
-    def canonical(self):
+    def canonical(self) -> Cursor | None:
         """Return the canonical Cursor corresponding to this Cursor.
----------------
DeinAlptraum wrote:

That's a good idea, I added `from_non_null_cursor_result` and used it for 
`clang_getTypeDeclaration` and `clang_getCanonicalCursor` which seem to be the 
only places where we can guarantee that we won't get a null-Cursor. All the 
others explicitly return a null-Cursor under certain conditions.

https://github.com/llvm/llvm-project/pull/138103
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to