File tree Expand file tree Collapse file tree 5 files changed +466
-2
lines changed
Expand file tree Collapse file tree 5 files changed +466
-2
lines changed Original file line number Diff line number Diff line change @@ -69,4 +69,9 @@ public int getSymbol() {
6969 public void setSymbol (int symbol ) {
7070 this .symbol = symbol ;
7171 }
72+
73+ @ Override
74+ public boolean isValidExpression () {
75+ return object instanceof ITypeExpression || object instanceof DynamicImport ;
76+ }
7277}
Original file line number Diff line number Diff line change 1010 * however, some expressions such as {@link Literal} type may occur in a type annotation because the
1111 * TypeScript AST does not distinguish <code>null</code> literals from the <code>null</code> type.
1212 */
13- public interface ITypeExpression extends INode , ITypedAstNode {}
13+ public interface ITypeExpression extends INode , ITypedAstNode {
14+ public default boolean isValidExpression () { return true ; }
15+ }
Original file line number Diff line number Diff line change @@ -1907,7 +1907,7 @@ private Node convertOptionalType(JsonObject node, SourceLocation loc) throws Par
19071907 }
19081908
19091909 private ITypeExpression asType (Node node ) {
1910- return node instanceof ITypeExpression ? (ITypeExpression ) node : null ;
1910+ return node instanceof ITypeExpression && (( ITypeExpression ) node ). isValidExpression () ? (ITypeExpression ) node : null ;
19111911 }
19121912
19131913 private List <ITypeExpression > convertChildrenAsTypes (JsonObject node , String child )
Original file line number Diff line number Diff line change 1+ interface Invalid extends ( foo . bar ) { }
2+ interface Invalid extends ( foo ) . bar { }
3+ interface Invalid extends foo [ bar ] { }
4+ interface Invalid extends foo ?. bar { }
5+ interface Invalid extends foo ! . bar { }
6+ interface Invalid extends foo ( ) { }
You can’t perform that action at this time.
0 commit comments