typePatternExprInScope

With respect to solving, the AST "parent" of a block statement is not necessarily the same as the scope parent. Example:


 public String x() {
     if(x) {
         // Parent node: the block attached to the method declaration
         // Scope-parent: the block attached to the method declaration
     } else if {
         // Parent node: the if
         // Scope-parent: the block attached to the method declaration
     } else {
         // Parent node: the elseif
         // Scope-parent: the block attached to the method declaration
     }
 }