private boolean isTypeAnnotationAllowedForName ( Node n ) { checkState ( n . isName ( ) , n ) ; // Only allow type annotations on nodes used as an lvalue. if ( ! NodeUtil . isLValue ( n ) ) { return false ; } // Don't allow JSDoc on a name in an assignment. Simple names should only have JSDoc on them // when originally declared. Node rootTarget = NodeUtil . getRootTarget ( n ) ; return ! NodeUtil . isLhsOfAssign ( rootTarget ) ; }
Is it valid to have a type annotation on the given NAME node?