Skip to content

Pyright fixes - #181

Merged
pjljvandelaar merged 5 commits into
mainfrom
pyright-fixes
Sep 15, 2026
Merged

pjljvandelaar merged 5 commits into
mainfrom
pyright-fixes

Conversation

@FrancescoPezzella

Copy link
Copy Markdown
Collaborator

No description provided.

@FrancescoPezzella FrancescoPezzella self-assigned this Sep 14, 2026
@FrancescoPezzella FrancescoPezzella added the bug Something isn't working label Sep 14, 2026
Comment thread src/renaissance/syntax_tree/ast_node.py Outdated
Comment thread src/renaissance/syntax_tree/match_finder.py Outdated
Comment thread src/renaissance/integrations/clang/clang_ast_node.py Outdated
Comment thread src/renaissance/integrations/clang/clang_json_ast_node.py Outdated
Comment thread src/renaissance/syntax_tree/ast_node.py Outdated
Comment thread src/renaissance/syntax_tree/ast_node.py Outdated
Comment thread src/renaissance/syntax_tree/ast_node.py Outdated

@pjljvandelaar pjljvandelaar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please reply to my comments.
Based on your answers, changes might be needed.

@FrancescoPezzella

Copy link
Copy Markdown
Collaborator Author

I made the changes based on your comments. I didn't see it immediately, but Any denotation could have been improved. Also, I added a TODO comment to something I noticed ( https://lawsofsoftwareengineering.com/laws/boy-scout-rule/ - based on the concept, but i didn't touch it :-) )

Please reply to my comments. Based on your answers, changes might be needed.

return re.match("(?i).*(Stmt|Decl)", self.kind)
return self.semantic_kind in {SemanticKind.STATEMENT, SemanticKind.DECLARATION, SemanticKind.DEFINITION}

# TODO: can @property work here given matches_kind takes a required node argument?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed the @Property decorator is wrong.

obj.matches_kind         # TypeError: matches_kind() missing 1 required
                         #            positional argument: 'node'
obj.matches_kind(node)   # same error -- the attribute access runs *first*,
                         #               and it blows up before the call

How can this code even work?
The only possibility I see is that it isn't called at all.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mmm probably requires opening a separate issue regarding this kind of problem

@pjljvandelaar
pjljvandelaar merged commit 16ad04c into main Sep 15, 2026
8 checks passed
@pjljvandelaar
pjljvandelaar deleted the pyright-fixes branch September 15, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants