JavaScript: Consolidate TypeAnnotations tests.

This commit is contained in:
Max Schaefer
2019-03-01 15:35:49 +00:00
parent 716e741371
commit 65ece6e895
87 changed files with 435 additions and 348 deletions

View File

@@ -1,10 +0,0 @@
| tst.ts:38:16:38:23 | string[] | tst.ts:38:16:38:21 | string |
| tst.ts:39:17:39:24 | string[] | tst.ts:39:17:39:22 | string |
| tst.ts:39:17:39:26 | string[][] | tst.ts:39:17:39:24 | string[] |
| tst.ts:40:17:40:24 | string[] | tst.ts:40:17:40:22 | string |
| tst.ts:40:17:40:26 | string[][] | tst.ts:40:17:40:24 | string[] |
| tst.ts:40:17:40:28 | string[][][] | tst.ts:40:17:40:26 | string[][] |
| tst.ts:80:49:80:54 | Leaf[] | tst.ts:80:49:80:52 | Leaf |
| tst.ts:81:27:81:34 | string[] | tst.ts:81:27:81:32 | string |
| tst.ts:135:39:135:46 | string[] | tst.ts:135:39:135:44 | string |
| tst.ts:136:60:136:67 | number[] | tst.ts:136:60:136:65 | number |

View File

@@ -1,4 +0,0 @@
import javascript
from ArrayTypeExpr expr
select expr, expr.getElementType()

View File

@@ -0,0 +1,3 @@
import javascript
query predicate test_ArrayTypeExpr(ArrayTypeExpr expr, TypeExpr res) { res = expr.getElementType() }

View File

@@ -1,8 +0,0 @@
import javascript
from ASTNode node, ASTNode child1, ASTNode child2, int index
where
node.getChild(index) = child1 and
node.getChild(index) = child2 and
child1 != child2
select node, "There are two different children at index " + index

View File

@@ -0,0 +1,9 @@
import javascript
query predicate test_ChildIndex(ASTNode node, string res) {
exists(ASTNode child1, ASTNode child2, int index |
node.getChild(index) = child1 and node.getChild(index) = child2 and child1 != child2
|
res = "There are two different children at index " + index.toString()
)
}

View File

@@ -40,5 +40,4 @@ class DifferentEnclosingStmt extends Violation, VarDecl {
override string reason() { result = "Type annotation has different enclosing statement" }
}
from Violation err
select err, err.reason()
query predicate test_Containers(Violation err, string res) { res = err.reason() }

View File

@@ -1,6 +0,0 @@
| tst.ts:15:3:15:22 | numberField: number; | tst.ts:15:16:15:21 | number |
| tst.ts:16:3:16:22 | stringField: string; | tst.ts:16:16:16:21 | string |
| tst.ts:17:3:17:28 | interfa ... erface; | tst.ts:17:19:17:27 | Interface |
| tst.ts:18:3:18:18 | thisField: this; | tst.ts:18:14:18:17 | this |
| tst.ts:83:21:83:30 | x: number; | tst.ts:83:24:83:29 | number |
| tst.ts:83:32:83:41 | y: number; | tst.ts:83:35:83:40 | number |

View File

@@ -1,4 +0,0 @@
import javascript
from FieldDeclaration field
select field, field.getTypeAnnotation()

View File

@@ -0,0 +1,5 @@
import javascript
query predicate test_FieldTypes(FieldDeclaration field, TypeExpr res) {
res = field.getTypeAnnotation()
}

View File

@@ -1,4 +0,0 @@
| tst.ts:88:20:88:44 | (param: ... number | 0 | 1 | tst.ts:88:21:88:25 | param |
| tst.ts:89:20:89:37 | <T>(param: T) => T | 0 | 1 | tst.ts:89:24:89:28 | param |
| tst.ts:91:23:91:51 | new (pa ... Object | 0 | 1 | tst.ts:91:28:91:32 | param |
| tst.ts:92:23:92:49 | new <T> ... Object | 0 | 1 | tst.ts:92:31:92:35 | param |

View File

@@ -1,4 +0,0 @@
import javascript
from FunctionTypeExpr type, int n
select type, n, type.getNumParameter(), type.getParameter(n)

View File

@@ -0,0 +1,5 @@
import javascript
query predicate test_FunctionTypeParameters(FunctionTypeExpr type, int n, int res0, Parameter res1) {
res0 = type.getNumParameter() and res1 = type.getParameter(n)
}

View File

@@ -1,6 +0,0 @@
| tst.ts:87:20:87:31 | () => number | tst.ts:87:26:87:31 | number |
| tst.ts:88:20:88:44 | (param: ... number | tst.ts:88:39:88:44 | number |
| tst.ts:89:20:89:37 | <T>(param: T) => T | tst.ts:89:37:89:37 | T |
| tst.ts:90:23:90:38 | new () => Object | tst.ts:90:33:90:38 | Object |
| tst.ts:91:23:91:51 | new (pa ... Object | tst.ts:91:46:91:51 | Object |
| tst.ts:92:23:92:49 | new <T> ... Object | tst.ts:92:44:92:49 | Object |

View File

@@ -1,4 +0,0 @@
import javascript
from FunctionTypeExpr type
select type, type.getReturnTypeAnnotation()

View File

@@ -0,0 +1,5 @@
import javascript
query predicate test_FunctionTypeReturns(FunctionTypeExpr type, TypeExpr res) {
res = type.getReturnTypeAnnotation()
}

View File

@@ -1,11 +0,0 @@
| tst.ts:65:18:65:32 | Generic<number> | tst.ts:65:18:65:24 | Generic | 0 | 1 | tst.ts:65:26:65:31 | number |
| tst.ts:66:18:66:40 | N.Inner ... number> | tst.ts:66:18:66:32 | N.InnerGeneric1 | 0 | 1 | tst.ts:66:34:66:39 | number |
| tst.ts:67:18:67:42 | N.M.Inn ... number> | tst.ts:67:18:67:34 | N.M.InnerGeneric2 | 0 | 1 | tst.ts:67:36:67:41 | number |
| tst.ts:68:18:68:49 | Generic ... umber>> | tst.ts:68:18:68:24 | Generic | 0 | 1 | tst.ts:68:26:68:48 | N.Inner ... number> |
| tst.ts:68:26:68:48 | N.Inner ... number> | tst.ts:68:26:68:40 | N.InnerGeneric1 | 0 | 1 | tst.ts:68:42:68:47 | number |
| tst.ts:69:18:69:54 | ManyTyp ... oolean> | tst.ts:69:18:69:29 | ManyTypeArgs | 0 | 3 | tst.ts:69:31:69:36 | number |
| tst.ts:69:18:69:54 | ManyTyp ... oolean> | tst.ts:69:18:69:29 | ManyTypeArgs | 1 | 3 | tst.ts:69:39:69:44 | string |
| tst.ts:69:18:69:54 | ManyTyp ... oolean> | tst.ts:69:18:69:29 | ManyTypeArgs | 2 | 3 | tst.ts:69:47:69:53 | boolean |
| tst.ts:80:41:80:55 | Generic<Leaf[]> | tst.ts:80:41:80:47 | Generic | 0 | 1 | tst.ts:80:49:80:54 | Leaf[] |
| tst.ts:123:26:123:47 | import( ... string> | tst.ts:123:26:123:39 | import("type") | 0 | 1 | tst.ts:123:41:123:46 | string |
| tst.ts:125:35:125:65 | import( ... string> | tst.ts:125:55:125:57 | Foo | 0 | 1 | tst.ts:125:59:125:64 | string |

View File

@@ -1,4 +0,0 @@
import javascript
from GenericTypeExpr type, int n
select type, type.getTypeAccess(), n, type.getNumTypeArgument(), type.getTypeArgument(n)

View File

@@ -0,0 +1,9 @@
import javascript
query predicate test_GenericTypeExpr(
GenericTypeExpr type, TypeAccess res0, int n, int res1, TypeExpr res2
) {
res0 = type.getTypeAccess() and
res1 = type.getNumTypeArgument() and
res2 = type.getTypeArgument(n)
}

View File

@@ -1,7 +0,0 @@
| tst.ts:122:19:122:32 | import("type") | type | type |
| tst.ts:123:26:123:39 | import("type") | type | type |
| tst.ts:124:28:124:46 | import("namespace") | namespace | namespace |
| tst.ts:125:35:125:53 | import("namespace") | namespace | namespace |
| tst.ts:126:28:126:42 | import("value") | value | value |
| tst.ts:127:37:127:51 | import("value") | value | value |
| tst.ts:128:38:130:3 | import( ... ce'\\n ) | awkard-namespace | namespace |

View File

@@ -9,5 +9,6 @@ string getKind(ImportTypeExpr imprt) {
else result = "value"
}
from ImportTypeExpr imprt
select imprt, imprt.getPath(), getKind(imprt)
query predicate test_ImportTypeExpr(ImportTypeExpr imprt, string res0, string res1) {
res0 = imprt.getPath() and res1 = getKind(imprt)
}

View File

@@ -1 +0,0 @@
| tst.ts:42:18:42:41 | Interfa ... Field'] | tst.ts:42:18:42:26 | Interface | tst.ts:42:28:42:40 | 'numberField' |

View File

@@ -1,4 +0,0 @@
import javascript
from IndexedAccessTypeExpr type
select type, type.getObjectType(), type.getIndexType()

View File

@@ -0,0 +1,5 @@
import javascript
query predicate test_IndexedAccessTypeExpr(IndexedAccessTypeExpr type, TypeExpr res0, TypeExpr res1) {
res0 = type.getObjectType() and res1 = type.getIndexType()
}

View File

@@ -1,3 +0,0 @@
| tst.ts:83:19:83:43 | { x: nu ... mber; } | tst.ts:83:21:83:30 | x: number; |
| tst.ts:83:19:83:43 | { x: nu ... mber; } | tst.ts:83:32:83:41 | y: number; |
| tst.ts:85:25:85:42 | { foo(): number; } | tst.ts:85:27:85:40 | foo(): number; |

View File

@@ -1,4 +0,0 @@
import javascript
from InterfaceTypeExpr type
select type, type.getAMember()

View File

@@ -0,0 +1,5 @@
import javascript
query predicate test_InterfaceTypeExpr(InterfaceTypeExpr type, MemberDeclaration res) {
res = type.getAMember()
}

View File

@@ -1,5 +0,0 @@
| tst.ts:43:23:43:43 | string& ... boolean | 0 | 3 | tst.ts:43:23:43:28 | string |
| tst.ts:43:23:43:43 | string& ... boolean | 1 | 3 | tst.ts:43:30:43:35 | number |
| tst.ts:43:23:43:43 | string& ... boolean | 2 | 3 | tst.ts:43:37:43:43 | boolean |
| tst.ts:47:18:47:55 | (string ... string) | 0 | 2 | tst.ts:47:18:47:34 | (string \| number) |
| tst.ts:47:18:47:55 | (string ... string) | 1 | 2 | tst.ts:47:38:47:55 | (boolean \| string) |

View File

@@ -1,4 +0,0 @@
import javascript
from IntersectionTypeExpr type, int n
select type, n, type.getNumElementType(), type.getElementType(n)

View File

@@ -0,0 +1,5 @@
import javascript
query predicate test_IntersectionTypeExpr(IntersectionTypeExpr type, int n, int res0, TypeExpr res1) {
res0 = type.getNumElementType() and res1 = type.getElementType(n)
}

View File

@@ -1,4 +0,0 @@
| tst.ts:75:17:75:28 | this is Leaf | tst.ts:75:17:75:20 | this | tst.ts:75:25:75:28 | Leaf |
| tst.ts:76:21:76:32 | that is Leaf | tst.ts:76:21:76:24 | that | tst.ts:76:29:76:32 | Leaf |
| tst.ts:80:36:80:55 | x is Generic<Leaf[]> | tst.ts:80:36:80:36 | x | tst.ts:80:41:80:55 | Generic<Leaf[]> |
| tst.ts:81:38:81:50 | x is typeof x | tst.ts:81:38:81:38 | x | tst.ts:81:43:81:50 | typeof x |

View File

@@ -1,4 +0,0 @@
import javascript
from IsTypeExpr type
select type, type.getParameterName(), type.getPredicateType()

View File

@@ -0,0 +1,5 @@
import javascript
query predicate test_IsTypeExpr(IsTypeExpr type, VarTypeAccess res0, TypeExpr res1) {
res0 = type.getParameterName() and res1 = type.getPredicateType()
}

View File

@@ -1,2 +0,0 @@
| tst.ts:49:16:49:30 | keyof Interface | tst.ts:49:22:49:30 | Interface |
| tst.ts:113:26:113:35 | keyof Node | tst.ts:113:32:113:35 | Node |

View File

@@ -1,4 +0,0 @@
import javascript
from KeyofTypeExpr type
select type, type.getElementType()

View File

@@ -0,0 +1,3 @@
import javascript
query predicate test_KeyofTypeExpr(KeyofTypeExpr type, TypeExpr res) { res = type.getElementType() }

View File

@@ -1,2 +0,0 @@
| tst.ts:113:18:113:46 | { [K in ... umber } | tst.ts:113:21:113:35 | K in keyof Node | tst.ts:113:21:113:21 | K | tst.ts:113:26:113:35 | keyof Node | tst.ts:113:39:113:44 | number |
| tst.ts:114:18:114:41 | { [K in ... umber } | tst.ts:114:21:114:30 | K in "foo" | tst.ts:114:21:114:21 | K | tst.ts:114:26:114:30 | "foo" | tst.ts:114:34:114:39 | number |

View File

@@ -1,5 +0,0 @@
import javascript
from MappedTypeExpr type
select type, type.getTypeParameter(), type.getTypeParameter().getIdentifier(),
type.getTypeParameter().getBound(), type.getElementType()

View File

@@ -0,0 +1,10 @@
import javascript
query predicate test_MappedTypeExpr(
MappedTypeExpr type, TypeParameter res0, Identifier res1, TypeExpr res2, TypeExpr res3
) {
res0 = type.getTypeParameter() and
res1 = type.getTypeParameter().getIdentifier() and
res2 = type.getTypeParameter().getBound() and
res3 = type.getElementType()
}

View File

@@ -1,2 +0,0 @@
| tst.ts:133:48:133:54 | number? | tst.ts:133:48:133:53 | number |
| tst.ts:136:48:136:54 | string? | tst.ts:136:48:136:53 | string |

View File

@@ -1,4 +0,0 @@
import javascript
from OptionalTypeExpr type
select type, type.getElementType()

View File

@@ -0,0 +1,5 @@
import javascript
query predicate test_OptionalTypeExpr(OptionalTypeExpr type, TypeExpr res) {
res = type.getElementType()
}

View File

@@ -1,2 +0,0 @@
| tst.ts:36:27:36:32 | param1 | tst.ts:36:44:36:44 | 1 | tst.ts:36:35:36:40 | number |
| tst.ts:36:47:36:52 | param2 | tst.ts:36:64:36:66 | '2' | tst.ts:36:55:36:60 | string |

View File

@@ -1,4 +0,0 @@
import javascript
from Parameter p
select p, p.getDefault(), p.getTypeAnnotation()

View File

@@ -0,0 +1,5 @@
import javascript
query predicate test_Parameters(Parameter p, Expr res0, TypeExpr res1) {
res0 = p.getDefault() and res1 = p.getTypeAnnotation()
}

View File

@@ -1,8 +0,0 @@
| tst.ts:44:24:44:31 | (string) | tst.ts:44:25:44:30 | string | tst.ts:44:25:44:30 | string |
| tst.ts:45:25:45:34 | ((string)) | tst.ts:45:26:45:33 | (string) | tst.ts:45:27:45:32 | string |
| tst.ts:45:26:45:33 | (string) | tst.ts:45:27:45:32 | string | tst.ts:45:27:45:32 | string |
| tst.ts:46:25:46:36 | (((string))) | tst.ts:46:26:46:35 | ((string)) | tst.ts:46:28:46:33 | string |
| tst.ts:46:26:46:35 | ((string)) | tst.ts:46:27:46:34 | (string) | tst.ts:46:28:46:33 | string |
| tst.ts:46:27:46:34 | (string) | tst.ts:46:28:46:33 | string | tst.ts:46:28:46:33 | string |
| tst.ts:47:18:47:34 | (string \| number) | tst.ts:47:19:47:33 | string \| number | tst.ts:47:19:47:33 | string \| number |
| tst.ts:47:38:47:55 | (boolean \| string) | tst.ts:47:39:47:54 | boolean \| string | tst.ts:47:39:47:54 | boolean \| string |

View File

@@ -1,4 +0,0 @@
import javascript
from ParenthesizedTypeExpr type
select type, type.getElementType(), type.stripParens()

View File

@@ -0,0 +1,5 @@
import javascript
query predicate test_ParenthesizedTypeExpr(ParenthesizedTypeExpr type, TypeExpr res0, TypeExpr res1) {
res0 = type.getElementType() and res1 = type.stripParens()
}

View File

@@ -1,8 +0,0 @@
| tst.ts:63:19:63:21 | N.I | tst.ts:63:19:63:19 | N | tst.ts:63:21:63:21 | I |
| tst.ts:64:20:64:24 | N.M.I | tst.ts:64:20:64:22 | N.M | tst.ts:64:24:64:24 | I |
| tst.ts:66:18:66:32 | N.InnerGeneric1 | tst.ts:66:18:66:18 | N | tst.ts:66:20:66:32 | InnerGeneric1 |
| tst.ts:67:18:67:34 | N.M.InnerGeneric2 | tst.ts:67:18:67:20 | N.M | tst.ts:67:22:67:34 | InnerGeneric2 |
| tst.ts:68:26:68:40 | N.InnerGeneric1 | tst.ts:68:26:68:26 | N | tst.ts:68:28:68:40 | InnerGeneric1 |
| tst.ts:124:48:124:50 | Foo | tst.ts:124:28:124:46 | import("namespace") | tst.ts:124:48:124:50 | Foo |
| tst.ts:125:55:125:57 | Foo | tst.ts:125:35:125:53 | import("namespace") | tst.ts:125:55:125:57 | Foo |
| tst.ts:131:4:131:6 | bar | tst.ts:128:38:130:3 | import( ... ce'\\n ) | tst.ts:131:4:131:6 | bar |

View File

@@ -1,4 +0,0 @@
import javascript
from QualifiedTypeAccess type
select type, type.getQualifier(), type.getIdentifier()

View File

@@ -0,0 +1,7 @@
import javascript
query predicate test_QualifiedTypeAccess(
QualifiedTypeAccess type, NamespaceAccess res0, Identifier res1
) {
res0 = type.getQualifier() and res1 = type.getIdentifier()
}

View File

@@ -1,2 +0,0 @@
| tst.ts:135:36:135:46 | ...string[] | tst.ts:135:39:135:46 | string[] | tst.ts:135:39:135:44 | string |
| tst.ts:136:57:136:67 | ...number[] | tst.ts:136:60:136:67 | number[] | tst.ts:136:60:136:65 | number |

View File

@@ -1,4 +0,0 @@
import javascript
from RestTypeExpr rest
select rest, rest.getArrayType(), rest.getElementType()

View File

@@ -0,0 +1,5 @@
import javascript
query predicate test_RestTypeExpr(RestTypeExpr rest, TypeExpr res0, TypeExpr res1) {
res0 = rest.getArrayType() and res1 = rest.getElementType()
}

View File

@@ -1,21 +0,0 @@
| tst.ts:20:3:20:31 | returnN ... number; | method returnNumberMethod of interface Interface | tst.ts:20:25:20:30 | number |
| tst.ts:21:3:21:27 | returnV ... : void; | method returnVoidMethod of interface Interface | tst.ts:21:23:21:26 | void |
| tst.ts:22:3:22:27 | returnN ... : null; | method returnNullMethod of interface Interface | tst.ts:22:23:22:26 | null |
| tst.ts:23:3:23:27 | returnT ... : this; | method returnThisMethod of interface Interface | tst.ts:23:23:23:26 | this |
| tst.ts:30:1:30:53 | functio ... rn 0; } | function returnNumberFunction | tst.ts:30:34:30:39 | number |
| tst.ts:31:1:31:49 | functio ... rn 0; } | function returnVoidFunction | tst.ts:31:32:31:35 | void |
| tst.ts:32:1:32:49 | functio ... rn 0; } | function returnNullFunction | tst.ts:32:32:32:35 | null |
| tst.ts:75:3:75:29 | isThisL ... s Leaf; | method isThisLeaf of interface Node | tst.ts:75:17:75:28 | this is Leaf |
| tst.ts:76:3:76:33 | isThatL ... s Leaf; | method isThatLeaf of interface Node | tst.ts:76:21:76:32 | that is Leaf |
| tst.ts:80:1:80:73 | functio ... alse; } | function complexIsType | tst.ts:80:36:80:55 | x is Generic<Leaf[]> |
| tst.ts:81:1:81:66 | functio ... true } | function obviousIsType | tst.ts:81:38:81:50 | x is typeof x |
| tst.ts:85:27:85:40 | foo(): number; | method foo of anonymous interface | tst.ts:85:34:85:39 | number |
| tst.ts:87:20:87:31 | () => number | anonymous function type | tst.ts:87:26:87:31 | number |
| tst.ts:88:20:88:44 | (param: ... number | anonymous function type | tst.ts:88:39:88:44 | number |
| tst.ts:89:20:89:37 | <T>(param: T) => T | anonymous function type | tst.ts:89:37:89:37 | T |
| tst.ts:90:23:90:38 | new () => Object | anonymous function type | tst.ts:90:33:90:38 | Object |
| tst.ts:91:23:91:51 | new (pa ... Object | anonymous function type | tst.ts:91:46:91:51 | Object |
| tst.ts:92:23:92:49 | new <T> ... Object | anonymous function type | tst.ts:92:44:92:49 | Object |
| tst.ts:94:1:94:37 | functio ... rn x; } | function f1 | tst.ts:94:23:94:23 | S |
| tst.ts:95:1:95:53 | functio ... x,y]; } | function f2 | tst.ts:95:31:95:35 | [S,T] |
| tst.ts:96:1:96:52 | functio ... rn x; } | function f3 | tst.ts:96:38:96:38 | S |

View File

@@ -1,4 +0,0 @@
import javascript
from Function function
select function, function.describe(), function.getReturnTypeAnnotation()

View File

@@ -0,0 +1,5 @@
import javascript
query predicate test_ReturnTypes(Function function, string res0, TypeExpr res1) {
res0 = function.describe() and res1 = function.getReturnTypeAnnotation()
}

View File

@@ -1 +0,0 @@
| function hasThisParam | tst.ts:116:29:116:32 | void |

View File

@@ -1,4 +0,0 @@
import javascript
from Function function
select function.describe(), function.getThisTypeAnnotation()

View File

@@ -0,0 +1,5 @@
import javascript
query predicate test_ThisParameterTypes(string res0, TypeExpr res1) {
exists(Function function | res0 = function.describe() and res1 = function.getThisTypeAnnotation())
}

View File

@@ -1,13 +0,0 @@
| tst.ts:48:16:48:40 | [number ... oolean] | 0 | 3 | tst.ts:48:17:48:22 | number |
| tst.ts:48:16:48:40 | [number ... oolean] | 1 | 3 | tst.ts:48:25:48:30 | string |
| tst.ts:48:16:48:40 | [number ... oolean] | 2 | 3 | tst.ts:48:33:48:39 | boolean |
| tst.ts:95:31:95:35 | [S,T] | 0 | 2 | tst.ts:95:32:95:32 | S |
| tst.ts:95:31:95:35 | [S,T] | 1 | 2 | tst.ts:95:34:95:34 | T |
| tst.ts:133:31:133:55 | [number ... umber?] | 0 | 3 | tst.ts:133:32:133:37 | number |
| tst.ts:133:31:133:55 | [number ... umber?] | 1 | 3 | tst.ts:133:40:133:45 | string |
| tst.ts:133:31:133:55 | [number ... umber?] | 2 | 3 | tst.ts:133:48:133:54 | number? |
| tst.ts:135:27:135:47 | [number ... ring[]] | 0 | 2 | tst.ts:135:28:135:33 | number |
| tst.ts:135:27:135:47 | [number ... ring[]] | 1 | 2 | tst.ts:135:36:135:46 | ...string[] |
| tst.ts:136:39:136:68 | [number ... mber[]] | 0 | 3 | tst.ts:136:40:136:45 | number |
| tst.ts:136:39:136:68 | [number ... mber[]] | 1 | 3 | tst.ts:136:48:136:54 | string? |
| tst.ts:136:39:136:68 | [number ... mber[]] | 2 | 3 | tst.ts:136:57:136:67 | ...number[] |

View File

@@ -1,4 +0,0 @@
import javascript
from TupleTypeExpr type, int n
select type, n, type.getNumElementType(), type.getElementType(n)

View File

@@ -0,0 +1,5 @@
import javascript
query predicate test_TupleTypeExpr(TupleTypeExpr type, int n, int res0, TypeExpr res1) {
res0 = type.getNumElementType() and res1 = type.getElementType(n)
}

View File

@@ -1,11 +0,0 @@
| tst.ts:65:18:65:24 | Generic | 1 | 0 | tst.ts:65:26:65:31 | number |
| tst.ts:66:18:66:32 | N.InnerGeneric1 | 1 | 0 | tst.ts:66:34:66:39 | number |
| tst.ts:67:18:67:34 | N.M.InnerGeneric2 | 1 | 0 | tst.ts:67:36:67:41 | number |
| tst.ts:68:18:68:24 | Generic | 1 | 0 | tst.ts:68:26:68:48 | N.Inner ... number> |
| tst.ts:68:26:68:40 | N.InnerGeneric1 | 1 | 0 | tst.ts:68:42:68:47 | number |
| tst.ts:69:18:69:29 | ManyTypeArgs | 3 | 0 | tst.ts:69:31:69:36 | number |
| tst.ts:69:18:69:29 | ManyTypeArgs | 3 | 1 | tst.ts:69:39:69:44 | string |
| tst.ts:69:18:69:29 | ManyTypeArgs | 3 | 2 | tst.ts:69:47:69:53 | boolean |
| tst.ts:80:41:80:47 | Generic | 1 | 0 | tst.ts:80:49:80:54 | Leaf[] |
| tst.ts:123:26:123:39 | import("type") | 1 | 0 | tst.ts:123:41:123:46 | string |
| tst.ts:125:55:125:57 | Foo | 1 | 0 | tst.ts:125:59:125:64 | string |

View File

@@ -1,5 +0,0 @@
import javascript
from TypeAccess type, int n
where type.hasTypeArguments()
select type, type.getNumTypeArgument(), n, type.getTypeArgument(n)

View File

@@ -0,0 +1,5 @@
import javascript
query predicate test_TypeAccessHelpers(TypeAccess type, int res0, int n, TypeExpr res1) {
type.hasTypeArguments() and res0 = type.getNumTypeArgument() and res1 = type.getTypeArgument(n)
}

View File

@@ -1,8 +0,0 @@
| tst.ts:102:13:102:29 | f1<string>("foo") | 0 | 1 | tst.ts:102:16:102:21 | string |
| tst.ts:103:13:103:40 | f2<stri ... oo", 5) | 0 | 2 | tst.ts:103:16:103:21 | string |
| tst.ts:103:13:103:40 | f2<stri ... oo", 5) | 1 | 2 | tst.ts:103:24:103:29 | number |
| tst.ts:104:13:104:25 | f3<number>(5) | 0 | 1 | tst.ts:104:16:104:21 | number |
| tst.ts:106:12:106:27 | new C1<string>() | 0 | 1 | tst.ts:106:19:106:24 | string |
| tst.ts:107:12:107:35 | new C2< ... mber>() | 0 | 2 | tst.ts:107:19:107:24 | string |
| tst.ts:107:12:107:35 | new C2< ... mber>() | 1 | 2 | tst.ts:107:27:107:32 | number |
| tst.ts:108:12:108:27 | new C3<number>() | 0 | 1 | tst.ts:108:19:108:24 | number |

View File

@@ -1,4 +0,0 @@
import javascript
from InvokeExpr invoke, int n
select invoke, n, invoke.getNumTypeArgument(), invoke.getTypeArgument(n)

View File

@@ -0,0 +1,5 @@
import javascript
query predicate test_TypeArguments(InvokeExpr invoke, int n, int res0, TypeExpr res1) {
res0 = invoke.getNumTypeArgument() and res1 = invoke.getTypeArgument(n)
}

View File

@@ -1,2 +0,0 @@
| tst.ts:110:14:110:24 | 5 as number | tst.ts:110:14:110:14 | 5 | tst.ts:110:19:110:24 | number |
| tst.ts:111:18:111:31 | <string> 'foo' | tst.ts:111:27:111:31 | 'foo' | tst.ts:111:19:111:24 | string |

View File

@@ -1,4 +0,0 @@
import javascript
from TypeAssertion expr
select expr, expr.getExpression(), expr.getTypeAnnotation()

View File

@@ -0,0 +1,5 @@
import javascript
query predicate test_TypeAssertions(TypeAssertion expr, Expr res0, TypeExpr res1) {
res0 = expr.getExpression() and res1 = expr.getTypeAnnotation()
}

View File

@@ -1,6 +0,0 @@
| tst.ts:70:17:70:24 | typeof N | tst.ts:70:24:70:24 | N |
| tst.ts:71:17:71:26 | typeof N.x | tst.ts:71:24:71:26 | N.x |
| tst.ts:72:17:72:35 | typeof qualifiedVar | tst.ts:72:24:72:35 | qualifiedVar |
| tst.ts:81:43:81:50 | typeof x | tst.ts:81:50:81:50 | x |
| tst.ts:126:21:126:42 | typeof ... value") | tst.ts:126:28:126:42 | import("value") |
| tst.ts:127:30:127:53 | typeof ... lue").x | tst.ts:127:53:127:53 | x |

View File

@@ -1,4 +0,0 @@
import javascript
from TypeofTypeExpr type
select type, type.getExpressionName()

View File

@@ -0,0 +1,5 @@
import javascript
query predicate test_TypeofTypeExpr(TypeofTypeExpr type, VarTypeAccess res) {
res = type.getExpressionName()
}

View File

@@ -1,7 +0,0 @@
| tst.ts:41:16:41:36 | string\| ... boolean | 0 | 3 | tst.ts:41:16:41:21 | string |
| tst.ts:41:16:41:36 | string\| ... boolean | 1 | 3 | tst.ts:41:23:41:28 | number |
| tst.ts:41:16:41:36 | string\| ... boolean | 2 | 3 | tst.ts:41:30:41:36 | boolean |
| tst.ts:47:19:47:33 | string \| number | 0 | 2 | tst.ts:47:19:47:24 | string |
| tst.ts:47:19:47:33 | string \| number | 1 | 2 | tst.ts:47:28:47:33 | number |
| tst.ts:47:39:47:54 | boolean \| string | 0 | 2 | tst.ts:47:39:47:45 | boolean |
| tst.ts:47:39:47:54 | boolean \| string | 1 | 2 | tst.ts:47:49:47:54 | string |

View File

@@ -1,4 +0,0 @@
import javascript
from UnionTypeExpr type, int n
select type, n, type.getNumElementType(), type.getElementType(n)

View File

@@ -0,0 +1,5 @@
import javascript
query predicate test_UnionTypeExpr(UnionTypeExpr type, int n, int res0, TypeExpr res1) {
res0 = type.getNumElementType() and res1 = type.getElementType(n)
}

View File

@@ -1 +0,0 @@
| tst.ts:137:18:137:24 | unknown |

View File

@@ -1,5 +0,0 @@
import javascript
from TypeExpr type
where type.isUnknownKeyword()
select type

View File

@@ -0,0 +1,3 @@
import javascript
query predicate test_UnknownTypeExpr(TypeExpr type) { type.isUnknownKeyword() }

View File

@@ -1,76 +0,0 @@
| tst.ts:1:5:1:13 | stringVar | stringVar | tst.ts:1:16:1:21 | string |
| tst.ts:2:5:2:13 | numberVar | numberVar | tst.ts:2:16:2:21 | number |
| tst.ts:3:5:3:14 | booleanVar | booleanVar | tst.ts:3:17:3:23 | boolean |
| tst.ts:4:5:4:11 | nullVar | nullVar | tst.ts:4:14:4:17 | null |
| tst.ts:5:5:5:16 | undefinedVar | undefinedVar | tst.ts:5:19:5:27 | undefined |
| tst.ts:6:5:6:10 | anyVar | anyVar | tst.ts:6:13:6:15 | any |
| tst.ts:7:5:7:11 | voidVar | voidVar | tst.ts:7:14:7:17 | void |
| tst.ts:8:5:8:12 | neverVar | neverVar | tst.ts:8:15:8:19 | never |
| tst.ts:9:5:9:17 | literalString | literalString | tst.ts:9:20:9:24 | "foo" |
| tst.ts:10:5:10:17 | literalNumber | literalNumber | tst.ts:10:20:10:21 | 45 |
| tst.ts:11:5:11:15 | literalTrue | literalTrue | tst.ts:11:18:11:21 | true |
| tst.ts:12:5:12:16 | literalFalse | literalFalse | tst.ts:12:19:12:23 | false |
| tst.ts:24:20:24:36 | numberMethodParam | numberMethodParam | tst.ts:24:39:24:44 | number |
| tst.ts:25:23:25:42 | interfaceMethodParam | interfaceMethodParam | tst.ts:25:45:25:53 | Interface |
| tst.ts:28:5:28:16 | interfaceVar | interfaceVar | tst.ts:28:19:28:27 | Interface |
| tst.ts:33:29:33:47 | numberFunctionParam | numberFunctionParam | tst.ts:33:50:33:55 | number |
| tst.ts:34:32:34:52 | interac ... onParam | interaceFunctionParam | tst.ts:34:55:34:63 | Interface |
| tst.ts:36:27:36:32 | param1 | param1 | tst.ts:36:35:36:40 | number |
| tst.ts:36:47:36:52 | param2 | param2 | tst.ts:36:55:36:60 | string |
| tst.ts:38:5:38:13 | arrayType | arrayType | tst.ts:38:16:38:23 | string[] |
| tst.ts:39:5:39:14 | arrayType2 | arrayType2 | tst.ts:39:17:39:26 | string[][] |
| tst.ts:40:5:40:14 | arrayType3 | arrayType3 | tst.ts:40:17:40:28 | string[][][] |
| tst.ts:41:5:41:13 | unionType | unionType | tst.ts:41:16:41:36 | string\| ... boolean |
| tst.ts:42:5:42:15 | indexedType | indexedType | tst.ts:42:18:42:41 | Interfa ... Field'] |
| tst.ts:43:5:43:20 | intersectionType | intersectionType | tst.ts:43:23:43:43 | string& ... boolean |
| tst.ts:44:5:44:21 | parenthesizedType | parenthesizedType | tst.ts:44:24:44:31 | (string) |
| tst.ts:45:5:45:22 | parenthesizedType2 | parenthesizedType2 | tst.ts:45:25:45:34 | ((string)) |
| tst.ts:46:5:46:22 | parenthesizedType3 | parenthesizedType3 | tst.ts:46:25:46:36 | (((string))) |
| tst.ts:47:5:47:15 | complexType | complexType | tst.ts:47:18:47:55 | (string ... string) |
| tst.ts:48:5:48:13 | tupleType | tupleType | tst.ts:48:16:48:40 | [number ... oolean] |
| tst.ts:49:5:49:13 | keyofType | keyofType | tst.ts:49:16:49:30 | keyof Interface |
| tst.ts:63:5:63:16 | qualifiedVar | qualifiedVar | tst.ts:63:19:63:21 | N.I |
| tst.ts:64:5:64:17 | qualifiedVar2 | qualifiedVar2 | tst.ts:64:20:64:24 | N.M.I |
| tst.ts:65:5:65:15 | genericVar1 | genericVar1 | tst.ts:65:18:65:32 | Generic<number> |
| tst.ts:66:5:66:15 | genericVar2 | genericVar2 | tst.ts:66:18:66:40 | N.Inner ... number> |
| tst.ts:67:5:67:15 | genericVar3 | genericVar3 | tst.ts:67:18:67:42 | N.M.Inn ... number> |
| tst.ts:68:5:68:15 | genericVar4 | genericVar4 | tst.ts:68:18:68:49 | Generic ... umber>> |
| tst.ts:69:5:69:15 | genericVar5 | genericVar5 | tst.ts:69:18:69:54 | ManyTyp ... oolean> |
| tst.ts:70:5:70:14 | typeofVar1 | typeofVar1 | tst.ts:70:17:70:24 | typeof N |
| tst.ts:71:5:71:14 | typeofVar2 | typeofVar2 | tst.ts:71:17:71:26 | typeof N.x |
| tst.ts:72:5:72:14 | typeofVar3 | typeofVar3 | tst.ts:72:17:72:35 | typeof qualifiedVar |
| tst.ts:80:24:80:24 | x | x | tst.ts:80:27:80:32 | number |
| tst.ts:81:24:81:24 | x | x | tst.ts:81:27:81:34 | string[] |
| tst.ts:83:5:83:16 | interfaceVar | interfaceVar | tst.ts:83:19:83:43 | { x: nu ... mber; } |
| tst.ts:84:5:84:21 | emptyInterfaceVar | emptyInterfaceVar | tst.ts:84:24:84:25 | {} |
| tst.ts:85:5:85:22 | interfaceVarMethod | interfaceVarMethod | tst.ts:85:25:85:42 | { foo(): number; } |
| tst.ts:87:5:87:17 | functionType1 | functionType1 | tst.ts:87:20:87:31 | () => number |
| tst.ts:88:5:88:17 | functionType2 | functionType2 | tst.ts:88:20:88:44 | (param: ... number |
| tst.ts:88:21:88:25 | param | param | tst.ts:88:28:88:33 | string |
| tst.ts:89:5:89:17 | functionType3 | functionType3 | tst.ts:89:20:89:37 | <T>(param: T) => T |
| tst.ts:89:24:89:28 | param | param | tst.ts:89:31:89:31 | T |
| tst.ts:90:5:90:20 | constructorType1 | constructorType1 | tst.ts:90:23:90:38 | new () => Object |
| tst.ts:91:5:91:20 | constructorType2 | constructorType2 | tst.ts:91:23:91:51 | new (pa ... Object |
| tst.ts:91:28:91:32 | param | param | tst.ts:91:35:91:40 | string |
| tst.ts:92:5:92:20 | constructorType3 | constructorType3 | tst.ts:92:23:92:49 | new <T> ... Object |
| tst.ts:92:31:92:35 | param | param | tst.ts:92:38:92:38 | T |
| tst.ts:94:16:94:16 | x | x | tst.ts:94:19:94:19 | S |
| tst.ts:95:18:95:18 | x | x | tst.ts:95:21:95:21 | S |
| tst.ts:95:24:95:24 | y | y | tst.ts:95:27:95:27 | T |
| tst.ts:96:31:96:31 | x | x | tst.ts:96:34:96:34 | S |
| tst.ts:113:5:113:15 | mappedType1 | mappedType1 | tst.ts:113:18:113:46 | { [K in ... umber } |
| tst.ts:114:5:114:15 | mappedType2 | mappedType2 | tst.ts:114:18:114:41 | { [K in ... umber } |
| tst.ts:116:35:116:35 | x | x | tst.ts:116:38:116:43 | number |
| tst.ts:116:46:116:46 | y | y | tst.ts:116:49:116:54 | string |
| tst.ts:122:5:122:16 | importedType | importedType | tst.ts:122:19:122:32 | import("type") |
| tst.ts:123:5:123:23 | importedTypeGeneric | importedTypeGeneric | tst.ts:123:26:123:47 | import( ... string> |
| tst.ts:124:5:124:25 | importe ... iedType | importedQualifiedType | tst.ts:124:48:124:50 | Foo |
| tst.ts:125:5:125:32 | importe ... Generic | importedQualifiedTypeGeneric | tst.ts:125:35:125:65 | import( ... string> |
| tst.ts:126:5:126:18 | importedTypeof | importedTypeof | tst.ts:126:21:126:42 | typeof ... value") |
| tst.ts:127:5:127:27 | importe ... dTypeof | importedQualifiedTypeof | tst.ts:127:30:127:53 | typeof ... lue").x |
| tst.ts:128:5:128:35 | importe ... tespace | importedQualifiedTypeWhitespace | tst.ts:131:4:131:6 | bar |
| tst.ts:133:5:133:28 | tupleWi ... Element | tupleWithOptionalElement | tst.ts:133:31:133:55 | [number ... umber?] |
| tst.ts:134:5:134:14 | emptyTuple | emptyTuple | tst.ts:134:17:134:18 | [] |
| tst.ts:135:5:135:24 | tupleWithRestElement | tupleWithRestElement | tst.ts:135:27:135:47 | [number ... ring[]] |
| tst.ts:136:5:136:36 | tupleWi ... lements | tupleWithOptionalAndRestElements | tst.ts:136:39:136:68 | [number ... mber[]] |
| tst.ts:137:5:137:15 | unknownType | unknownType | tst.ts:137:18:137:24 | unknown |

View File

@@ -1,4 +0,0 @@
import javascript
from VarDecl var
select var, var.getName(), var.getTypeAnnotation()

View File

@@ -0,0 +1,5 @@
import javascript
query predicate test_VariableTypes(VarDecl var, string res0, TypeExpr res1) {
res0 = var.getName() and res1 = var.getTypeAnnotation()
}

View File

@@ -0,0 +1,258 @@
test_TypeofTypeExpr
| tst.ts:70:17:70:24 | typeof N | tst.ts:70:24:70:24 | N |
| tst.ts:71:17:71:26 | typeof N.x | tst.ts:71:24:71:26 | N.x |
| tst.ts:72:17:72:35 | typeof qualifiedVar | tst.ts:72:24:72:35 | qualifiedVar |
| tst.ts:81:43:81:50 | typeof x | tst.ts:81:50:81:50 | x |
| tst.ts:126:21:126:42 | typeof ... value") | tst.ts:126:28:126:42 | import("value") |
| tst.ts:127:30:127:53 | typeof ... lue").x | tst.ts:127:53:127:53 | x |
test_FunctionTypeParameters
| tst.ts:88:20:88:44 | (param: ... number | 0 | 1 | tst.ts:88:21:88:25 | param |
| tst.ts:89:20:89:37 | <T>(param: T) => T | 0 | 1 | tst.ts:89:24:89:28 | param |
| tst.ts:91:23:91:51 | new (pa ... Object | 0 | 1 | tst.ts:91:28:91:32 | param |
| tst.ts:92:23:92:49 | new <T> ... Object | 0 | 1 | tst.ts:92:31:92:35 | param |
test_IndexedAccessTypeExpr
| tst.ts:42:18:42:41 | Interfa ... Field'] | tst.ts:42:18:42:26 | Interface | tst.ts:42:28:42:40 | 'numberField' |
test_UnknownTypeExpr
| tst.ts:137:18:137:24 | unknown |
test_MappedTypeExpr
| tst.ts:113:18:113:46 | { [K in ... umber } | tst.ts:113:21:113:35 | K in keyof Node | tst.ts:113:21:113:21 | K | tst.ts:113:26:113:35 | keyof Node | tst.ts:113:39:113:44 | number |
| tst.ts:114:18:114:41 | { [K in ... umber } | tst.ts:114:21:114:30 | K in "foo" | tst.ts:114:21:114:21 | K | tst.ts:114:26:114:30 | "foo" | tst.ts:114:34:114:39 | number |
test_ImportTypeExpr
| tst.ts:122:19:122:32 | import("type") | type | type |
| tst.ts:123:26:123:39 | import("type") | type | type |
| tst.ts:124:28:124:46 | import("namespace") | namespace | namespace |
| tst.ts:125:35:125:53 | import("namespace") | namespace | namespace |
| tst.ts:126:28:126:42 | import("value") | value | value |
| tst.ts:127:37:127:51 | import("value") | value | value |
| tst.ts:128:38:130:3 | import( ... ce'\\n ) | awkard-namespace | namespace |
test_OptionalTypeExpr
| tst.ts:133:48:133:54 | number? | tst.ts:133:48:133:53 | number |
| tst.ts:136:48:136:54 | string? | tst.ts:136:48:136:53 | string |
test_VariableTypes
| tst.ts:1:5:1:13 | stringVar | stringVar | tst.ts:1:16:1:21 | string |
| tst.ts:2:5:2:13 | numberVar | numberVar | tst.ts:2:16:2:21 | number |
| tst.ts:3:5:3:14 | booleanVar | booleanVar | tst.ts:3:17:3:23 | boolean |
| tst.ts:4:5:4:11 | nullVar | nullVar | tst.ts:4:14:4:17 | null |
| tst.ts:5:5:5:16 | undefinedVar | undefinedVar | tst.ts:5:19:5:27 | undefined |
| tst.ts:6:5:6:10 | anyVar | anyVar | tst.ts:6:13:6:15 | any |
| tst.ts:7:5:7:11 | voidVar | voidVar | tst.ts:7:14:7:17 | void |
| tst.ts:8:5:8:12 | neverVar | neverVar | tst.ts:8:15:8:19 | never |
| tst.ts:9:5:9:17 | literalString | literalString | tst.ts:9:20:9:24 | "foo" |
| tst.ts:10:5:10:17 | literalNumber | literalNumber | tst.ts:10:20:10:21 | 45 |
| tst.ts:11:5:11:15 | literalTrue | literalTrue | tst.ts:11:18:11:21 | true |
| tst.ts:12:5:12:16 | literalFalse | literalFalse | tst.ts:12:19:12:23 | false |
| tst.ts:24:20:24:36 | numberMethodParam | numberMethodParam | tst.ts:24:39:24:44 | number |
| tst.ts:25:23:25:42 | interfaceMethodParam | interfaceMethodParam | tst.ts:25:45:25:53 | Interface |
| tst.ts:28:5:28:16 | interfaceVar | interfaceVar | tst.ts:28:19:28:27 | Interface |
| tst.ts:33:29:33:47 | numberFunctionParam | numberFunctionParam | tst.ts:33:50:33:55 | number |
| tst.ts:34:32:34:52 | interac ... onParam | interaceFunctionParam | tst.ts:34:55:34:63 | Interface |
| tst.ts:36:27:36:32 | param1 | param1 | tst.ts:36:35:36:40 | number |
| tst.ts:36:47:36:52 | param2 | param2 | tst.ts:36:55:36:60 | string |
| tst.ts:38:5:38:13 | arrayType | arrayType | tst.ts:38:16:38:23 | string[] |
| tst.ts:39:5:39:14 | arrayType2 | arrayType2 | tst.ts:39:17:39:26 | string[][] |
| tst.ts:40:5:40:14 | arrayType3 | arrayType3 | tst.ts:40:17:40:28 | string[][][] |
| tst.ts:41:5:41:13 | unionType | unionType | tst.ts:41:16:41:36 | string\| ... boolean |
| tst.ts:42:5:42:15 | indexedType | indexedType | tst.ts:42:18:42:41 | Interfa ... Field'] |
| tst.ts:43:5:43:20 | intersectionType | intersectionType | tst.ts:43:23:43:43 | string& ... boolean |
| tst.ts:44:5:44:21 | parenthesizedType | parenthesizedType | tst.ts:44:24:44:31 | (string) |
| tst.ts:45:5:45:22 | parenthesizedType2 | parenthesizedType2 | tst.ts:45:25:45:34 | ((string)) |
| tst.ts:46:5:46:22 | parenthesizedType3 | parenthesizedType3 | tst.ts:46:25:46:36 | (((string))) |
| tst.ts:47:5:47:15 | complexType | complexType | tst.ts:47:18:47:55 | (string ... string) |
| tst.ts:48:5:48:13 | tupleType | tupleType | tst.ts:48:16:48:40 | [number ... oolean] |
| tst.ts:49:5:49:13 | keyofType | keyofType | tst.ts:49:16:49:30 | keyof Interface |
| tst.ts:63:5:63:16 | qualifiedVar | qualifiedVar | tst.ts:63:19:63:21 | N.I |
| tst.ts:64:5:64:17 | qualifiedVar2 | qualifiedVar2 | tst.ts:64:20:64:24 | N.M.I |
| tst.ts:65:5:65:15 | genericVar1 | genericVar1 | tst.ts:65:18:65:32 | Generic<number> |
| tst.ts:66:5:66:15 | genericVar2 | genericVar2 | tst.ts:66:18:66:40 | N.Inner ... number> |
| tst.ts:67:5:67:15 | genericVar3 | genericVar3 | tst.ts:67:18:67:42 | N.M.Inn ... number> |
| tst.ts:68:5:68:15 | genericVar4 | genericVar4 | tst.ts:68:18:68:49 | Generic ... umber>> |
| tst.ts:69:5:69:15 | genericVar5 | genericVar5 | tst.ts:69:18:69:54 | ManyTyp ... oolean> |
| tst.ts:70:5:70:14 | typeofVar1 | typeofVar1 | tst.ts:70:17:70:24 | typeof N |
| tst.ts:71:5:71:14 | typeofVar2 | typeofVar2 | tst.ts:71:17:71:26 | typeof N.x |
| tst.ts:72:5:72:14 | typeofVar3 | typeofVar3 | tst.ts:72:17:72:35 | typeof qualifiedVar |
| tst.ts:80:24:80:24 | x | x | tst.ts:80:27:80:32 | number |
| tst.ts:81:24:81:24 | x | x | tst.ts:81:27:81:34 | string[] |
| tst.ts:83:5:83:16 | interfaceVar | interfaceVar | tst.ts:83:19:83:43 | { x: nu ... mber; } |
| tst.ts:84:5:84:21 | emptyInterfaceVar | emptyInterfaceVar | tst.ts:84:24:84:25 | {} |
| tst.ts:85:5:85:22 | interfaceVarMethod | interfaceVarMethod | tst.ts:85:25:85:42 | { foo(): number; } |
| tst.ts:87:5:87:17 | functionType1 | functionType1 | tst.ts:87:20:87:31 | () => number |
| tst.ts:88:5:88:17 | functionType2 | functionType2 | tst.ts:88:20:88:44 | (param: ... number |
| tst.ts:88:21:88:25 | param | param | tst.ts:88:28:88:33 | string |
| tst.ts:89:5:89:17 | functionType3 | functionType3 | tst.ts:89:20:89:37 | <T>(param: T) => T |
| tst.ts:89:24:89:28 | param | param | tst.ts:89:31:89:31 | T |
| tst.ts:90:5:90:20 | constructorType1 | constructorType1 | tst.ts:90:23:90:38 | new () => Object |
| tst.ts:91:5:91:20 | constructorType2 | constructorType2 | tst.ts:91:23:91:51 | new (pa ... Object |
| tst.ts:91:28:91:32 | param | param | tst.ts:91:35:91:40 | string |
| tst.ts:92:5:92:20 | constructorType3 | constructorType3 | tst.ts:92:23:92:49 | new <T> ... Object |
| tst.ts:92:31:92:35 | param | param | tst.ts:92:38:92:38 | T |
| tst.ts:94:16:94:16 | x | x | tst.ts:94:19:94:19 | S |
| tst.ts:95:18:95:18 | x | x | tst.ts:95:21:95:21 | S |
| tst.ts:95:24:95:24 | y | y | tst.ts:95:27:95:27 | T |
| tst.ts:96:31:96:31 | x | x | tst.ts:96:34:96:34 | S |
| tst.ts:113:5:113:15 | mappedType1 | mappedType1 | tst.ts:113:18:113:46 | { [K in ... umber } |
| tst.ts:114:5:114:15 | mappedType2 | mappedType2 | tst.ts:114:18:114:41 | { [K in ... umber } |
| tst.ts:116:35:116:35 | x | x | tst.ts:116:38:116:43 | number |
| tst.ts:116:46:116:46 | y | y | tst.ts:116:49:116:54 | string |
| tst.ts:122:5:122:16 | importedType | importedType | tst.ts:122:19:122:32 | import("type") |
| tst.ts:123:5:123:23 | importedTypeGeneric | importedTypeGeneric | tst.ts:123:26:123:47 | import( ... string> |
| tst.ts:124:5:124:25 | importe ... iedType | importedQualifiedType | tst.ts:124:48:124:50 | Foo |
| tst.ts:125:5:125:32 | importe ... Generic | importedQualifiedTypeGeneric | tst.ts:125:35:125:65 | import( ... string> |
| tst.ts:126:5:126:18 | importedTypeof | importedTypeof | tst.ts:126:21:126:42 | typeof ... value") |
| tst.ts:127:5:127:27 | importe ... dTypeof | importedQualifiedTypeof | tst.ts:127:30:127:53 | typeof ... lue").x |
| tst.ts:128:5:128:35 | importe ... tespace | importedQualifiedTypeWhitespace | tst.ts:131:4:131:6 | bar |
| tst.ts:133:5:133:28 | tupleWi ... Element | tupleWithOptionalElement | tst.ts:133:31:133:55 | [number ... umber?] |
| tst.ts:134:5:134:14 | emptyTuple | emptyTuple | tst.ts:134:17:134:18 | [] |
| tst.ts:135:5:135:24 | tupleWithRestElement | tupleWithRestElement | tst.ts:135:27:135:47 | [number ... ring[]] |
| tst.ts:136:5:136:36 | tupleWi ... lements | tupleWithOptionalAndRestElements | tst.ts:136:39:136:68 | [number ... mber[]] |
| tst.ts:137:5:137:15 | unknownType | unknownType | tst.ts:137:18:137:24 | unknown |
test_QualifiedTypeAccess
| tst.ts:63:19:63:21 | N.I | tst.ts:63:19:63:19 | N | tst.ts:63:21:63:21 | I |
| tst.ts:64:20:64:24 | N.M.I | tst.ts:64:20:64:22 | N.M | tst.ts:64:24:64:24 | I |
| tst.ts:66:18:66:32 | N.InnerGeneric1 | tst.ts:66:18:66:18 | N | tst.ts:66:20:66:32 | InnerGeneric1 |
| tst.ts:67:18:67:34 | N.M.InnerGeneric2 | tst.ts:67:18:67:20 | N.M | tst.ts:67:22:67:34 | InnerGeneric2 |
| tst.ts:68:26:68:40 | N.InnerGeneric1 | tst.ts:68:26:68:26 | N | tst.ts:68:28:68:40 | InnerGeneric1 |
| tst.ts:124:48:124:50 | Foo | tst.ts:124:28:124:46 | import("namespace") | tst.ts:124:48:124:50 | Foo |
| tst.ts:125:55:125:57 | Foo | tst.ts:125:35:125:53 | import("namespace") | tst.ts:125:55:125:57 | Foo |
| tst.ts:131:4:131:6 | bar | tst.ts:128:38:130:3 | import( ... ce'\\n ) | tst.ts:131:4:131:6 | bar |
test_GenericTypeExpr
| tst.ts:65:18:65:32 | Generic<number> | tst.ts:65:18:65:24 | Generic | 0 | 1 | tst.ts:65:26:65:31 | number |
| tst.ts:66:18:66:40 | N.Inner ... number> | tst.ts:66:18:66:32 | N.InnerGeneric1 | 0 | 1 | tst.ts:66:34:66:39 | number |
| tst.ts:67:18:67:42 | N.M.Inn ... number> | tst.ts:67:18:67:34 | N.M.InnerGeneric2 | 0 | 1 | tst.ts:67:36:67:41 | number |
| tst.ts:68:18:68:49 | Generic ... umber>> | tst.ts:68:18:68:24 | Generic | 0 | 1 | tst.ts:68:26:68:48 | N.Inner ... number> |
| tst.ts:68:26:68:48 | N.Inner ... number> | tst.ts:68:26:68:40 | N.InnerGeneric1 | 0 | 1 | tst.ts:68:42:68:47 | number |
| tst.ts:69:18:69:54 | ManyTyp ... oolean> | tst.ts:69:18:69:29 | ManyTypeArgs | 0 | 3 | tst.ts:69:31:69:36 | number |
| tst.ts:69:18:69:54 | ManyTyp ... oolean> | tst.ts:69:18:69:29 | ManyTypeArgs | 1 | 3 | tst.ts:69:39:69:44 | string |
| tst.ts:69:18:69:54 | ManyTyp ... oolean> | tst.ts:69:18:69:29 | ManyTypeArgs | 2 | 3 | tst.ts:69:47:69:53 | boolean |
| tst.ts:80:41:80:55 | Generic<Leaf[]> | tst.ts:80:41:80:47 | Generic | 0 | 1 | tst.ts:80:49:80:54 | Leaf[] |
| tst.ts:123:26:123:47 | import( ... string> | tst.ts:123:26:123:39 | import("type") | 0 | 1 | tst.ts:123:41:123:46 | string |
| tst.ts:125:35:125:65 | import( ... string> | tst.ts:125:55:125:57 | Foo | 0 | 1 | tst.ts:125:59:125:64 | string |
test_IntersectionTypeExpr
| tst.ts:43:23:43:43 | string& ... boolean | 0 | 3 | tst.ts:43:23:43:28 | string |
| tst.ts:43:23:43:43 | string& ... boolean | 1 | 3 | tst.ts:43:30:43:35 | number |
| tst.ts:43:23:43:43 | string& ... boolean | 2 | 3 | tst.ts:43:37:43:43 | boolean |
| tst.ts:47:18:47:55 | (string ... string) | 0 | 2 | tst.ts:47:18:47:34 | (string \| number) |
| tst.ts:47:18:47:55 | (string ... string) | 1 | 2 | tst.ts:47:38:47:55 | (boolean \| string) |
test_FunctionTypeReturns
| tst.ts:87:20:87:31 | () => number | tst.ts:87:26:87:31 | number |
| tst.ts:88:20:88:44 | (param: ... number | tst.ts:88:39:88:44 | number |
| tst.ts:89:20:89:37 | <T>(param: T) => T | tst.ts:89:37:89:37 | T |
| tst.ts:90:23:90:38 | new () => Object | tst.ts:90:33:90:38 | Object |
| tst.ts:91:23:91:51 | new (pa ... Object | tst.ts:91:46:91:51 | Object |
| tst.ts:92:23:92:49 | new <T> ... Object | tst.ts:92:44:92:49 | Object |
test_InterfaceTypeExpr
| tst.ts:83:19:83:43 | { x: nu ... mber; } | tst.ts:83:21:83:30 | x: number; |
| tst.ts:83:19:83:43 | { x: nu ... mber; } | tst.ts:83:32:83:41 | y: number; |
| tst.ts:85:25:85:42 | { foo(): number; } | tst.ts:85:27:85:40 | foo(): number; |
test_IsTypeExpr
| tst.ts:75:17:75:28 | this is Leaf | tst.ts:75:17:75:20 | this | tst.ts:75:25:75:28 | Leaf |
| tst.ts:76:21:76:32 | that is Leaf | tst.ts:76:21:76:24 | that | tst.ts:76:29:76:32 | Leaf |
| tst.ts:80:36:80:55 | x is Generic<Leaf[]> | tst.ts:80:36:80:36 | x | tst.ts:80:41:80:55 | Generic<Leaf[]> |
| tst.ts:81:38:81:50 | x is typeof x | tst.ts:81:38:81:38 | x | tst.ts:81:43:81:50 | typeof x |
test_ThisParameterTypes
| function hasThisParam | tst.ts:116:29:116:32 | void |
test_ChildIndex
test_TypeArguments
| tst.ts:102:13:102:29 | f1<string>("foo") | 0 | 1 | tst.ts:102:16:102:21 | string |
| tst.ts:103:13:103:40 | f2<stri ... oo", 5) | 0 | 2 | tst.ts:103:16:103:21 | string |
| tst.ts:103:13:103:40 | f2<stri ... oo", 5) | 1 | 2 | tst.ts:103:24:103:29 | number |
| tst.ts:104:13:104:25 | f3<number>(5) | 0 | 1 | tst.ts:104:16:104:21 | number |
| tst.ts:106:12:106:27 | new C1<string>() | 0 | 1 | tst.ts:106:19:106:24 | string |
| tst.ts:107:12:107:35 | new C2< ... mber>() | 0 | 2 | tst.ts:107:19:107:24 | string |
| tst.ts:107:12:107:35 | new C2< ... mber>() | 1 | 2 | tst.ts:107:27:107:32 | number |
| tst.ts:108:12:108:27 | new C3<number>() | 0 | 1 | tst.ts:108:19:108:24 | number |
test_ParenthesizedTypeExpr
| tst.ts:44:24:44:31 | (string) | tst.ts:44:25:44:30 | string | tst.ts:44:25:44:30 | string |
| tst.ts:45:25:45:34 | ((string)) | tst.ts:45:26:45:33 | (string) | tst.ts:45:27:45:32 | string |
| tst.ts:45:26:45:33 | (string) | tst.ts:45:27:45:32 | string | tst.ts:45:27:45:32 | string |
| tst.ts:46:25:46:36 | (((string))) | tst.ts:46:26:46:35 | ((string)) | tst.ts:46:28:46:33 | string |
| tst.ts:46:26:46:35 | ((string)) | tst.ts:46:27:46:34 | (string) | tst.ts:46:28:46:33 | string |
| tst.ts:46:27:46:34 | (string) | tst.ts:46:28:46:33 | string | tst.ts:46:28:46:33 | string |
| tst.ts:47:18:47:34 | (string \| number) | tst.ts:47:19:47:33 | string \| number | tst.ts:47:19:47:33 | string \| number |
| tst.ts:47:38:47:55 | (boolean \| string) | tst.ts:47:39:47:54 | boolean \| string | tst.ts:47:39:47:54 | boolean \| string |
test_TupleTypeExpr
| tst.ts:48:16:48:40 | [number ... oolean] | 0 | 3 | tst.ts:48:17:48:22 | number |
| tst.ts:48:16:48:40 | [number ... oolean] | 1 | 3 | tst.ts:48:25:48:30 | string |
| tst.ts:48:16:48:40 | [number ... oolean] | 2 | 3 | tst.ts:48:33:48:39 | boolean |
| tst.ts:95:31:95:35 | [S,T] | 0 | 2 | tst.ts:95:32:95:32 | S |
| tst.ts:95:31:95:35 | [S,T] | 1 | 2 | tst.ts:95:34:95:34 | T |
| tst.ts:133:31:133:55 | [number ... umber?] | 0 | 3 | tst.ts:133:32:133:37 | number |
| tst.ts:133:31:133:55 | [number ... umber?] | 1 | 3 | tst.ts:133:40:133:45 | string |
| tst.ts:133:31:133:55 | [number ... umber?] | 2 | 3 | tst.ts:133:48:133:54 | number? |
| tst.ts:135:27:135:47 | [number ... ring[]] | 0 | 2 | tst.ts:135:28:135:33 | number |
| tst.ts:135:27:135:47 | [number ... ring[]] | 1 | 2 | tst.ts:135:36:135:46 | ...string[] |
| tst.ts:136:39:136:68 | [number ... mber[]] | 0 | 3 | tst.ts:136:40:136:45 | number |
| tst.ts:136:39:136:68 | [number ... mber[]] | 1 | 3 | tst.ts:136:48:136:54 | string? |
| tst.ts:136:39:136:68 | [number ... mber[]] | 2 | 3 | tst.ts:136:57:136:67 | ...number[] |
test_FieldTypes
| tst.ts:15:3:15:22 | numberField: number; | tst.ts:15:16:15:21 | number |
| tst.ts:16:3:16:22 | stringField: string; | tst.ts:16:16:16:21 | string |
| tst.ts:17:3:17:28 | interfa ... erface; | tst.ts:17:19:17:27 | Interface |
| tst.ts:18:3:18:18 | thisField: this; | tst.ts:18:14:18:17 | this |
| tst.ts:83:21:83:30 | x: number; | tst.ts:83:24:83:29 | number |
| tst.ts:83:32:83:41 | y: number; | tst.ts:83:35:83:40 | number |
test_Parameters
| tst.ts:36:27:36:32 | param1 | tst.ts:36:44:36:44 | 1 | tst.ts:36:35:36:40 | number |
| tst.ts:36:47:36:52 | param2 | tst.ts:36:64:36:66 | '2' | tst.ts:36:55:36:60 | string |
test_ArrayTypeExpr
| tst.ts:38:16:38:23 | string[] | tst.ts:38:16:38:21 | string |
| tst.ts:39:17:39:24 | string[] | tst.ts:39:17:39:22 | string |
| tst.ts:39:17:39:26 | string[][] | tst.ts:39:17:39:24 | string[] |
| tst.ts:40:17:40:24 | string[] | tst.ts:40:17:40:22 | string |
| tst.ts:40:17:40:26 | string[][] | tst.ts:40:17:40:24 | string[] |
| tst.ts:40:17:40:28 | string[][][] | tst.ts:40:17:40:26 | string[][] |
| tst.ts:80:49:80:54 | Leaf[] | tst.ts:80:49:80:52 | Leaf |
| tst.ts:81:27:81:34 | string[] | tst.ts:81:27:81:32 | string |
| tst.ts:135:39:135:46 | string[] | tst.ts:135:39:135:44 | string |
| tst.ts:136:60:136:67 | number[] | tst.ts:136:60:136:65 | number |
test_TypeAccessHelpers
| tst.ts:65:18:65:24 | Generic | 1 | 0 | tst.ts:65:26:65:31 | number |
| tst.ts:66:18:66:32 | N.InnerGeneric1 | 1 | 0 | tst.ts:66:34:66:39 | number |
| tst.ts:67:18:67:34 | N.M.InnerGeneric2 | 1 | 0 | tst.ts:67:36:67:41 | number |
| tst.ts:68:18:68:24 | Generic | 1 | 0 | tst.ts:68:26:68:48 | N.Inner ... number> |
| tst.ts:68:26:68:40 | N.InnerGeneric1 | 1 | 0 | tst.ts:68:42:68:47 | number |
| tst.ts:69:18:69:29 | ManyTypeArgs | 3 | 0 | tst.ts:69:31:69:36 | number |
| tst.ts:69:18:69:29 | ManyTypeArgs | 3 | 1 | tst.ts:69:39:69:44 | string |
| tst.ts:69:18:69:29 | ManyTypeArgs | 3 | 2 | tst.ts:69:47:69:53 | boolean |
| tst.ts:80:41:80:47 | Generic | 1 | 0 | tst.ts:80:49:80:54 | Leaf[] |
| tst.ts:123:26:123:39 | import("type") | 1 | 0 | tst.ts:123:41:123:46 | string |
| tst.ts:125:55:125:57 | Foo | 1 | 0 | tst.ts:125:59:125:64 | string |
test_TypeAssertions
| tst.ts:110:14:110:24 | 5 as number | tst.ts:110:14:110:14 | 5 | tst.ts:110:19:110:24 | number |
| tst.ts:111:18:111:31 | <string> 'foo' | tst.ts:111:27:111:31 | 'foo' | tst.ts:111:19:111:24 | string |
test_UnionTypeExpr
| tst.ts:41:16:41:36 | string\| ... boolean | 0 | 3 | tst.ts:41:16:41:21 | string |
| tst.ts:41:16:41:36 | string\| ... boolean | 1 | 3 | tst.ts:41:23:41:28 | number |
| tst.ts:41:16:41:36 | string\| ... boolean | 2 | 3 | tst.ts:41:30:41:36 | boolean |
| tst.ts:47:19:47:33 | string \| number | 0 | 2 | tst.ts:47:19:47:24 | string |
| tst.ts:47:19:47:33 | string \| number | 1 | 2 | tst.ts:47:28:47:33 | number |
| tst.ts:47:39:47:54 | boolean \| string | 0 | 2 | tst.ts:47:39:47:45 | boolean |
| tst.ts:47:39:47:54 | boolean \| string | 1 | 2 | tst.ts:47:49:47:54 | string |
test_RestTypeExpr
| tst.ts:135:36:135:46 | ...string[] | tst.ts:135:39:135:46 | string[] | tst.ts:135:39:135:44 | string |
| tst.ts:136:57:136:67 | ...number[] | tst.ts:136:60:136:67 | number[] | tst.ts:136:60:136:65 | number |
test_Containers
test_ReturnTypes
| tst.ts:20:3:20:31 | returnN ... number; | method returnNumberMethod of interface Interface | tst.ts:20:25:20:30 | number |
| tst.ts:21:3:21:27 | returnV ... : void; | method returnVoidMethod of interface Interface | tst.ts:21:23:21:26 | void |
| tst.ts:22:3:22:27 | returnN ... : null; | method returnNullMethod of interface Interface | tst.ts:22:23:22:26 | null |
| tst.ts:23:3:23:27 | returnT ... : this; | method returnThisMethod of interface Interface | tst.ts:23:23:23:26 | this |
| tst.ts:30:1:30:53 | functio ... rn 0; } | function returnNumberFunction | tst.ts:30:34:30:39 | number |
| tst.ts:31:1:31:49 | functio ... rn 0; } | function returnVoidFunction | tst.ts:31:32:31:35 | void |
| tst.ts:32:1:32:49 | functio ... rn 0; } | function returnNullFunction | tst.ts:32:32:32:35 | null |
| tst.ts:75:3:75:29 | isThisL ... s Leaf; | method isThisLeaf of interface Node | tst.ts:75:17:75:28 | this is Leaf |
| tst.ts:76:3:76:33 | isThatL ... s Leaf; | method isThatLeaf of interface Node | tst.ts:76:21:76:32 | that is Leaf |
| tst.ts:80:1:80:73 | functio ... alse; } | function complexIsType | tst.ts:80:36:80:55 | x is Generic<Leaf[]> |
| tst.ts:81:1:81:66 | functio ... true } | function obviousIsType | tst.ts:81:38:81:50 | x is typeof x |
| tst.ts:85:27:85:40 | foo(): number; | method foo of anonymous interface | tst.ts:85:34:85:39 | number |
| tst.ts:87:20:87:31 | () => number | anonymous function type | tst.ts:87:26:87:31 | number |
| tst.ts:88:20:88:44 | (param: ... number | anonymous function type | tst.ts:88:39:88:44 | number |
| tst.ts:89:20:89:37 | <T>(param: T) => T | anonymous function type | tst.ts:89:37:89:37 | T |
| tst.ts:90:23:90:38 | new () => Object | anonymous function type | tst.ts:90:33:90:38 | Object |
| tst.ts:91:23:91:51 | new (pa ... Object | anonymous function type | tst.ts:91:46:91:51 | Object |
| tst.ts:92:23:92:49 | new <T> ... Object | anonymous function type | tst.ts:92:44:92:49 | Object |
| tst.ts:94:1:94:37 | functio ... rn x; } | function f1 | tst.ts:94:23:94:23 | S |
| tst.ts:95:1:95:53 | functio ... x,y]; } | function f2 | tst.ts:95:31:95:35 | [S,T] |
| tst.ts:96:1:96:52 | functio ... rn x; } | function f3 | tst.ts:96:38:96:38 | S |
test_KeyofTypeExpr
| tst.ts:49:16:49:30 | keyof Interface | tst.ts:49:22:49:30 | Interface |
| tst.ts:113:26:113:35 | keyof Node | tst.ts:113:32:113:35 | Node |

View File

@@ -0,0 +1,29 @@
import TypeofTypeExpr
import FunctionTypeParameters
import IndexedAccessTypeExpr
import UnknownTypeExpr
import MappedTypeExpr
import ImportTypeExpr
import OptionalTypeExpr
import VariableTypes
import QualifiedTypeAccess
import GenericTypeExpr
import IntersectionTypeExpr
import FunctionTypeReturns
import InterfaceTypeExpr
import IsTypeExpr
import ThisParameterTypes
import ChildIndex
import TypeArguments
import ParenthesizedTypeExpr
import TupleTypeExpr
import FieldTypes
import Parameters
import ArrayTypeExpr
import TypeAccessHelpers
import TypeAssertions
import UnionTypeExpr
import RestTypeExpr
import Containers
import ReturnTypes
import KeyofTypeExpr