Pyright fixes - #181
Pyright fixes#181
Conversation
pjljvandelaar
left a comment
There was a problem hiding this comment.
Please reply to my comments.
Based on your answers, changes might be needed.
|
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 :-) )
|
| 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? |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
mmm probably requires opening a separate issue regarding this kind of problem
No description provided.