================
@@ -1552,68 +1563,83 @@ class Cursor(Structure):
 
     _fields_ = [("_kind_id", c_int), ("xdata", c_int), ("data", c_void_p * 3)]
 
+    _tu: TranslationUnit
+
     @staticmethod
-    def from_location(tu, location):
+    def from_location(tu: TranslationUnit, location: SourceLocation) -> Cursor:
----------------
Endilll wrote:

`clang_getCursor` can return null cursor, so I think we want to wrap the call 
in `from_cursor_result`, and change the return type to `Cursor | None`.

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