================
@@ -3809,6 +3843,8 @@ def get_tokens(self, locations=None, extent=None):
raise TypeError("get_tokens() requires at least one argument")
if locations is not None:
extent = SourceRange(start=locations[0], end=locations[1])
+ if extent is None:
+ raise TypeError("get_tokens() requires at least one argument")
----------------
DeinAlptraum wrote:
The previoius check ensured that either `locations` or `extent` is set, but in
a way that the type checker doesn't understand. I changed this to ensure the
type checker gets that the `extent` passed to `TokenGroup.get_tokens` in the
end is not `None`.
https://github.com/llvm/llvm-project/pull/180876
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits