diff --git a/javascript/extractor/src/com/semmle/js/ast/MemberExpression.java b/javascript/extractor/src/com/semmle/js/ast/MemberExpression.java index 5d90a70f04fc..b540decd48e7 100644 --- a/javascript/extractor/src/com/semmle/js/ast/MemberExpression.java +++ b/javascript/extractor/src/com/semmle/js/ast/MemberExpression.java @@ -69,4 +69,9 @@ public int getSymbol() { public void setSymbol(int symbol) { this.symbol = symbol; } + + @Override + public boolean isValidTypeExpression() { + return object instanceof ITypeExpression && ((ITypeExpression)object).isValidTypeExpression() || object instanceof DynamicImport; + } } diff --git a/javascript/extractor/src/com/semmle/ts/ast/ITypeExpression.java b/javascript/extractor/src/com/semmle/ts/ast/ITypeExpression.java index 71185a7f92c5..4372eba125f8 100644 --- a/javascript/extractor/src/com/semmle/ts/ast/ITypeExpression.java +++ b/javascript/extractor/src/com/semmle/ts/ast/ITypeExpression.java @@ -10,4 +10,6 @@ * however, some expressions such as {@link Literal} type may occur in a type annotation because the * TypeScript AST does not distinguish null literals from the null type. */ -public interface ITypeExpression extends INode, ITypedAstNode {} +public interface ITypeExpression extends INode, ITypedAstNode { + public default boolean isValidTypeExpression() { return true; } +} diff --git a/javascript/extractor/src/com/semmle/ts/extractor/TypeScriptASTConverter.java b/javascript/extractor/src/com/semmle/ts/extractor/TypeScriptASTConverter.java index dfc15e4e4aa1..a3e031845a2a 100644 --- a/javascript/extractor/src/com/semmle/ts/extractor/TypeScriptASTConverter.java +++ b/javascript/extractor/src/com/semmle/ts/extractor/TypeScriptASTConverter.java @@ -1907,7 +1907,7 @@ private Node convertOptionalType(JsonObject node, SourceLocation loc) throws Par } private ITypeExpression asType(Node node) { - return node instanceof ITypeExpression ? (ITypeExpression) node : null; + return node instanceof ITypeExpression && ((ITypeExpression)node).isValidTypeExpression() ? (ITypeExpression) node : null; } private List convertChildrenAsTypes(JsonObject node, String child) diff --git a/javascript/extractor/tests/ts/input/invalidExtends.ts b/javascript/extractor/tests/ts/input/invalidExtends.ts new file mode 100644 index 000000000000..d31eba1dae64 --- /dev/null +++ b/javascript/extractor/tests/ts/input/invalidExtends.ts @@ -0,0 +1,6 @@ +interface Invalid extends (foo.bar) {} +interface Invalid extends (foo).bar {} +interface Invalid extends foo[bar] {} +interface Invalid extends foo?.bar {} +interface Invalid extends foo!.bar {} +interface Invalid extends foo() {} diff --git a/javascript/extractor/tests/ts/output/trap/invalidExtends.ts.trap b/javascript/extractor/tests/ts/output/trap/invalidExtends.ts.trap new file mode 100644 index 000000000000..ec1ddb444ef6 --- /dev/null +++ b/javascript/extractor/tests/ts/output/trap/invalidExtends.ts.trap @@ -0,0 +1,451 @@ +#10000=@"/invalidExtends.ts;sourcefile" +files(#10000,"/invalidExtends.ts") +#10001=@"/;folder" +folders(#10001,"/") +containerparent(#10001,#10000) +#10002=@"loc,{#10000},0,0,0,0" +locations_default(#10002,#10000,0,0,0,0) +hasLocation(#10000,#10002) +#20000=@"global_scope" +scopes(#20000,0) +#20001=@"script;{#10000},1,1" +#20002=* +lines(#20002,#20001,"interface Invalid extends (foo.bar) {}"," +") +#20003=@"loc,{#10000},1,1,1,38" +locations_default(#20003,#10000,1,1,1,38) +hasLocation(#20002,#20003) +#20004=* +lines(#20004,#20001,"interface Invalid extends (foo).bar {}"," +") +#20005=@"loc,{#10000},2,1,2,38" +locations_default(#20005,#10000,2,1,2,38) +hasLocation(#20004,#20005) +#20006=* +lines(#20006,#20001,"interface Invalid extends foo[bar] {}"," +") +#20007=@"loc,{#10000},3,1,3,37" +locations_default(#20007,#10000,3,1,3,37) +hasLocation(#20006,#20007) +#20008=* +lines(#20008,#20001,"interface Invalid extends foo?.bar {}"," +") +#20009=@"loc,{#10000},4,1,4,37" +locations_default(#20009,#10000,4,1,4,37) +hasLocation(#20008,#20009) +#20010=* +lines(#20010,#20001,"interface Invalid extends foo!.bar {}"," +") +#20011=@"loc,{#10000},5,1,5,37" +locations_default(#20011,#10000,5,1,5,37) +hasLocation(#20010,#20011) +#20012=* +lines(#20012,#20001,"interface Invalid extends foo() {}"," +") +#20013=@"loc,{#10000},6,1,6,34" +locations_default(#20013,#10000,6,1,6,34) +hasLocation(#20012,#20013) +numlines(#20001,6,6,0) +#20014=* +tokeninfo(#20014,7,#20001,0,"interface") +#20015=@"loc,{#10000},1,1,1,9" +locations_default(#20015,#10000,1,1,1,9) +hasLocation(#20014,#20015) +#20016=* +tokeninfo(#20016,6,#20001,1,"Invalid") +#20017=@"loc,{#10000},1,11,1,17" +locations_default(#20017,#10000,1,11,1,17) +hasLocation(#20016,#20017) +#20018=* +tokeninfo(#20018,7,#20001,2,"extends") +#20019=@"loc,{#10000},1,19,1,25" +locations_default(#20019,#10000,1,19,1,25) +hasLocation(#20018,#20019) +#20020=* +tokeninfo(#20020,8,#20001,3,"(") +#20021=@"loc,{#10000},1,27,1,27" +locations_default(#20021,#10000,1,27,1,27) +hasLocation(#20020,#20021) +#20022=* +tokeninfo(#20022,6,#20001,4,"foo") +#20023=@"loc,{#10000},1,28,1,30" +locations_default(#20023,#10000,1,28,1,30) +hasLocation(#20022,#20023) +#20024=* +tokeninfo(#20024,8,#20001,5,".") +#20025=@"loc,{#10000},1,31,1,31" +locations_default(#20025,#10000,1,31,1,31) +hasLocation(#20024,#20025) +#20026=* +tokeninfo(#20026,6,#20001,6,"bar") +#20027=@"loc,{#10000},1,32,1,34" +locations_default(#20027,#10000,1,32,1,34) +hasLocation(#20026,#20027) +#20028=* +tokeninfo(#20028,8,#20001,7,")") +#20029=@"loc,{#10000},1,35,1,35" +locations_default(#20029,#10000,1,35,1,35) +hasLocation(#20028,#20029) +#20030=* +tokeninfo(#20030,8,#20001,8,"{") +#20031=@"loc,{#10000},1,37,1,37" +locations_default(#20031,#10000,1,37,1,37) +hasLocation(#20030,#20031) +#20032=* +tokeninfo(#20032,8,#20001,9,"}") +#20033=@"loc,{#10000},1,38,1,38" +locations_default(#20033,#10000,1,38,1,38) +hasLocation(#20032,#20033) +#20034=* +tokeninfo(#20034,7,#20001,10,"interface") +#20035=@"loc,{#10000},2,1,2,9" +locations_default(#20035,#10000,2,1,2,9) +hasLocation(#20034,#20035) +#20036=* +tokeninfo(#20036,6,#20001,11,"Invalid") +#20037=@"loc,{#10000},2,11,2,17" +locations_default(#20037,#10000,2,11,2,17) +hasLocation(#20036,#20037) +#20038=* +tokeninfo(#20038,7,#20001,12,"extends") +#20039=@"loc,{#10000},2,19,2,25" +locations_default(#20039,#10000,2,19,2,25) +hasLocation(#20038,#20039) +#20040=* +tokeninfo(#20040,8,#20001,13,"(") +#20041=@"loc,{#10000},2,27,2,27" +locations_default(#20041,#10000,2,27,2,27) +hasLocation(#20040,#20041) +#20042=* +tokeninfo(#20042,6,#20001,14,"foo") +#20043=@"loc,{#10000},2,28,2,30" +locations_default(#20043,#10000,2,28,2,30) +hasLocation(#20042,#20043) +#20044=* +tokeninfo(#20044,8,#20001,15,")") +#20045=@"loc,{#10000},2,31,2,31" +locations_default(#20045,#10000,2,31,2,31) +hasLocation(#20044,#20045) +#20046=* +tokeninfo(#20046,8,#20001,16,".") +#20047=@"loc,{#10000},2,32,2,32" +locations_default(#20047,#10000,2,32,2,32) +hasLocation(#20046,#20047) +#20048=* +tokeninfo(#20048,6,#20001,17,"bar") +#20049=@"loc,{#10000},2,33,2,35" +locations_default(#20049,#10000,2,33,2,35) +hasLocation(#20048,#20049) +#20050=* +tokeninfo(#20050,8,#20001,18,"{") +#20051=@"loc,{#10000},2,37,2,37" +locations_default(#20051,#10000,2,37,2,37) +hasLocation(#20050,#20051) +#20052=* +tokeninfo(#20052,8,#20001,19,"}") +#20053=@"loc,{#10000},2,38,2,38" +locations_default(#20053,#10000,2,38,2,38) +hasLocation(#20052,#20053) +#20054=* +tokeninfo(#20054,7,#20001,20,"interface") +#20055=@"loc,{#10000},3,1,3,9" +locations_default(#20055,#10000,3,1,3,9) +hasLocation(#20054,#20055) +#20056=* +tokeninfo(#20056,6,#20001,21,"Invalid") +#20057=@"loc,{#10000},3,11,3,17" +locations_default(#20057,#10000,3,11,3,17) +hasLocation(#20056,#20057) +#20058=* +tokeninfo(#20058,7,#20001,22,"extends") +#20059=@"loc,{#10000},3,19,3,25" +locations_default(#20059,#10000,3,19,3,25) +hasLocation(#20058,#20059) +#20060=* +tokeninfo(#20060,6,#20001,23,"foo") +#20061=@"loc,{#10000},3,27,3,29" +locations_default(#20061,#10000,3,27,3,29) +hasLocation(#20060,#20061) +#20062=* +tokeninfo(#20062,8,#20001,24,"[") +#20063=@"loc,{#10000},3,30,3,30" +locations_default(#20063,#10000,3,30,3,30) +hasLocation(#20062,#20063) +#20064=* +tokeninfo(#20064,6,#20001,25,"bar") +#20065=@"loc,{#10000},3,31,3,33" +locations_default(#20065,#10000,3,31,3,33) +hasLocation(#20064,#20065) +#20066=* +tokeninfo(#20066,8,#20001,26,"]") +#20067=@"loc,{#10000},3,34,3,34" +locations_default(#20067,#10000,3,34,3,34) +hasLocation(#20066,#20067) +#20068=* +tokeninfo(#20068,8,#20001,27,"{") +#20069=@"loc,{#10000},3,36,3,36" +locations_default(#20069,#10000,3,36,3,36) +hasLocation(#20068,#20069) +#20070=* +tokeninfo(#20070,8,#20001,28,"}") +#20071=@"loc,{#10000},3,37,3,37" +locations_default(#20071,#10000,3,37,3,37) +hasLocation(#20070,#20071) +#20072=* +tokeninfo(#20072,7,#20001,29,"interface") +#20073=@"loc,{#10000},4,1,4,9" +locations_default(#20073,#10000,4,1,4,9) +hasLocation(#20072,#20073) +#20074=* +tokeninfo(#20074,6,#20001,30,"Invalid") +#20075=@"loc,{#10000},4,11,4,17" +locations_default(#20075,#10000,4,11,4,17) +hasLocation(#20074,#20075) +#20076=* +tokeninfo(#20076,7,#20001,31,"extends") +#20077=@"loc,{#10000},4,19,4,25" +locations_default(#20077,#10000,4,19,4,25) +hasLocation(#20076,#20077) +#20078=* +tokeninfo(#20078,6,#20001,32,"foo") +#20079=@"loc,{#10000},4,27,4,29" +locations_default(#20079,#10000,4,27,4,29) +hasLocation(#20078,#20079) +#20080=* +tokeninfo(#20080,8,#20001,33,"?.") +#20081=@"loc,{#10000},4,30,4,31" +locations_default(#20081,#10000,4,30,4,31) +hasLocation(#20080,#20081) +#20082=* +tokeninfo(#20082,6,#20001,34,"bar") +#20083=@"loc,{#10000},4,32,4,34" +locations_default(#20083,#10000,4,32,4,34) +hasLocation(#20082,#20083) +#20084=* +tokeninfo(#20084,8,#20001,35,"{") +#20085=@"loc,{#10000},4,36,4,36" +locations_default(#20085,#10000,4,36,4,36) +hasLocation(#20084,#20085) +#20086=* +tokeninfo(#20086,8,#20001,36,"}") +#20087=@"loc,{#10000},4,37,4,37" +locations_default(#20087,#10000,4,37,4,37) +hasLocation(#20086,#20087) +#20088=* +tokeninfo(#20088,7,#20001,37,"interface") +#20089=@"loc,{#10000},5,1,5,9" +locations_default(#20089,#10000,5,1,5,9) +hasLocation(#20088,#20089) +#20090=* +tokeninfo(#20090,6,#20001,38,"Invalid") +#20091=@"loc,{#10000},5,11,5,17" +locations_default(#20091,#10000,5,11,5,17) +hasLocation(#20090,#20091) +#20092=* +tokeninfo(#20092,7,#20001,39,"extends") +#20093=@"loc,{#10000},5,19,5,25" +locations_default(#20093,#10000,5,19,5,25) +hasLocation(#20092,#20093) +#20094=* +tokeninfo(#20094,6,#20001,40,"foo") +#20095=@"loc,{#10000},5,27,5,29" +locations_default(#20095,#10000,5,27,5,29) +hasLocation(#20094,#20095) +#20096=* +tokeninfo(#20096,8,#20001,41,"!") +#20097=@"loc,{#10000},5,30,5,30" +locations_default(#20097,#10000,5,30,5,30) +hasLocation(#20096,#20097) +#20098=* +tokeninfo(#20098,8,#20001,42,".") +#20099=@"loc,{#10000},5,31,5,31" +locations_default(#20099,#10000,5,31,5,31) +hasLocation(#20098,#20099) +#20100=* +tokeninfo(#20100,6,#20001,43,"bar") +#20101=@"loc,{#10000},5,32,5,34" +locations_default(#20101,#10000,5,32,5,34) +hasLocation(#20100,#20101) +#20102=* +tokeninfo(#20102,8,#20001,44,"{") +#20103=@"loc,{#10000},5,36,5,36" +locations_default(#20103,#10000,5,36,5,36) +hasLocation(#20102,#20103) +#20104=* +tokeninfo(#20104,8,#20001,45,"}") +#20105=@"loc,{#10000},5,37,5,37" +locations_default(#20105,#10000,5,37,5,37) +hasLocation(#20104,#20105) +#20106=* +tokeninfo(#20106,7,#20001,46,"interface") +#20107=@"loc,{#10000},6,1,6,9" +locations_default(#20107,#10000,6,1,6,9) +hasLocation(#20106,#20107) +#20108=* +tokeninfo(#20108,6,#20001,47,"Invalid") +#20109=@"loc,{#10000},6,11,6,17" +locations_default(#20109,#10000,6,11,6,17) +hasLocation(#20108,#20109) +#20110=* +tokeninfo(#20110,7,#20001,48,"extends") +#20111=@"loc,{#10000},6,19,6,25" +locations_default(#20111,#10000,6,19,6,25) +hasLocation(#20110,#20111) +#20112=* +tokeninfo(#20112,6,#20001,49,"foo") +#20113=@"loc,{#10000},6,27,6,29" +locations_default(#20113,#10000,6,27,6,29) +hasLocation(#20112,#20113) +#20114=* +tokeninfo(#20114,8,#20001,50,"(") +#20115=@"loc,{#10000},6,30,6,30" +locations_default(#20115,#10000,6,30,6,30) +hasLocation(#20114,#20115) +#20116=* +tokeninfo(#20116,8,#20001,51,")") +#20117=@"loc,{#10000},6,31,6,31" +locations_default(#20117,#10000,6,31,6,31) +hasLocation(#20116,#20117) +#20118=* +tokeninfo(#20118,8,#20001,52,"{") +#20119=@"loc,{#10000},6,33,6,33" +locations_default(#20119,#10000,6,33,6,33) +hasLocation(#20118,#20119) +#20120=* +tokeninfo(#20120,8,#20001,53,"}") +#20121=@"loc,{#10000},6,34,6,34" +locations_default(#20121,#10000,6,34,6,34) +hasLocation(#20120,#20121) +#20122=* +tokeninfo(#20122,0,#20001,54,"") +#20123=@"loc,{#10000},7,1,7,0" +locations_default(#20123,#10000,7,1,7,0) +hasLocation(#20122,#20123) +toplevels(#20001,0) +#20124=@"loc,{#10000},1,1,7,0" +locations_default(#20124,#10000,1,1,7,0) +hasLocation(#20001,#20124) +#20125=@"local_type_name;{Invalid};{#20000}" +local_type_names(#20125,"Invalid",#20000) +#20126=* +stmts(#20126,34,#20001,0,"interfa ... bar) {}") +hasLocation(#20126,#20003) +stmt_containers(#20126,#20001) +#20127=* +typeexprs(#20127,1,#20126,0,"Invalid") +hasLocation(#20127,#20017) +enclosing_stmt(#20127,#20126) +expr_containers(#20127,#20001) +literals("Invalid","Invalid",#20127) +typedecl(#20127,#20125) +#20128=* +stmts(#20128,34,#20001,1,"interfa ... .bar {}") +hasLocation(#20128,#20005) +stmt_containers(#20128,#20001) +#20129=* +typeexprs(#20129,1,#20128,0,"Invalid") +hasLocation(#20129,#20037) +enclosing_stmt(#20129,#20128) +expr_containers(#20129,#20001) +literals("Invalid","Invalid",#20129) +typedecl(#20129,#20125) +#20130=* +stmts(#20130,34,#20001,2,"interfa ... bar] {}") +hasLocation(#20130,#20007) +stmt_containers(#20130,#20001) +#20131=* +typeexprs(#20131,13,#20130,-1,"foo[bar]") +#20132=@"loc,{#10000},3,27,3,34" +locations_default(#20132,#10000,3,27,3,34) +hasLocation(#20131,#20132) +enclosing_stmt(#20131,#20130) +expr_containers(#20131,#20001) +#20133=* +typeexprs(#20133,25,#20131,0,"foo") +hasLocation(#20133,#20061) +enclosing_stmt(#20133,#20130) +expr_containers(#20133,#20001) +literals("foo","foo",#20133) +#20134=* +typeexprs(#20134,15,#20131,1,"bar") +hasLocation(#20134,#20065) +enclosing_stmt(#20134,#20130) +expr_containers(#20134,#20001) +literals("bar","bar",#20134) +#20135=* +typeexprs(#20135,1,#20130,0,"Invalid") +hasLocation(#20135,#20057) +enclosing_stmt(#20135,#20130) +expr_containers(#20135,#20001) +literals("Invalid","Invalid",#20135) +typedecl(#20135,#20125) +#20136=* +stmts(#20136,34,#20001,3,"interfa ... .bar {}") +hasLocation(#20136,#20009) +stmt_containers(#20136,#20001) +#20137=* +typeexprs(#20137,13,#20136,-1,"foo?.bar") +#20138=@"loc,{#10000},4,27,4,34" +locations_default(#20138,#10000,4,27,4,34) +hasLocation(#20137,#20138) +enclosing_stmt(#20137,#20136) +expr_containers(#20137,#20001) +#20139=* +typeexprs(#20139,25,#20137,0,"foo") +hasLocation(#20139,#20079) +enclosing_stmt(#20139,#20136) +expr_containers(#20139,#20001) +literals("foo","foo",#20139) +#20140=* +typeexprs(#20140,15,#20137,1,"bar") +hasLocation(#20140,#20083) +enclosing_stmt(#20140,#20136) +expr_containers(#20140,#20001) +literals("bar","bar",#20140) +isOptionalChaining(#20137) +#20141=* +typeexprs(#20141,1,#20136,0,"Invalid") +hasLocation(#20141,#20075) +enclosing_stmt(#20141,#20136) +expr_containers(#20141,#20001) +literals("Invalid","Invalid",#20141) +typedecl(#20141,#20125) +#20142=* +stmts(#20142,34,#20001,4,"interfa ... .bar {}") +hasLocation(#20142,#20011) +stmt_containers(#20142,#20001) +#20143=* +typeexprs(#20143,1,#20142,0,"Invalid") +hasLocation(#20143,#20091) +enclosing_stmt(#20143,#20142) +expr_containers(#20143,#20001) +literals("Invalid","Invalid",#20143) +typedecl(#20143,#20125) +#20144=* +stmts(#20144,34,#20001,5,"interfa ... oo() {}") +hasLocation(#20144,#20013) +stmt_containers(#20144,#20001) +#20145=* +typeexprs(#20145,1,#20144,0,"Invalid") +hasLocation(#20145,#20109) +enclosing_stmt(#20145,#20144) +expr_containers(#20145,#20001) +literals("Invalid","Invalid",#20145) +typedecl(#20145,#20125) +#20146=* +entry_cfg_node(#20146,#20001) +#20147=@"loc,{#10000},1,1,1,0" +locations_default(#20147,#10000,1,1,1,0) +hasLocation(#20146,#20147) +#20148=* +exit_cfg_node(#20148,#20001) +hasLocation(#20148,#20123) +successor(#20144,#20148) +successor(#20142,#20144) +successor(#20136,#20142) +successor(#20130,#20136) +successor(#20128,#20130) +successor(#20126,#20128) +successor(#20146,#20126) +numlines(#10000,6,6,0) +filetype(#10000,"typescript") diff --git a/javascript/ql/test/library-tests/TypeScript/Types/printAst.expected b/javascript/ql/test/library-tests/TypeScript/Types/printAst.expected index df304b899bb0..04d6e6247ff0 100644 --- a/javascript/ql/test/library-tests/TypeScript/Types/printAst.expected +++ b/javascript/ql/test/library-tests/TypeScript/Types/printAst.expected @@ -2,9 +2,6 @@ nodes | badTypes.ts:5:1:5:29 | [InterfaceDeclaration,TypeDefinition] interfa ... is.B {} | semmle.label | [InterfaceDeclaration,TypeDefinition] interfa ... is.B {} | | badTypes.ts:5:1:5:29 | [InterfaceDeclaration,TypeDefinition] interfa ... is.B {} | semmle.order | 1 | | badTypes.ts:5:11:5:11 | [Identifier] A | semmle.label | [Identifier] A | -| badTypes.ts:5:21:5:24 | [ThisVarTypeAccess] this | semmle.label | [ThisVarTypeAccess] this | -| badTypes.ts:5:21:5:26 | [TypeAccess] this.B | semmle.label | [TypeAccess] this.B | -| badTypes.ts:5:26:5:26 | [Identifier] B | semmle.label | [Identifier] B | | badTypes.ts:6:1:6:24 | [TypeAliasDeclaration,TypeDefinition] type T ... ar.bar; | semmle.label | [TypeAliasDeclaration,TypeDefinition] type T ... ar.bar; | | badTypes.ts:6:1:6:24 | [TypeAliasDeclaration,TypeDefinition] type T ... ar.bar; | semmle.order | 2 | | badTypes.ts:6:6:6:6 | [Identifier] T | semmle.label | [Identifier] T | @@ -2171,12 +2168,6 @@ nodes edges | badTypes.ts:5:1:5:29 | [InterfaceDeclaration,TypeDefinition] interfa ... is.B {} | badTypes.ts:5:11:5:11 | [Identifier] A | semmle.label | 1 | | badTypes.ts:5:1:5:29 | [InterfaceDeclaration,TypeDefinition] interfa ... is.B {} | badTypes.ts:5:11:5:11 | [Identifier] A | semmle.order | 1 | -| badTypes.ts:5:1:5:29 | [InterfaceDeclaration,TypeDefinition] interfa ... is.B {} | badTypes.ts:5:21:5:26 | [TypeAccess] this.B | semmle.label | 2 | -| badTypes.ts:5:1:5:29 | [InterfaceDeclaration,TypeDefinition] interfa ... is.B {} | badTypes.ts:5:21:5:26 | [TypeAccess] this.B | semmle.order | 2 | -| badTypes.ts:5:21:5:26 | [TypeAccess] this.B | badTypes.ts:5:21:5:24 | [ThisVarTypeAccess] this | semmle.label | 1 | -| badTypes.ts:5:21:5:26 | [TypeAccess] this.B | badTypes.ts:5:21:5:24 | [ThisVarTypeAccess] this | semmle.order | 1 | -| badTypes.ts:5:21:5:26 | [TypeAccess] this.B | badTypes.ts:5:26:5:26 | [Identifier] B | semmle.label | 2 | -| badTypes.ts:5:21:5:26 | [TypeAccess] this.B | badTypes.ts:5:26:5:26 | [Identifier] B | semmle.order | 2 | | badTypes.ts:6:1:6:24 | [TypeAliasDeclaration,TypeDefinition] type T ... ar.bar; | badTypes.ts:6:6:6:6 | [Identifier] T | semmle.label | 1 | | badTypes.ts:6:1:6:24 | [TypeAliasDeclaration,TypeDefinition] type T ... ar.bar; | badTypes.ts:6:6:6:6 | [Identifier] T | semmle.order | 1 | | badTypes.ts:6:1:6:24 | [TypeAliasDeclaration,TypeDefinition] type T ... ar.bar; | badTypes.ts:6:10:6:23 | [TypeofTypeExpr] typeof var.bar | semmle.label | 2 | diff --git a/javascript/ql/test/library-tests/TypeScript/Types/tests.expected b/javascript/ql/test/library-tests/TypeScript/Types/tests.expected index 150ce1867248..b9e11cfa92f3 100644 --- a/javascript/ql/test/library-tests/TypeScript/Types/tests.expected +++ b/javascript/ql/test/library-tests/TypeScript/Types/tests.expected @@ -864,8 +864,6 @@ getTypeDefinitionType | type_definitions.ts:21:1:21:20 | type Alias = T[]; | Alias | getTypeExprType | badTypes.ts:5:11:5:11 | A | A | -| badTypes.ts:5:21:5:26 | this.B | any | -| badTypes.ts:5:26:5:26 | B | any | | badTypes.ts:6:6:6:6 | T | any | | badTypes.ts:6:10:6:23 | typeof var.bar | any | | badTypes.ts:6:17:6:19 | var | any |