================
@@ -312,36 +314,37 @@ def from_offset(tu, file, offset):
         return conf.lib.clang_getLocationForOffset(tu, file, offset)  # type: 
ignore [no-any-return]
 
     @property
-    def file(self):
+    def file(self) -> File | None:
         """Get the file represented by this source location."""
         return self._get_instantiation()[0]
 
     @property
-    def line(self):
+    def line(self) -> int:
         """Get the line represented by this source location."""
         return self._get_instantiation()[1]
 
     @property
-    def column(self):
+    def column(self) -> int:
         """Get the column represented by this source location."""
         return self._get_instantiation()[2]
 
     @property
-    def offset(self):
+    def offset(self) -> int:
         """Get the file offset represented by this source location."""
         return self._get_instantiation()[3]
 
     @property
-    def is_in_system_header(self):
+    def is_in_system_header(self) -> bool:
         """Returns true if the given source location is in a system header."""
         return bool(conf.lib.clang_Location_isInSystemHeader(self))
 
-    def __eq__(self, other):
-        return isinstance(other, SourceLocation) and bool(
-            conf.lib.clang_equalLocations(self, other)
-        )
+    def __eq__(self, other: object) -> bool:
+        if isinstance(other, SourceLocation):
----------------
DeinAlptraum wrote:

As I was changing the implementation, there was something scratching at the 
back of my head... this was it, thanks :D Changed in 
[682201b](https://github.com/llvm/llvm-project/pull/180193/commits/682201b416612426f2637ff789287edfa377b04e)

https://github.com/llvm/llvm-project/pull/180193
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to