Trying to understand ifstmt.getThen() = block #7731
Replies: 5 comments 5 replies
-
| You can. I imagine the doc example was just trying to show how multiple variables can be declared in the   | 
Beta Was this translation helpful? Give feedback.
-
| @smowton IfStmt.getThen() returns a Stmt variable, and it's a different type of variable to Block, how could they be equal? | 
Beta Was this translation helpful? Give feedback.
-
| Looks like both BlockStmt and IfStmt inherits Stmt class, therefore I can associate the two variables. Am I understanding it correctly? | 
Beta Was this translation helpful? Give feedback.
-
| @smowton I actually tried to look up  So where is it defined? | 
Beta Was this translation helpful? Give feedback.
-
| Running more tests, and I have another weird behavior with this query: Problems 
 | 
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm reading this doc https://codeql.github.com/docs/codeql-language-guides/basic-query-for-java-code/
And the query is:
Why can't I use this instead? The block variable looks redundant to me.
Beta Was this translation helpful? Give feedback.
All reactions