From 3b206e11a7e6bec44c6c721b6a31ac0fc60ea120 Mon Sep 17 00:00:00 2001 From: liuxingbaoyu <30521560+liuxingbaoyu@users.noreply.github.com> Date: Mon, 6 Jun 2022 01:48:33 +0800 Subject: [PATCH] Enable test `variance-annotations-with-jsx` with babel8 (#14626) --- .../input.tsx | 94 + .../options.json | 4 + .../output.js | 78 + .../options.json | 11 +- .../input.tsx | 163 + .../options.json | 7 + .../output.json | 4039 +++++++++++++++++ .../options.json | 7 +- .../variance-annotations-with-jsx/output.json | 271 +- 9 files changed, 4613 insertions(+), 61 deletions(-) create mode 100644 packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx-babel-7/input.tsx create mode 100644 packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx-babel-7/options.json create mode 100644 packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx-babel-7/output.js create mode 100644 packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-babel-7/input.tsx create mode 100644 packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-babel-7/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-babel-7/output.json diff --git a/packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx-babel-7/input.tsx b/packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx-babel-7/input.tsx new file mode 100644 index 000000000000..d0f89c1c2cf6 --- /dev/null +++ b/packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx-babel-7/input.tsx @@ -0,0 +1,94 @@ +// valid JSX +() => {}; + +type Covariant = { + x: T; +} + +declare let super_covariant: Covariant; +declare let sub_covariant: Covariant; + +super_covariant = sub_covariant; +sub_covariant = super_covariant; // Error + +type Contravariant = { + f: (x: T) => void; +} + +declare let super_contravariant: Contravariant; +declare let sub_contravariant: Contravariant; + +super_contravariant = sub_contravariant; // Error +sub_contravariant = super_contravariant; + +type Invariant = { + f: (x: T) => T; +} + +declare let super_invariant: Invariant; +declare let sub_invariant: Invariant; + +super_invariant = sub_invariant; // Error +sub_invariant = super_invariant; // Error + +// Variance of various type constructors + +type T10 = T; +type T11 = keyof T; +type T12 = T[K]; +type T13 = T[keyof T]; + +// Variance annotation errors + +type Covariant1 = { // Error + x: T; +} + +type Contravariant1 = keyof T; // Error + +type Contravariant2 = { // Error + f: (x: T) => void; +} + +type Invariant1 = { // Error + f: (x: T) => T; +} + +type Invariant2 = { // Error + f: (x: T) => T; +} + +// Variance in circular types + +type Foo1 = { // Error + x: T; + f: FooFn1; +} + +type FooFn1 = (foo: Bar1) => void; + +type Bar1 = { + value: Foo1; +} + +type Foo2 = { // Error + x: T; + f: FooFn2; +} + +type FooFn2 = (foo: Bar2) => void; + +type Bar2 = { + value: Foo2; +} + +type Foo3 = { + x: T; + f: FooFn3; +} + +type FooFn3 = (foo: Bar3) => void; + +type Bar3 = { + value: Foo3; +} diff --git a/packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx-babel-7/options.json b/packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx-babel-7/options.json new file mode 100644 index 000000000000..dd8a3a5c8749 --- /dev/null +++ b/packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx-babel-7/options.json @@ -0,0 +1,4 @@ +{ + "BABEL_8_BREAKING": false, + "plugins": ["jsx", "typescript"] +} diff --git a/packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx-babel-7/output.js b/packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx-babel-7/output.js new file mode 100644 index 000000000000..762be81ca726 --- /dev/null +++ b/packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx-babel-7/output.js @@ -0,0 +1,78 @@ +// valid JSX +() => {}; +type Covariant = { + x: T; +}; +declare let super_covariant: Covariant; +declare let sub_covariant: Covariant; +super_covariant = sub_covariant; +sub_covariant = super_covariant; // Error + +type Contravariant = { + f: (x: T) => void; +}; +declare let super_contravariant: Contravariant; +declare let sub_contravariant: Contravariant; +super_contravariant = sub_contravariant; // Error + +sub_contravariant = super_contravariant; +type Invariant = { + f: (x: T) => T; +}; +declare let super_invariant: Invariant; +declare let sub_invariant: Invariant; +super_invariant = sub_invariant; // Error + +sub_invariant = super_invariant; // Error +// Variance of various type constructors + +type T10 = T; +type T11 = keyof T; +type T12 = T[K]; +type T13 = T[keyof T]; // Variance annotation errors + +type Covariant1 = { + // Error + x: T; +}; +type Contravariant1 = keyof T; // Error + +type Contravariant2 = { + // Error + f: (x: T) => void; +}; +type Invariant1 = { + // Error + f: (x: T) => T; +}; +type Invariant2 = { + // Error + f: (x: T) => T; +}; // Variance in circular types + +type Foo1 = { + // Error + x: T; + f: FooFn1; +}; +type FooFn1 = (foo: Bar1) => void; +type Bar1 = { + value: Foo1; +}; +type Foo2 = { + // Error + x: T; + f: FooFn2; +}; +type FooFn2 = (foo: Bar2) => void; +type Bar2 = { + value: Foo2; +}; +type Foo3 = { + x: T; + f: FooFn3; +}; +type FooFn3 = (foo: Bar3) => void; +type Bar3 = { + value: Foo3; +}; \ No newline at end of file diff --git a/packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx/options.json b/packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx/options.json index dd8a3a5c8749..d4e9ce70fe84 100644 --- a/packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx/options.json +++ b/packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx/options.json @@ -1,4 +1,11 @@ { - "BABEL_8_BREAKING": false, - "plugins": ["jsx", "typescript"] + "BABEL_8_BREAKING": true, + "plugins": [ + "jsx", + "typescript" + ], + "parserOpts": { + "errorRecovery": true + }, + "throwMsg": true } diff --git a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-babel-7/input.tsx b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-babel-7/input.tsx new file mode 100644 index 000000000000..311e850b6319 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-babel-7/input.tsx @@ -0,0 +1,163 @@ +// valid JSX +() => {}; + +type Covariant = { + x: T; +} + +declare let super_covariant: Covariant; +declare let sub_covariant: Covariant; + +super_covariant = sub_covariant; +sub_covariant = super_covariant; // Error + +type Contravariant = { + f: (x: T) => void; +} + +declare let super_contravariant: Contravariant; +declare let sub_contravariant: Contravariant; + +super_contravariant = sub_contravariant; // Error +sub_contravariant = super_contravariant; + +type Invariant = { + f: (x: T) => T; +} + +declare let super_invariant: Invariant; +declare let sub_invariant: Invariant; + +super_invariant = sub_invariant; // Error +sub_invariant = super_invariant; // Error + +// Variance of various type constructors + +type T10 = T; +type T11 = keyof T; +type T12 = T[K]; +type T13 = T[keyof T]; + +// Variance annotation errors + +type Covariant1 = { // Error + x: T; +} + +type Contravariant1 = keyof T; // Error + +type Contravariant2 = { // Error + f: (x: T) => void; +} + +type Invariant1 = { // Error + f: (x: T) => T; +} + +type Invariant2 = { // Error + f: (x: T) => T; +} + +// Variance in circular types + +type Foo1 = { // Error + x: T; + f: FooFn1; +} + +type FooFn1 = (foo: Bar1) => void; + +type Bar1 = { + value: Foo1; +} + +type Foo2 = { // Error + x: T; + f: FooFn2; +} + +type FooFn2 = (foo: Bar2) => void; + +type Bar2 = { + value: Foo2; +} + +type Foo3 = { + x: T; + f: FooFn3; +} + +type FooFn3 = (foo: Bar3) => void; + +type Bar3 = { + value: Foo3; +} + +// Wrong modifier usage + +type T20 = T; // Error +type T21 = T; // Error +type T22 = T; // Error +type T23 = T; // Error + +declare function f1(x: T): void; // Error +declare function f2(): T; // Error + +class C { + in a = 0; // Error + out b = 0; // Error +} + +// Interface merging + +interface Baz {} +interface Baz {} + +declare let baz1: Baz; +declare let baz2: Baz; + +baz1 = baz2; // Error +baz2 = baz1; // Error + +// Repro from #44572 + +interface Parent { + child: Child | null; + parent: Parent | null; +} + +interface Child extends Parent { + readonly a: A; + readonly b: B; +} + +function fn(inp: Child) { + const a: Child = inp; +} + +const pu: Parent = { child: { a: 0, b: 0, child: null, parent: null }, parent: null }; +const notString: Parent = pu; // Error + +// Repro from comment in #44572 + +declare class StateNode { + _storedEvent: TEvent; + _action: ActionObject; + _state: StateNode; +} + +interface ActionObject { + exec: (meta: StateNode) => void; +} + +declare function createMachine(action: ActionObject): StateNode; + +declare function interpret(machine: StateNode): void; + +const machine = createMachine({} as any); + +interpret(machine); + +declare const qq: ActionObject<{ type: "PLAY"; value: number }>; + +createMachine<{ type: "PLAY"; value: number } | { type: "RESET" }>(qq); // Error diff --git a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-babel-7/options.json b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-babel-7/options.json new file mode 100644 index 000000000000..9dee07118349 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-babel-7/options.json @@ -0,0 +1,7 @@ +{ + "BABEL_8_BREAKING": false, + "plugins": [ + "jsx", + "typescript" + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-babel-7/output.json b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-babel-7/output.json new file mode 100644 index 000000000000..1c4773d8258a --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-babel-7/output.json @@ -0,0 +1,4039 @@ +{ + "type": "File", + "start":0,"end":3346,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":163,"column":81,"index":3346}}, + "errors": [ + "SyntaxError: 'public' modifier cannot appear on a type parameter. (98:9)", + "SyntaxError: Duplicate modifier: 'in'. (99:16)", + "SyntaxError: 'in' modifier must precede 'out' modifier. (99:16)", + "SyntaxError: Duplicate modifier: 'out'. (100:16)", + "SyntaxError: 'in' modifier must precede 'out' modifier. (101:13)", + "SyntaxError: 'in' modifier can only appear on a type parameter of a class, interface or type alias. (103:20)", + "SyntaxError: 'out' modifier can only appear on a type parameter of a class, interface or type alias. (104:20)", + "SyntaxError: 'in' modifier can only appear on a type parameter of a class, interface or type alias. (107:4)", + "SyntaxError: 'out' modifier can only appear on a type parameter of a class, interface or type alias. (108:4)" + ], + "program": { + "type": "Program", + "start":0,"end":3346,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":163,"column":81,"index":3346}}, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start":13,"end":33,"loc":{"start":{"line":2,"column":0,"index":13},"end":{"line":2,"column":20,"index":33}}, + "expression": { + "type": "JSXElement", + "start":13,"end":32,"loc":{"start":{"line":2,"column":0,"index":13},"end":{"line":2,"column":19,"index":32}}, + "openingElement": { + "type": "JSXOpeningElement", + "start":13,"end":19,"loc":{"start":{"line":2,"column":0,"index":13},"end":{"line":2,"column":6,"index":19}}, + "name": { + "type": "JSXIdentifier", + "start":14,"end":16,"loc":{"start":{"line":2,"column":1,"index":14},"end":{"line":2,"column":3,"index":16}}, + "name": "in" + }, + "attributes": [ + { + "type": "JSXAttribute", + "start":17,"end":18,"loc":{"start":{"line":2,"column":4,"index":17},"end":{"line":2,"column":5,"index":18}}, + "name": { + "type": "JSXIdentifier", + "start":17,"end":18,"loc":{"start":{"line":2,"column":4,"index":17},"end":{"line":2,"column":5,"index":18}}, + "name": "T" + }, + "value": null + } + ], + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start":27,"end":32,"loc":{"start":{"line":2,"column":14,"index":27},"end":{"line":2,"column":19,"index":32}}, + "name": { + "type": "JSXIdentifier", + "start":29,"end":31,"loc":{"start":{"line":2,"column":16,"index":29},"end":{"line":2,"column":18,"index":31}}, + "name": "in" + } + }, + "children": [ + { + "type": "JSXText", + "start":19,"end":25,"loc":{"start":{"line":2,"column":6,"index":19},"end":{"line":2,"column":12,"index":25}}, + "extra": { + "rawValue": "() => ", + "raw": "() => " + }, + "value": "() => " + }, + { + "type": "JSXExpressionContainer", + "start":25,"end":27,"loc":{"start":{"line":2,"column":12,"index":25},"end":{"line":2,"column":14,"index":27}}, + "expression": { + "type": "JSXEmptyExpression", + "start":26,"end":26,"loc":{"start":{"line":2,"column":13,"index":26},"end":{"line":2,"column":13,"index":26}} + } + } + ] + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " valid JSX", + "start":0,"end":12,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":12,"index":12}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":35,"end":72,"loc":{"start":{"line":4,"column":0,"index":35},"end":{"line":6,"column":1,"index":72}}, + "id": { + "type": "Identifier", + "start":40,"end":49,"loc":{"start":{"line":4,"column":5,"index":40},"end":{"line":4,"column":14,"index":49},"identifierName":"Covariant"}, + "name": "Covariant" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":49,"end":56,"loc":{"start":{"line":4,"column":14,"index":49},"end":{"line":4,"column":21,"index":56}}, + "params": [ + { + "type": "TSTypeParameter", + "start":50,"end":55,"loc":{"start":{"line":4,"column":15,"index":50},"end":{"line":4,"column":20,"index":55}}, + "out": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":59,"end":72,"loc":{"start":{"line":4,"column":24,"index":59},"end":{"line":6,"column":1,"index":72}}, + "members": [ + { + "type": "TSPropertySignature", + "start":65,"end":70,"loc":{"start":{"line":5,"column":4,"index":65},"end":{"line":5,"column":9,"index":70}}, + "key": { + "type": "Identifier", + "start":65,"end":66,"loc":{"start":{"line":5,"column":4,"index":65},"end":{"line":5,"column":5,"index":66},"identifierName":"x"}, + "name": "x" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":66,"end":69,"loc":{"start":{"line":5,"column":5,"index":66},"end":{"line":5,"column":8,"index":69}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":68,"end":69,"loc":{"start":{"line":5,"column":7,"index":68},"end":{"line":5,"column":8,"index":69}}, + "typeName": { + "type": "Identifier", + "start":68,"end":69,"loc":{"start":{"line":5,"column":7,"index":68},"end":{"line":5,"column":8,"index":69},"identifierName":"T"}, + "name": "T" + } + } + } + } + ] + } + }, + { + "type": "VariableDeclaration", + "start":74,"end":122,"loc":{"start":{"line":8,"column":0,"index":74},"end":{"line":8,"column":48,"index":122}}, + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "start":86,"end":121,"loc":{"start":{"line":8,"column":12,"index":86},"end":{"line":8,"column":47,"index":121}}, + "id": { + "type": "Identifier", + "start":86,"end":121,"loc":{"start":{"line":8,"column":12,"index":86},"end":{"line":8,"column":47,"index":121},"identifierName":"super_covariant"}, + "name": "super_covariant", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":101,"end":121,"loc":{"start":{"line":8,"column":27,"index":101},"end":{"line":8,"column":47,"index":121}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":103,"end":121,"loc":{"start":{"line":8,"column":29,"index":103},"end":{"line":8,"column":47,"index":121}}, + "typeName": { + "type": "Identifier", + "start":103,"end":112,"loc":{"start":{"line":8,"column":29,"index":103},"end":{"line":8,"column":38,"index":112},"identifierName":"Covariant"}, + "name": "Covariant" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":112,"end":121,"loc":{"start":{"line":8,"column":38,"index":112},"end":{"line":8,"column":47,"index":121}}, + "params": [ + { + "type": "TSUnknownKeyword", + "start":113,"end":120,"loc":{"start":{"line":8,"column":39,"index":113},"end":{"line":8,"column":46,"index":120}} + } + ] + } + } + } + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "VariableDeclaration", + "start":123,"end":168,"loc":{"start":{"line":9,"column":0,"index":123},"end":{"line":9,"column":45,"index":168}}, + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "start":135,"end":167,"loc":{"start":{"line":9,"column":12,"index":135},"end":{"line":9,"column":44,"index":167}}, + "id": { + "type": "Identifier", + "start":135,"end":167,"loc":{"start":{"line":9,"column":12,"index":135},"end":{"line":9,"column":44,"index":167},"identifierName":"sub_covariant"}, + "name": "sub_covariant", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":148,"end":167,"loc":{"start":{"line":9,"column":25,"index":148},"end":{"line":9,"column":44,"index":167}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":150,"end":167,"loc":{"start":{"line":9,"column":27,"index":150},"end":{"line":9,"column":44,"index":167}}, + "typeName": { + "type": "Identifier", + "start":150,"end":159,"loc":{"start":{"line":9,"column":27,"index":150},"end":{"line":9,"column":36,"index":159},"identifierName":"Covariant"}, + "name": "Covariant" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":159,"end":167,"loc":{"start":{"line":9,"column":36,"index":159},"end":{"line":9,"column":44,"index":167}}, + "params": [ + { + "type": "TSStringKeyword", + "start":160,"end":166,"loc":{"start":{"line":9,"column":37,"index":160},"end":{"line":9,"column":43,"index":166}} + } + ] + } + } + } + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "ExpressionStatement", + "start":170,"end":202,"loc":{"start":{"line":11,"column":0,"index":170},"end":{"line":11,"column":32,"index":202}}, + "expression": { + "type": "AssignmentExpression", + "start":170,"end":201,"loc":{"start":{"line":11,"column":0,"index":170},"end":{"line":11,"column":31,"index":201}}, + "operator": "=", + "left": { + "type": "Identifier", + "start":170,"end":185,"loc":{"start":{"line":11,"column":0,"index":170},"end":{"line":11,"column":15,"index":185},"identifierName":"super_covariant"}, + "name": "super_covariant" + }, + "right": { + "type": "Identifier", + "start":188,"end":201,"loc":{"start":{"line":11,"column":18,"index":188},"end":{"line":11,"column":31,"index":201},"identifierName":"sub_covariant"}, + "name": "sub_covariant" + } + } + }, + { + "type": "ExpressionStatement", + "start":203,"end":235,"loc":{"start":{"line":12,"column":0,"index":203},"end":{"line":12,"column":32,"index":235}}, + "expression": { + "type": "AssignmentExpression", + "start":203,"end":234,"loc":{"start":{"line":12,"column":0,"index":203},"end":{"line":12,"column":31,"index":234}}, + "operator": "=", + "left": { + "type": "Identifier", + "start":203,"end":216,"loc":{"start":{"line":12,"column":0,"index":203},"end":{"line":12,"column":13,"index":216},"identifierName":"sub_covariant"}, + "name": "sub_covariant" + }, + "right": { + "type": "Identifier", + "start":219,"end":234,"loc":{"start":{"line":12,"column":16,"index":219},"end":{"line":12,"column":31,"index":234},"identifierName":"super_covariant"}, + "name": "super_covariant" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":237,"end":245,"loc":{"start":{"line":12,"column":34,"index":237},"end":{"line":12,"column":42,"index":245}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":247,"end":300,"loc":{"start":{"line":14,"column":0,"index":247},"end":{"line":16,"column":1,"index":300}}, + "id": { + "type": "Identifier", + "start":252,"end":265,"loc":{"start":{"line":14,"column":5,"index":252},"end":{"line":14,"column":18,"index":265},"identifierName":"Contravariant"}, + "name": "Contravariant" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":265,"end":271,"loc":{"start":{"line":14,"column":18,"index":265},"end":{"line":14,"column":24,"index":271}}, + "params": [ + { + "type": "TSTypeParameter", + "start":266,"end":270,"loc":{"start":{"line":14,"column":19,"index":266},"end":{"line":14,"column":23,"index":270}}, + "in": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":274,"end":300,"loc":{"start":{"line":14,"column":27,"index":274},"end":{"line":16,"column":1,"index":300}}, + "members": [ + { + "type": "TSPropertySignature", + "start":280,"end":298,"loc":{"start":{"line":15,"column":4,"index":280},"end":{"line":15,"column":22,"index":298}}, + "key": { + "type": "Identifier", + "start":280,"end":281,"loc":{"start":{"line":15,"column":4,"index":280},"end":{"line":15,"column":5,"index":281},"identifierName":"f"}, + "name": "f" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":281,"end":297,"loc":{"start":{"line":15,"column":5,"index":281},"end":{"line":15,"column":21,"index":297}}, + "typeAnnotation": { + "type": "TSFunctionType", + "start":283,"end":297,"loc":{"start":{"line":15,"column":7,"index":283},"end":{"line":15,"column":21,"index":297}}, + "parameters": [ + { + "type": "Identifier", + "start":284,"end":288,"loc":{"start":{"line":15,"column":8,"index":284},"end":{"line":15,"column":12,"index":288},"identifierName":"x"}, + "name": "x", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":285,"end":288,"loc":{"start":{"line":15,"column":9,"index":285},"end":{"line":15,"column":12,"index":288}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":287,"end":288,"loc":{"start":{"line":15,"column":11,"index":287},"end":{"line":15,"column":12,"index":288}}, + "typeName": { + "type": "Identifier", + "start":287,"end":288,"loc":{"start":{"line":15,"column":11,"index":287},"end":{"line":15,"column":12,"index":288},"identifierName":"T"}, + "name": "T" + } + } + } + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":290,"end":297,"loc":{"start":{"line":15,"column":14,"index":290},"end":{"line":15,"column":21,"index":297}}, + "typeAnnotation": { + "type": "TSVoidKeyword", + "start":293,"end":297,"loc":{"start":{"line":15,"column":17,"index":293},"end":{"line":15,"column":21,"index":297}} + } + } + } + } + } + ] + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":237,"end":245,"loc":{"start":{"line":12,"column":34,"index":237},"end":{"line":12,"column":42,"index":245}} + } + ] + }, + { + "type": "VariableDeclaration", + "start":302,"end":358,"loc":{"start":{"line":18,"column":0,"index":302},"end":{"line":18,"column":56,"index":358}}, + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "start":314,"end":357,"loc":{"start":{"line":18,"column":12,"index":314},"end":{"line":18,"column":55,"index":357}}, + "id": { + "type": "Identifier", + "start":314,"end":357,"loc":{"start":{"line":18,"column":12,"index":314},"end":{"line":18,"column":55,"index":357},"identifierName":"super_contravariant"}, + "name": "super_contravariant", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":333,"end":357,"loc":{"start":{"line":18,"column":31,"index":333},"end":{"line":18,"column":55,"index":357}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":335,"end":357,"loc":{"start":{"line":18,"column":33,"index":335},"end":{"line":18,"column":55,"index":357}}, + "typeName": { + "type": "Identifier", + "start":335,"end":348,"loc":{"start":{"line":18,"column":33,"index":335},"end":{"line":18,"column":46,"index":348},"identifierName":"Contravariant"}, + "name": "Contravariant" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":348,"end":357,"loc":{"start":{"line":18,"column":46,"index":348},"end":{"line":18,"column":55,"index":357}}, + "params": [ + { + "type": "TSUnknownKeyword", + "start":349,"end":356,"loc":{"start":{"line":18,"column":47,"index":349},"end":{"line":18,"column":54,"index":356}} + } + ] + } + } + } + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "VariableDeclaration", + "start":359,"end":412,"loc":{"start":{"line":19,"column":0,"index":359},"end":{"line":19,"column":53,"index":412}}, + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "start":371,"end":411,"loc":{"start":{"line":19,"column":12,"index":371},"end":{"line":19,"column":52,"index":411}}, + "id": { + "type": "Identifier", + "start":371,"end":411,"loc":{"start":{"line":19,"column":12,"index":371},"end":{"line":19,"column":52,"index":411},"identifierName":"sub_contravariant"}, + "name": "sub_contravariant", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":388,"end":411,"loc":{"start":{"line":19,"column":29,"index":388},"end":{"line":19,"column":52,"index":411}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":390,"end":411,"loc":{"start":{"line":19,"column":31,"index":390},"end":{"line":19,"column":52,"index":411}}, + "typeName": { + "type": "Identifier", + "start":390,"end":403,"loc":{"start":{"line":19,"column":31,"index":390},"end":{"line":19,"column":44,"index":403},"identifierName":"Contravariant"}, + "name": "Contravariant" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":403,"end":411,"loc":{"start":{"line":19,"column":44,"index":403},"end":{"line":19,"column":52,"index":411}}, + "params": [ + { + "type": "TSStringKeyword", + "start":404,"end":410,"loc":{"start":{"line":19,"column":45,"index":404},"end":{"line":19,"column":51,"index":410}} + } + ] + } + } + } + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "ExpressionStatement", + "start":414,"end":454,"loc":{"start":{"line":21,"column":0,"index":414},"end":{"line":21,"column":40,"index":454}}, + "expression": { + "type": "AssignmentExpression", + "start":414,"end":453,"loc":{"start":{"line":21,"column":0,"index":414},"end":{"line":21,"column":39,"index":453}}, + "operator": "=", + "left": { + "type": "Identifier", + "start":414,"end":433,"loc":{"start":{"line":21,"column":0,"index":414},"end":{"line":21,"column":19,"index":433},"identifierName":"super_contravariant"}, + "name": "super_contravariant" + }, + "right": { + "type": "Identifier", + "start":436,"end":453,"loc":{"start":{"line":21,"column":22,"index":436},"end":{"line":21,"column":39,"index":453},"identifierName":"sub_contravariant"}, + "name": "sub_contravariant" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":456,"end":464,"loc":{"start":{"line":21,"column":42,"index":456},"end":{"line":21,"column":50,"index":464}} + } + ] + }, + { + "type": "ExpressionStatement", + "start":465,"end":505,"loc":{"start":{"line":22,"column":0,"index":465},"end":{"line":22,"column":40,"index":505}}, + "expression": { + "type": "AssignmentExpression", + "start":465,"end":504,"loc":{"start":{"line":22,"column":0,"index":465},"end":{"line":22,"column":39,"index":504}}, + "operator": "=", + "left": { + "type": "Identifier", + "start":465,"end":482,"loc":{"start":{"line":22,"column":0,"index":465},"end":{"line":22,"column":17,"index":482},"identifierName":"sub_contravariant"}, + "name": "sub_contravariant" + }, + "right": { + "type": "Identifier", + "start":485,"end":504,"loc":{"start":{"line":22,"column":20,"index":485},"end":{"line":22,"column":39,"index":504},"identifierName":"super_contravariant"}, + "name": "super_contravariant" + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":456,"end":464,"loc":{"start":{"line":21,"column":42,"index":456},"end":{"line":21,"column":50,"index":464}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":507,"end":557,"loc":{"start":{"line":24,"column":0,"index":507},"end":{"line":26,"column":1,"index":557}}, + "id": { + "type": "Identifier", + "start":512,"end":521,"loc":{"start":{"line":24,"column":5,"index":512},"end":{"line":24,"column":14,"index":521},"identifierName":"Invariant"}, + "name": "Invariant" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":521,"end":531,"loc":{"start":{"line":24,"column":14,"index":521},"end":{"line":24,"column":24,"index":531}}, + "params": [ + { + "type": "TSTypeParameter", + "start":522,"end":530,"loc":{"start":{"line":24,"column":15,"index":522},"end":{"line":24,"column":23,"index":530}}, + "in": true, + "out": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":534,"end":557,"loc":{"start":{"line":24,"column":27,"index":534},"end":{"line":26,"column":1,"index":557}}, + "members": [ + { + "type": "TSPropertySignature", + "start":540,"end":555,"loc":{"start":{"line":25,"column":4,"index":540},"end":{"line":25,"column":19,"index":555}}, + "key": { + "type": "Identifier", + "start":540,"end":541,"loc":{"start":{"line":25,"column":4,"index":540},"end":{"line":25,"column":5,"index":541},"identifierName":"f"}, + "name": "f" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":541,"end":554,"loc":{"start":{"line":25,"column":5,"index":541},"end":{"line":25,"column":18,"index":554}}, + "typeAnnotation": { + "type": "TSFunctionType", + "start":543,"end":554,"loc":{"start":{"line":25,"column":7,"index":543},"end":{"line":25,"column":18,"index":554}}, + "parameters": [ + { + "type": "Identifier", + "start":544,"end":548,"loc":{"start":{"line":25,"column":8,"index":544},"end":{"line":25,"column":12,"index":548},"identifierName":"x"}, + "name": "x", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":545,"end":548,"loc":{"start":{"line":25,"column":9,"index":545},"end":{"line":25,"column":12,"index":548}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":547,"end":548,"loc":{"start":{"line":25,"column":11,"index":547},"end":{"line":25,"column":12,"index":548}}, + "typeName": { + "type": "Identifier", + "start":547,"end":548,"loc":{"start":{"line":25,"column":11,"index":547},"end":{"line":25,"column":12,"index":548},"identifierName":"T"}, + "name": "T" + } + } + } + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":550,"end":554,"loc":{"start":{"line":25,"column":14,"index":550},"end":{"line":25,"column":18,"index":554}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":553,"end":554,"loc":{"start":{"line":25,"column":17,"index":553},"end":{"line":25,"column":18,"index":554}}, + "typeName": { + "type": "Identifier", + "start":553,"end":554,"loc":{"start":{"line":25,"column":17,"index":553},"end":{"line":25,"column":18,"index":554},"identifierName":"T"}, + "name": "T" + } + } + } + } + } + } + ] + } + }, + { + "type": "VariableDeclaration", + "start":559,"end":607,"loc":{"start":{"line":28,"column":0,"index":559},"end":{"line":28,"column":48,"index":607}}, + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "start":571,"end":606,"loc":{"start":{"line":28,"column":12,"index":571},"end":{"line":28,"column":47,"index":606}}, + "id": { + "type": "Identifier", + "start":571,"end":606,"loc":{"start":{"line":28,"column":12,"index":571},"end":{"line":28,"column":47,"index":606},"identifierName":"super_invariant"}, + "name": "super_invariant", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":586,"end":606,"loc":{"start":{"line":28,"column":27,"index":586},"end":{"line":28,"column":47,"index":606}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":588,"end":606,"loc":{"start":{"line":28,"column":29,"index":588},"end":{"line":28,"column":47,"index":606}}, + "typeName": { + "type": "Identifier", + "start":588,"end":597,"loc":{"start":{"line":28,"column":29,"index":588},"end":{"line":28,"column":38,"index":597},"identifierName":"Invariant"}, + "name": "Invariant" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":597,"end":606,"loc":{"start":{"line":28,"column":38,"index":597},"end":{"line":28,"column":47,"index":606}}, + "params": [ + { + "type": "TSUnknownKeyword", + "start":598,"end":605,"loc":{"start":{"line":28,"column":39,"index":598},"end":{"line":28,"column":46,"index":605}} + } + ] + } + } + } + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "VariableDeclaration", + "start":608,"end":653,"loc":{"start":{"line":29,"column":0,"index":608},"end":{"line":29,"column":45,"index":653}}, + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "start":620,"end":652,"loc":{"start":{"line":29,"column":12,"index":620},"end":{"line":29,"column":44,"index":652}}, + "id": { + "type": "Identifier", + "start":620,"end":652,"loc":{"start":{"line":29,"column":12,"index":620},"end":{"line":29,"column":44,"index":652},"identifierName":"sub_invariant"}, + "name": "sub_invariant", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":633,"end":652,"loc":{"start":{"line":29,"column":25,"index":633},"end":{"line":29,"column":44,"index":652}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":635,"end":652,"loc":{"start":{"line":29,"column":27,"index":635},"end":{"line":29,"column":44,"index":652}}, + "typeName": { + "type": "Identifier", + "start":635,"end":644,"loc":{"start":{"line":29,"column":27,"index":635},"end":{"line":29,"column":36,"index":644},"identifierName":"Invariant"}, + "name": "Invariant" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":644,"end":652,"loc":{"start":{"line":29,"column":36,"index":644},"end":{"line":29,"column":44,"index":652}}, + "params": [ + { + "type": "TSStringKeyword", + "start":645,"end":651,"loc":{"start":{"line":29,"column":37,"index":645},"end":{"line":29,"column":43,"index":651}} + } + ] + } + } + } + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "ExpressionStatement", + "start":655,"end":687,"loc":{"start":{"line":31,"column":0,"index":655},"end":{"line":31,"column":32,"index":687}}, + "expression": { + "type": "AssignmentExpression", + "start":655,"end":686,"loc":{"start":{"line":31,"column":0,"index":655},"end":{"line":31,"column":31,"index":686}}, + "operator": "=", + "left": { + "type": "Identifier", + "start":655,"end":670,"loc":{"start":{"line":31,"column":0,"index":655},"end":{"line":31,"column":15,"index":670},"identifierName":"super_invariant"}, + "name": "super_invariant" + }, + "right": { + "type": "Identifier", + "start":673,"end":686,"loc":{"start":{"line":31,"column":18,"index":673},"end":{"line":31,"column":31,"index":686},"identifierName":"sub_invariant"}, + "name": "sub_invariant" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":689,"end":697,"loc":{"start":{"line":31,"column":34,"index":689},"end":{"line":31,"column":42,"index":697}} + } + ] + }, + { + "type": "ExpressionStatement", + "start":698,"end":730,"loc":{"start":{"line":32,"column":0,"index":698},"end":{"line":32,"column":32,"index":730}}, + "expression": { + "type": "AssignmentExpression", + "start":698,"end":729,"loc":{"start":{"line":32,"column":0,"index":698},"end":{"line":32,"column":31,"index":729}}, + "operator": "=", + "left": { + "type": "Identifier", + "start":698,"end":711,"loc":{"start":{"line":32,"column":0,"index":698},"end":{"line":32,"column":13,"index":711},"identifierName":"sub_invariant"}, + "name": "sub_invariant" + }, + "right": { + "type": "Identifier", + "start":714,"end":729,"loc":{"start":{"line":32,"column":16,"index":714},"end":{"line":32,"column":31,"index":729},"identifierName":"super_invariant"}, + "name": "super_invariant" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":732,"end":740,"loc":{"start":{"line":32,"column":34,"index":732},"end":{"line":32,"column":42,"index":740}} + }, + { + "type": "CommentLine", + "value": " Variance of various type constructors", + "start":742,"end":782,"loc":{"start":{"line":34,"column":0,"index":742},"end":{"line":34,"column":40,"index":782}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":689,"end":697,"loc":{"start":{"line":31,"column":34,"index":689},"end":{"line":31,"column":42,"index":697}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":784,"end":804,"loc":{"start":{"line":36,"column":0,"index":784},"end":{"line":36,"column":20,"index":804}}, + "id": { + "type": "Identifier", + "start":789,"end":792,"loc":{"start":{"line":36,"column":5,"index":789},"end":{"line":36,"column":8,"index":792},"identifierName":"T10"}, + "name": "T10" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":792,"end":799,"loc":{"start":{"line":36,"column":8,"index":792},"end":{"line":36,"column":15,"index":799}}, + "params": [ + { + "type": "TSTypeParameter", + "start":793,"end":798,"loc":{"start":{"line":36,"column":9,"index":793},"end":{"line":36,"column":14,"index":798}}, + "out": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeReference", + "start":802,"end":803,"loc":{"start":{"line":36,"column":18,"index":802},"end":{"line":36,"column":19,"index":803}}, + "typeName": { + "type": "Identifier", + "start":802,"end":803,"loc":{"start":{"line":36,"column":18,"index":802},"end":{"line":36,"column":19,"index":803},"identifierName":"T"}, + "name": "T" + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":732,"end":740,"loc":{"start":{"line":32,"column":34,"index":732},"end":{"line":32,"column":42,"index":740}} + }, + { + "type": "CommentLine", + "value": " Variance of various type constructors", + "start":742,"end":782,"loc":{"start":{"line":34,"column":0,"index":742},"end":{"line":34,"column":40,"index":782}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":805,"end":830,"loc":{"start":{"line":37,"column":0,"index":805},"end":{"line":37,"column":25,"index":830}}, + "id": { + "type": "Identifier", + "start":810,"end":813,"loc":{"start":{"line":37,"column":5,"index":810},"end":{"line":37,"column":8,"index":813},"identifierName":"T11"}, + "name": "T11" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":813,"end":819,"loc":{"start":{"line":37,"column":8,"index":813},"end":{"line":37,"column":14,"index":819}}, + "params": [ + { + "type": "TSTypeParameter", + "start":814,"end":818,"loc":{"start":{"line":37,"column":9,"index":814},"end":{"line":37,"column":13,"index":818}}, + "in": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeOperator", + "start":822,"end":829,"loc":{"start":{"line":37,"column":17,"index":822},"end":{"line":37,"column":24,"index":829}}, + "operator": "keyof", + "typeAnnotation": { + "type": "TSTypeReference", + "start":828,"end":829,"loc":{"start":{"line":37,"column":23,"index":828},"end":{"line":37,"column":24,"index":829}}, + "typeName": { + "type": "Identifier", + "start":828,"end":829,"loc":{"start":{"line":37,"column":23,"index":828},"end":{"line":37,"column":24,"index":829},"identifierName":"T"}, + "name": "T" + } + } + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":831,"end":877,"loc":{"start":{"line":38,"column":0,"index":831},"end":{"line":38,"column":46,"index":877}}, + "id": { + "type": "Identifier", + "start":836,"end":839,"loc":{"start":{"line":38,"column":5,"index":836},"end":{"line":38,"column":8,"index":839},"identifierName":"T12"}, + "name": "T12" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":839,"end":869,"loc":{"start":{"line":38,"column":8,"index":839},"end":{"line":38,"column":38,"index":869}}, + "params": [ + { + "type": "TSTypeParameter", + "start":840,"end":845,"loc":{"start":{"line":38,"column":9,"index":840},"end":{"line":38,"column":14,"index":845}}, + "out": true, + "name": "T" + }, + { + "type": "TSTypeParameter", + "start":847,"end":868,"loc":{"start":{"line":38,"column":16,"index":847},"end":{"line":38,"column":37,"index":868}}, + "out": true, + "name": "K", + "constraint": { + "type": "TSTypeOperator", + "start":861,"end":868,"loc":{"start":{"line":38,"column":30,"index":861},"end":{"line":38,"column":37,"index":868}}, + "operator": "keyof", + "typeAnnotation": { + "type": "TSTypeReference", + "start":867,"end":868,"loc":{"start":{"line":38,"column":36,"index":867},"end":{"line":38,"column":37,"index":868}}, + "typeName": { + "type": "Identifier", + "start":867,"end":868,"loc":{"start":{"line":38,"column":36,"index":867},"end":{"line":38,"column":37,"index":868},"identifierName":"T"}, + "name": "T" + } + } + } + } + ] + }, + "typeAnnotation": { + "type": "TSIndexedAccessType", + "start":872,"end":876,"loc":{"start":{"line":38,"column":41,"index":872},"end":{"line":38,"column":45,"index":876}}, + "objectType": { + "type": "TSTypeReference", + "start":872,"end":873,"loc":{"start":{"line":38,"column":41,"index":872},"end":{"line":38,"column":42,"index":873}}, + "typeName": { + "type": "Identifier", + "start":872,"end":873,"loc":{"start":{"line":38,"column":41,"index":872},"end":{"line":38,"column":42,"index":873},"identifierName":"T"}, + "name": "T" + } + }, + "indexType": { + "type": "TSTypeReference", + "start":874,"end":875,"loc":{"start":{"line":38,"column":43,"index":874},"end":{"line":38,"column":44,"index":875}}, + "typeName": { + "type": "Identifier", + "start":874,"end":875,"loc":{"start":{"line":38,"column":43,"index":874},"end":{"line":38,"column":44,"index":875},"identifierName":"K"}, + "name": "K" + } + } + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":878,"end":910,"loc":{"start":{"line":39,"column":0,"index":878},"end":{"line":39,"column":32,"index":910}}, + "id": { + "type": "Identifier", + "start":883,"end":886,"loc":{"start":{"line":39,"column":5,"index":883},"end":{"line":39,"column":8,"index":886},"identifierName":"T13"}, + "name": "T13" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":886,"end":896,"loc":{"start":{"line":39,"column":8,"index":886},"end":{"line":39,"column":18,"index":896}}, + "params": [ + { + "type": "TSTypeParameter", + "start":887,"end":895,"loc":{"start":{"line":39,"column":9,"index":887},"end":{"line":39,"column":17,"index":895}}, + "in": true, + "out": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSIndexedAccessType", + "start":899,"end":909,"loc":{"start":{"line":39,"column":21,"index":899},"end":{"line":39,"column":31,"index":909}}, + "objectType": { + "type": "TSTypeReference", + "start":899,"end":900,"loc":{"start":{"line":39,"column":21,"index":899},"end":{"line":39,"column":22,"index":900}}, + "typeName": { + "type": "Identifier", + "start":899,"end":900,"loc":{"start":{"line":39,"column":21,"index":899},"end":{"line":39,"column":22,"index":900},"identifierName":"T"}, + "name": "T" + } + }, + "indexType": { + "type": "TSTypeOperator", + "start":901,"end":908,"loc":{"start":{"line":39,"column":23,"index":901},"end":{"line":39,"column":30,"index":908}}, + "operator": "keyof", + "typeAnnotation": { + "type": "TSTypeReference", + "start":907,"end":908,"loc":{"start":{"line":39,"column":29,"index":907},"end":{"line":39,"column":30,"index":908}}, + "typeName": { + "type": "Identifier", + "start":907,"end":908,"loc":{"start":{"line":39,"column":29,"index":907},"end":{"line":39,"column":30,"index":908},"identifierName":"T"}, + "name": "T" + } + } + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Variance annotation errors", + "start":912,"end":941,"loc":{"start":{"line":41,"column":0,"index":912},"end":{"line":41,"column":29,"index":941}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":943,"end":990,"loc":{"start":{"line":43,"column":0,"index":943},"end":{"line":45,"column":1,"index":990}}, + "id": { + "type": "Identifier", + "start":948,"end":958,"loc":{"start":{"line":43,"column":5,"index":948},"end":{"line":43,"column":15,"index":958},"identifierName":"Covariant1"}, + "name": "Covariant1" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":958,"end":964,"loc":{"start":{"line":43,"column":15,"index":958},"end":{"line":43,"column":21,"index":964}}, + "params": [ + { + "type": "TSTypeParameter", + "start":959,"end":963,"loc":{"start":{"line":43,"column":16,"index":959},"end":{"line":43,"column":20,"index":963}}, + "in": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":967,"end":990,"loc":{"start":{"line":43,"column":24,"index":967},"end":{"line":45,"column":1,"index":990}}, + "members": [ + { + "type": "TSPropertySignature", + "start":983,"end":988,"loc":{"start":{"line":44,"column":4,"index":983},"end":{"line":44,"column":9,"index":988}}, + "key": { + "type": "Identifier", + "start":983,"end":984,"loc":{"start":{"line":44,"column":4,"index":983},"end":{"line":44,"column":5,"index":984},"identifierName":"x"}, + "name": "x" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":984,"end":987,"loc":{"start":{"line":44,"column":5,"index":984},"end":{"line":44,"column":8,"index":987}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":986,"end":987,"loc":{"start":{"line":44,"column":7,"index":986},"end":{"line":44,"column":8,"index":987}}, + "typeName": { + "type": "Identifier", + "start":986,"end":987,"loc":{"start":{"line":44,"column":7,"index":986},"end":{"line":44,"column":8,"index":987},"identifierName":"T"}, + "name": "T" + } + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":970,"end":978,"loc":{"start":{"line":43,"column":27,"index":970},"end":{"line":43,"column":35,"index":978}} + } + ] + } + ] + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Variance annotation errors", + "start":912,"end":941,"loc":{"start":{"line":41,"column":0,"index":912},"end":{"line":41,"column":29,"index":941}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":992,"end":1029,"loc":{"start":{"line":47,"column":0,"index":992},"end":{"line":47,"column":37,"index":1029}}, + "id": { + "type": "Identifier", + "start":997,"end":1011,"loc":{"start":{"line":47,"column":5,"index":997},"end":{"line":47,"column":19,"index":1011},"identifierName":"Contravariant1"}, + "name": "Contravariant1" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1011,"end":1018,"loc":{"start":{"line":47,"column":19,"index":1011},"end":{"line":47,"column":26,"index":1018}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1012,"end":1017,"loc":{"start":{"line":47,"column":20,"index":1012},"end":{"line":47,"column":25,"index":1017}}, + "out": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeOperator", + "start":1021,"end":1028,"loc":{"start":{"line":47,"column":29,"index":1021},"end":{"line":47,"column":36,"index":1028}}, + "operator": "keyof", + "typeAnnotation": { + "type": "TSTypeReference", + "start":1027,"end":1028,"loc":{"start":{"line":47,"column":35,"index":1027},"end":{"line":47,"column":36,"index":1028}}, + "typeName": { + "type": "Identifier", + "start":1027,"end":1028,"loc":{"start":{"line":47,"column":35,"index":1027},"end":{"line":47,"column":36,"index":1028},"identifierName":"T"}, + "name": "T" + } + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1031,"end":1039,"loc":{"start":{"line":47,"column":39,"index":1031},"end":{"line":47,"column":47,"index":1039}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":1041,"end":1106,"loc":{"start":{"line":49,"column":0,"index":1041},"end":{"line":51,"column":1,"index":1106}}, + "id": { + "type": "Identifier", + "start":1046,"end":1060,"loc":{"start":{"line":49,"column":5,"index":1046},"end":{"line":49,"column":19,"index":1060},"identifierName":"Contravariant2"}, + "name": "Contravariant2" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1060,"end":1067,"loc":{"start":{"line":49,"column":19,"index":1060},"end":{"line":49,"column":26,"index":1067}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1061,"end":1066,"loc":{"start":{"line":49,"column":20,"index":1061},"end":{"line":49,"column":25,"index":1066}}, + "out": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":1070,"end":1106,"loc":{"start":{"line":49,"column":29,"index":1070},"end":{"line":51,"column":1,"index":1106}}, + "members": [ + { + "type": "TSPropertySignature", + "start":1086,"end":1104,"loc":{"start":{"line":50,"column":4,"index":1086},"end":{"line":50,"column":22,"index":1104}}, + "key": { + "type": "Identifier", + "start":1086,"end":1087,"loc":{"start":{"line":50,"column":4,"index":1086},"end":{"line":50,"column":5,"index":1087},"identifierName":"f"}, + "name": "f" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1087,"end":1103,"loc":{"start":{"line":50,"column":5,"index":1087},"end":{"line":50,"column":21,"index":1103}}, + "typeAnnotation": { + "type": "TSFunctionType", + "start":1089,"end":1103,"loc":{"start":{"line":50,"column":7,"index":1089},"end":{"line":50,"column":21,"index":1103}}, + "parameters": [ + { + "type": "Identifier", + "start":1090,"end":1094,"loc":{"start":{"line":50,"column":8,"index":1090},"end":{"line":50,"column":12,"index":1094},"identifierName":"x"}, + "name": "x", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1091,"end":1094,"loc":{"start":{"line":50,"column":9,"index":1091},"end":{"line":50,"column":12,"index":1094}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1093,"end":1094,"loc":{"start":{"line":50,"column":11,"index":1093},"end":{"line":50,"column":12,"index":1094}}, + "typeName": { + "type": "Identifier", + "start":1093,"end":1094,"loc":{"start":{"line":50,"column":11,"index":1093},"end":{"line":50,"column":12,"index":1094},"identifierName":"T"}, + "name": "T" + } + } + } + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1096,"end":1103,"loc":{"start":{"line":50,"column":14,"index":1096},"end":{"line":50,"column":21,"index":1103}}, + "typeAnnotation": { + "type": "TSVoidKeyword", + "start":1099,"end":1103,"loc":{"start":{"line":50,"column":17,"index":1099},"end":{"line":50,"column":21,"index":1103}} + } + } + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1073,"end":1081,"loc":{"start":{"line":49,"column":32,"index":1073},"end":{"line":49,"column":40,"index":1081}} + } + ] + } + ] + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1031,"end":1039,"loc":{"start":{"line":47,"column":39,"index":1031},"end":{"line":47,"column":47,"index":1039}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":1108,"end":1165,"loc":{"start":{"line":53,"column":0,"index":1108},"end":{"line":55,"column":1,"index":1165}}, + "id": { + "type": "Identifier", + "start":1113,"end":1123,"loc":{"start":{"line":53,"column":5,"index":1113},"end":{"line":53,"column":15,"index":1123},"identifierName":"Invariant1"}, + "name": "Invariant1" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1123,"end":1129,"loc":{"start":{"line":53,"column":15,"index":1123},"end":{"line":53,"column":21,"index":1129}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1124,"end":1128,"loc":{"start":{"line":53,"column":16,"index":1124},"end":{"line":53,"column":20,"index":1128}}, + "in": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":1132,"end":1165,"loc":{"start":{"line":53,"column":24,"index":1132},"end":{"line":55,"column":1,"index":1165}}, + "members": [ + { + "type": "TSPropertySignature", + "start":1148,"end":1163,"loc":{"start":{"line":54,"column":4,"index":1148},"end":{"line":54,"column":19,"index":1163}}, + "key": { + "type": "Identifier", + "start":1148,"end":1149,"loc":{"start":{"line":54,"column":4,"index":1148},"end":{"line":54,"column":5,"index":1149},"identifierName":"f"}, + "name": "f" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1149,"end":1162,"loc":{"start":{"line":54,"column":5,"index":1149},"end":{"line":54,"column":18,"index":1162}}, + "typeAnnotation": { + "type": "TSFunctionType", + "start":1151,"end":1162,"loc":{"start":{"line":54,"column":7,"index":1151},"end":{"line":54,"column":18,"index":1162}}, + "parameters": [ + { + "type": "Identifier", + "start":1152,"end":1156,"loc":{"start":{"line":54,"column":8,"index":1152},"end":{"line":54,"column":12,"index":1156},"identifierName":"x"}, + "name": "x", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1153,"end":1156,"loc":{"start":{"line":54,"column":9,"index":1153},"end":{"line":54,"column":12,"index":1156}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1155,"end":1156,"loc":{"start":{"line":54,"column":11,"index":1155},"end":{"line":54,"column":12,"index":1156}}, + "typeName": { + "type": "Identifier", + "start":1155,"end":1156,"loc":{"start":{"line":54,"column":11,"index":1155},"end":{"line":54,"column":12,"index":1156},"identifierName":"T"}, + "name": "T" + } + } + } + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1158,"end":1162,"loc":{"start":{"line":54,"column":14,"index":1158},"end":{"line":54,"column":18,"index":1162}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1161,"end":1162,"loc":{"start":{"line":54,"column":17,"index":1161},"end":{"line":54,"column":18,"index":1162}}, + "typeName": { + "type": "Identifier", + "start":1161,"end":1162,"loc":{"start":{"line":54,"column":17,"index":1161},"end":{"line":54,"column":18,"index":1162},"identifierName":"T"}, + "name": "T" + } + } + } + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1135,"end":1143,"loc":{"start":{"line":53,"column":27,"index":1135},"end":{"line":53,"column":35,"index":1143}} + } + ] + } + ] + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":1167,"end":1225,"loc":{"start":{"line":57,"column":0,"index":1167},"end":{"line":59,"column":1,"index":1225}}, + "id": { + "type": "Identifier", + "start":1172,"end":1182,"loc":{"start":{"line":57,"column":5,"index":1172},"end":{"line":57,"column":15,"index":1182},"identifierName":"Invariant2"}, + "name": "Invariant2" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1182,"end":1189,"loc":{"start":{"line":57,"column":15,"index":1182},"end":{"line":57,"column":22,"index":1189}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1183,"end":1188,"loc":{"start":{"line":57,"column":16,"index":1183},"end":{"line":57,"column":21,"index":1188}}, + "out": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":1192,"end":1225,"loc":{"start":{"line":57,"column":25,"index":1192},"end":{"line":59,"column":1,"index":1225}}, + "members": [ + { + "type": "TSPropertySignature", + "start":1208,"end":1223,"loc":{"start":{"line":58,"column":4,"index":1208},"end":{"line":58,"column":19,"index":1223}}, + "key": { + "type": "Identifier", + "start":1208,"end":1209,"loc":{"start":{"line":58,"column":4,"index":1208},"end":{"line":58,"column":5,"index":1209},"identifierName":"f"}, + "name": "f" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1209,"end":1222,"loc":{"start":{"line":58,"column":5,"index":1209},"end":{"line":58,"column":18,"index":1222}}, + "typeAnnotation": { + "type": "TSFunctionType", + "start":1211,"end":1222,"loc":{"start":{"line":58,"column":7,"index":1211},"end":{"line":58,"column":18,"index":1222}}, + "parameters": [ + { + "type": "Identifier", + "start":1212,"end":1216,"loc":{"start":{"line":58,"column":8,"index":1212},"end":{"line":58,"column":12,"index":1216},"identifierName":"x"}, + "name": "x", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1213,"end":1216,"loc":{"start":{"line":58,"column":9,"index":1213},"end":{"line":58,"column":12,"index":1216}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1215,"end":1216,"loc":{"start":{"line":58,"column":11,"index":1215},"end":{"line":58,"column":12,"index":1216}}, + "typeName": { + "type": "Identifier", + "start":1215,"end":1216,"loc":{"start":{"line":58,"column":11,"index":1215},"end":{"line":58,"column":12,"index":1216},"identifierName":"T"}, + "name": "T" + } + } + } + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1218,"end":1222,"loc":{"start":{"line":58,"column":14,"index":1218},"end":{"line":58,"column":18,"index":1222}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1221,"end":1222,"loc":{"start":{"line":58,"column":17,"index":1221},"end":{"line":58,"column":18,"index":1222}}, + "typeName": { + "type": "Identifier", + "start":1221,"end":1222,"loc":{"start":{"line":58,"column":17,"index":1221},"end":{"line":58,"column":18,"index":1222},"identifierName":"T"}, + "name": "T" + } + } + } + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1195,"end":1203,"loc":{"start":{"line":57,"column":28,"index":1195},"end":{"line":57,"column":36,"index":1203}} + } + ] + } + ] + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Variance in circular types", + "start":1227,"end":1256,"loc":{"start":{"line":61,"column":0,"index":1227},"end":{"line":61,"column":29,"index":1256}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":1258,"end":1317,"loc":{"start":{"line":63,"column":0,"index":1258},"end":{"line":66,"column":1,"index":1317}}, + "id": { + "type": "Identifier", + "start":1263,"end":1267,"loc":{"start":{"line":63,"column":5,"index":1263},"end":{"line":63,"column":9,"index":1267},"identifierName":"Foo1"}, + "name": "Foo1" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1267,"end":1273,"loc":{"start":{"line":63,"column":9,"index":1267},"end":{"line":63,"column":15,"index":1273}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1268,"end":1272,"loc":{"start":{"line":63,"column":10,"index":1268},"end":{"line":63,"column":14,"index":1272}}, + "in": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":1276,"end":1317,"loc":{"start":{"line":63,"column":18,"index":1276},"end":{"line":66,"column":1,"index":1317}}, + "members": [ + { + "type": "TSPropertySignature", + "start":1292,"end":1297,"loc":{"start":{"line":64,"column":4,"index":1292},"end":{"line":64,"column":9,"index":1297}}, + "key": { + "type": "Identifier", + "start":1292,"end":1293,"loc":{"start":{"line":64,"column":4,"index":1292},"end":{"line":64,"column":5,"index":1293},"identifierName":"x"}, + "name": "x" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1293,"end":1296,"loc":{"start":{"line":64,"column":5,"index":1293},"end":{"line":64,"column":8,"index":1296}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1295,"end":1296,"loc":{"start":{"line":64,"column":7,"index":1295},"end":{"line":64,"column":8,"index":1296}}, + "typeName": { + "type": "Identifier", + "start":1295,"end":1296,"loc":{"start":{"line":64,"column":7,"index":1295},"end":{"line":64,"column":8,"index":1296},"identifierName":"T"}, + "name": "T" + } + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1279,"end":1287,"loc":{"start":{"line":63,"column":21,"index":1279},"end":{"line":63,"column":29,"index":1287}} + } + ] + }, + { + "type": "TSPropertySignature", + "start":1302,"end":1315,"loc":{"start":{"line":65,"column":4,"index":1302},"end":{"line":65,"column":17,"index":1315}}, + "key": { + "type": "Identifier", + "start":1302,"end":1303,"loc":{"start":{"line":65,"column":4,"index":1302},"end":{"line":65,"column":5,"index":1303},"identifierName":"f"}, + "name": "f" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1303,"end":1314,"loc":{"start":{"line":65,"column":5,"index":1303},"end":{"line":65,"column":16,"index":1314}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1305,"end":1314,"loc":{"start":{"line":65,"column":7,"index":1305},"end":{"line":65,"column":16,"index":1314}}, + "typeName": { + "type": "Identifier", + "start":1305,"end":1311,"loc":{"start":{"line":65,"column":7,"index":1305},"end":{"line":65,"column":13,"index":1311},"identifierName":"FooFn1"}, + "name": "FooFn1" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":1311,"end":1314,"loc":{"start":{"line":65,"column":13,"index":1311},"end":{"line":65,"column":16,"index":1314}}, + "params": [ + { + "type": "TSTypeReference", + "start":1312,"end":1313,"loc":{"start":{"line":65,"column":14,"index":1312},"end":{"line":65,"column":15,"index":1313}}, + "typeName": { + "type": "Identifier", + "start":1312,"end":1313,"loc":{"start":{"line":65,"column":14,"index":1312},"end":{"line":65,"column":15,"index":1313},"identifierName":"T"}, + "name": "T" + } + } + ] + } + } + } + } + ] + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Variance in circular types", + "start":1227,"end":1256,"loc":{"start":{"line":61,"column":0,"index":1227},"end":{"line":61,"column":29,"index":1256}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":1319,"end":1361,"loc":{"start":{"line":68,"column":0,"index":1319},"end":{"line":68,"column":42,"index":1361}}, + "id": { + "type": "Identifier", + "start":1324,"end":1330,"loc":{"start":{"line":68,"column":5,"index":1324},"end":{"line":68,"column":11,"index":1330},"identifierName":"FooFn1"}, + "name": "FooFn1" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1330,"end":1333,"loc":{"start":{"line":68,"column":11,"index":1330},"end":{"line":68,"column":14,"index":1333}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1331,"end":1332,"loc":{"start":{"line":68,"column":12,"index":1331},"end":{"line":68,"column":13,"index":1332}}, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSFunctionType", + "start":1336,"end":1360,"loc":{"start":{"line":68,"column":17,"index":1336},"end":{"line":68,"column":41,"index":1360}}, + "parameters": [ + { + "type": "Identifier", + "start":1337,"end":1351,"loc":{"start":{"line":68,"column":18,"index":1337},"end":{"line":68,"column":32,"index":1351},"identifierName":"foo"}, + "name": "foo", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1340,"end":1351,"loc":{"start":{"line":68,"column":21,"index":1340},"end":{"line":68,"column":32,"index":1351}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1342,"end":1351,"loc":{"start":{"line":68,"column":23,"index":1342},"end":{"line":68,"column":32,"index":1351}}, + "typeName": { + "type": "Identifier", + "start":1342,"end":1346,"loc":{"start":{"line":68,"column":23,"index":1342},"end":{"line":68,"column":27,"index":1346},"identifierName":"Bar1"}, + "name": "Bar1" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":1346,"end":1351,"loc":{"start":{"line":68,"column":27,"index":1346},"end":{"line":68,"column":32,"index":1351}}, + "params": [ + { + "type": "TSArrayType", + "start":1347,"end":1350,"loc":{"start":{"line":68,"column":28,"index":1347},"end":{"line":68,"column":31,"index":1350}}, + "elementType": { + "type": "TSTypeReference", + "start":1347,"end":1348,"loc":{"start":{"line":68,"column":28,"index":1347},"end":{"line":68,"column":29,"index":1348}}, + "typeName": { + "type": "Identifier", + "start":1347,"end":1348,"loc":{"start":{"line":68,"column":28,"index":1347},"end":{"line":68,"column":29,"index":1348},"identifierName":"T"}, + "name": "T" + } + } + } + ] + } + } + } + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1353,"end":1360,"loc":{"start":{"line":68,"column":34,"index":1353},"end":{"line":68,"column":41,"index":1360}}, + "typeAnnotation": { + "type": "TSVoidKeyword", + "start":1356,"end":1360,"loc":{"start":{"line":68,"column":37,"index":1356},"end":{"line":68,"column":41,"index":1360}} + } + } + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":1363,"end":1403,"loc":{"start":{"line":70,"column":0,"index":1363},"end":{"line":72,"column":1,"index":1403}}, + "id": { + "type": "Identifier", + "start":1368,"end":1372,"loc":{"start":{"line":70,"column":5,"index":1368},"end":{"line":70,"column":9,"index":1372},"identifierName":"Bar1"}, + "name": "Bar1" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1372,"end":1375,"loc":{"start":{"line":70,"column":9,"index":1372},"end":{"line":70,"column":12,"index":1375}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1373,"end":1374,"loc":{"start":{"line":70,"column":10,"index":1373},"end":{"line":70,"column":11,"index":1374}}, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":1378,"end":1403,"loc":{"start":{"line":70,"column":15,"index":1378},"end":{"line":72,"column":1,"index":1403}}, + "members": [ + { + "type": "TSPropertySignature", + "start":1384,"end":1401,"loc":{"start":{"line":71,"column":4,"index":1384},"end":{"line":71,"column":21,"index":1401}}, + "key": { + "type": "Identifier", + "start":1384,"end":1389,"loc":{"start":{"line":71,"column":4,"index":1384},"end":{"line":71,"column":9,"index":1389},"identifierName":"value"}, + "name": "value" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1389,"end":1400,"loc":{"start":{"line":71,"column":9,"index":1389},"end":{"line":71,"column":20,"index":1400}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1391,"end":1400,"loc":{"start":{"line":71,"column":11,"index":1391},"end":{"line":71,"column":20,"index":1400}}, + "typeName": { + "type": "Identifier", + "start":1391,"end":1395,"loc":{"start":{"line":71,"column":11,"index":1391},"end":{"line":71,"column":15,"index":1395},"identifierName":"Foo1"}, + "name": "Foo1" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":1395,"end":1400,"loc":{"start":{"line":71,"column":15,"index":1395},"end":{"line":71,"column":20,"index":1400}}, + "params": [ + { + "type": "TSArrayType", + "start":1396,"end":1399,"loc":{"start":{"line":71,"column":16,"index":1396},"end":{"line":71,"column":19,"index":1399}}, + "elementType": { + "type": "TSTypeReference", + "start":1396,"end":1397,"loc":{"start":{"line":71,"column":16,"index":1396},"end":{"line":71,"column":17,"index":1397}}, + "typeName": { + "type": "Identifier", + "start":1396,"end":1397,"loc":{"start":{"line":71,"column":16,"index":1396},"end":{"line":71,"column":17,"index":1397},"identifierName":"T"}, + "name": "T" + } + } + } + ] + } + } + } + } + ] + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":1405,"end":1465,"loc":{"start":{"line":74,"column":0,"index":1405},"end":{"line":77,"column":1,"index":1465}}, + "id": { + "type": "Identifier", + "start":1410,"end":1414,"loc":{"start":{"line":74,"column":5,"index":1410},"end":{"line":74,"column":9,"index":1414},"identifierName":"Foo2"}, + "name": "Foo2" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1414,"end":1421,"loc":{"start":{"line":74,"column":9,"index":1414},"end":{"line":74,"column":16,"index":1421}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1415,"end":1420,"loc":{"start":{"line":74,"column":10,"index":1415},"end":{"line":74,"column":15,"index":1420}}, + "out": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":1424,"end":1465,"loc":{"start":{"line":74,"column":19,"index":1424},"end":{"line":77,"column":1,"index":1465}}, + "members": [ + { + "type": "TSPropertySignature", + "start":1440,"end":1445,"loc":{"start":{"line":75,"column":4,"index":1440},"end":{"line":75,"column":9,"index":1445}}, + "key": { + "type": "Identifier", + "start":1440,"end":1441,"loc":{"start":{"line":75,"column":4,"index":1440},"end":{"line":75,"column":5,"index":1441},"identifierName":"x"}, + "name": "x" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1441,"end":1444,"loc":{"start":{"line":75,"column":5,"index":1441},"end":{"line":75,"column":8,"index":1444}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1443,"end":1444,"loc":{"start":{"line":75,"column":7,"index":1443},"end":{"line":75,"column":8,"index":1444}}, + "typeName": { + "type": "Identifier", + "start":1443,"end":1444,"loc":{"start":{"line":75,"column":7,"index":1443},"end":{"line":75,"column":8,"index":1444},"identifierName":"T"}, + "name": "T" + } + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1427,"end":1435,"loc":{"start":{"line":74,"column":22,"index":1427},"end":{"line":74,"column":30,"index":1435}} + } + ] + }, + { + "type": "TSPropertySignature", + "start":1450,"end":1463,"loc":{"start":{"line":76,"column":4,"index":1450},"end":{"line":76,"column":17,"index":1463}}, + "key": { + "type": "Identifier", + "start":1450,"end":1451,"loc":{"start":{"line":76,"column":4,"index":1450},"end":{"line":76,"column":5,"index":1451},"identifierName":"f"}, + "name": "f" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1451,"end":1462,"loc":{"start":{"line":76,"column":5,"index":1451},"end":{"line":76,"column":16,"index":1462}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1453,"end":1462,"loc":{"start":{"line":76,"column":7,"index":1453},"end":{"line":76,"column":16,"index":1462}}, + "typeName": { + "type": "Identifier", + "start":1453,"end":1459,"loc":{"start":{"line":76,"column":7,"index":1453},"end":{"line":76,"column":13,"index":1459},"identifierName":"FooFn2"}, + "name": "FooFn2" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":1459,"end":1462,"loc":{"start":{"line":76,"column":13,"index":1459},"end":{"line":76,"column":16,"index":1462}}, + "params": [ + { + "type": "TSTypeReference", + "start":1460,"end":1461,"loc":{"start":{"line":76,"column":14,"index":1460},"end":{"line":76,"column":15,"index":1461}}, + "typeName": { + "type": "Identifier", + "start":1460,"end":1461,"loc":{"start":{"line":76,"column":14,"index":1460},"end":{"line":76,"column":15,"index":1461},"identifierName":"T"}, + "name": "T" + } + } + ] + } + } + } + } + ] + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":1467,"end":1509,"loc":{"start":{"line":79,"column":0,"index":1467},"end":{"line":79,"column":42,"index":1509}}, + "id": { + "type": "Identifier", + "start":1472,"end":1478,"loc":{"start":{"line":79,"column":5,"index":1472},"end":{"line":79,"column":11,"index":1478},"identifierName":"FooFn2"}, + "name": "FooFn2" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1478,"end":1481,"loc":{"start":{"line":79,"column":11,"index":1478},"end":{"line":79,"column":14,"index":1481}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1479,"end":1480,"loc":{"start":{"line":79,"column":12,"index":1479},"end":{"line":79,"column":13,"index":1480}}, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSFunctionType", + "start":1484,"end":1508,"loc":{"start":{"line":79,"column":17,"index":1484},"end":{"line":79,"column":41,"index":1508}}, + "parameters": [ + { + "type": "Identifier", + "start":1485,"end":1499,"loc":{"start":{"line":79,"column":18,"index":1485},"end":{"line":79,"column":32,"index":1499},"identifierName":"foo"}, + "name": "foo", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1488,"end":1499,"loc":{"start":{"line":79,"column":21,"index":1488},"end":{"line":79,"column":32,"index":1499}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1490,"end":1499,"loc":{"start":{"line":79,"column":23,"index":1490},"end":{"line":79,"column":32,"index":1499}}, + "typeName": { + "type": "Identifier", + "start":1490,"end":1494,"loc":{"start":{"line":79,"column":23,"index":1490},"end":{"line":79,"column":27,"index":1494},"identifierName":"Bar2"}, + "name": "Bar2" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":1494,"end":1499,"loc":{"start":{"line":79,"column":27,"index":1494},"end":{"line":79,"column":32,"index":1499}}, + "params": [ + { + "type": "TSArrayType", + "start":1495,"end":1498,"loc":{"start":{"line":79,"column":28,"index":1495},"end":{"line":79,"column":31,"index":1498}}, + "elementType": { + "type": "TSTypeReference", + "start":1495,"end":1496,"loc":{"start":{"line":79,"column":28,"index":1495},"end":{"line":79,"column":29,"index":1496}}, + "typeName": { + "type": "Identifier", + "start":1495,"end":1496,"loc":{"start":{"line":79,"column":28,"index":1495},"end":{"line":79,"column":29,"index":1496},"identifierName":"T"}, + "name": "T" + } + } + } + ] + } + } + } + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1501,"end":1508,"loc":{"start":{"line":79,"column":34,"index":1501},"end":{"line":79,"column":41,"index":1508}}, + "typeAnnotation": { + "type": "TSVoidKeyword", + "start":1504,"end":1508,"loc":{"start":{"line":79,"column":37,"index":1504},"end":{"line":79,"column":41,"index":1508}} + } + } + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":1511,"end":1551,"loc":{"start":{"line":81,"column":0,"index":1511},"end":{"line":83,"column":1,"index":1551}}, + "id": { + "type": "Identifier", + "start":1516,"end":1520,"loc":{"start":{"line":81,"column":5,"index":1516},"end":{"line":81,"column":9,"index":1520},"identifierName":"Bar2"}, + "name": "Bar2" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1520,"end":1523,"loc":{"start":{"line":81,"column":9,"index":1520},"end":{"line":81,"column":12,"index":1523}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1521,"end":1522,"loc":{"start":{"line":81,"column":10,"index":1521},"end":{"line":81,"column":11,"index":1522}}, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":1526,"end":1551,"loc":{"start":{"line":81,"column":15,"index":1526},"end":{"line":83,"column":1,"index":1551}}, + "members": [ + { + "type": "TSPropertySignature", + "start":1532,"end":1549,"loc":{"start":{"line":82,"column":4,"index":1532},"end":{"line":82,"column":21,"index":1549}}, + "key": { + "type": "Identifier", + "start":1532,"end":1537,"loc":{"start":{"line":82,"column":4,"index":1532},"end":{"line":82,"column":9,"index":1537},"identifierName":"value"}, + "name": "value" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1537,"end":1548,"loc":{"start":{"line":82,"column":9,"index":1537},"end":{"line":82,"column":20,"index":1548}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1539,"end":1548,"loc":{"start":{"line":82,"column":11,"index":1539},"end":{"line":82,"column":20,"index":1548}}, + "typeName": { + "type": "Identifier", + "start":1539,"end":1543,"loc":{"start":{"line":82,"column":11,"index":1539},"end":{"line":82,"column":15,"index":1543},"identifierName":"Foo2"}, + "name": "Foo2" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":1543,"end":1548,"loc":{"start":{"line":82,"column":15,"index":1543},"end":{"line":82,"column":20,"index":1548}}, + "params": [ + { + "type": "TSArrayType", + "start":1544,"end":1547,"loc":{"start":{"line":82,"column":16,"index":1544},"end":{"line":82,"column":19,"index":1547}}, + "elementType": { + "type": "TSTypeReference", + "start":1544,"end":1545,"loc":{"start":{"line":82,"column":16,"index":1544},"end":{"line":82,"column":17,"index":1545}}, + "typeName": { + "type": "Identifier", + "start":1544,"end":1545,"loc":{"start":{"line":82,"column":16,"index":1544},"end":{"line":82,"column":17,"index":1545},"identifierName":"T"}, + "name": "T" + } + } + } + ] + } + } + } + } + ] + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":1553,"end":1606,"loc":{"start":{"line":85,"column":0,"index":1553},"end":{"line":88,"column":1,"index":1606}}, + "id": { + "type": "Identifier", + "start":1558,"end":1562,"loc":{"start":{"line":85,"column":5,"index":1558},"end":{"line":85,"column":9,"index":1562},"identifierName":"Foo3"}, + "name": "Foo3" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1562,"end":1572,"loc":{"start":{"line":85,"column":9,"index":1562},"end":{"line":85,"column":19,"index":1572}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1563,"end":1571,"loc":{"start":{"line":85,"column":10,"index":1563},"end":{"line":85,"column":18,"index":1571}}, + "in": true, + "out": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":1575,"end":1606,"loc":{"start":{"line":85,"column":22,"index":1575},"end":{"line":88,"column":1,"index":1606}}, + "members": [ + { + "type": "TSPropertySignature", + "start":1581,"end":1586,"loc":{"start":{"line":86,"column":4,"index":1581},"end":{"line":86,"column":9,"index":1586}}, + "key": { + "type": "Identifier", + "start":1581,"end":1582,"loc":{"start":{"line":86,"column":4,"index":1581},"end":{"line":86,"column":5,"index":1582},"identifierName":"x"}, + "name": "x" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1582,"end":1585,"loc":{"start":{"line":86,"column":5,"index":1582},"end":{"line":86,"column":8,"index":1585}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1584,"end":1585,"loc":{"start":{"line":86,"column":7,"index":1584},"end":{"line":86,"column":8,"index":1585}}, + "typeName": { + "type": "Identifier", + "start":1584,"end":1585,"loc":{"start":{"line":86,"column":7,"index":1584},"end":{"line":86,"column":8,"index":1585},"identifierName":"T"}, + "name": "T" + } + } + } + }, + { + "type": "TSPropertySignature", + "start":1591,"end":1604,"loc":{"start":{"line":87,"column":4,"index":1591},"end":{"line":87,"column":17,"index":1604}}, + "key": { + "type": "Identifier", + "start":1591,"end":1592,"loc":{"start":{"line":87,"column":4,"index":1591},"end":{"line":87,"column":5,"index":1592},"identifierName":"f"}, + "name": "f" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1592,"end":1603,"loc":{"start":{"line":87,"column":5,"index":1592},"end":{"line":87,"column":16,"index":1603}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1594,"end":1603,"loc":{"start":{"line":87,"column":7,"index":1594},"end":{"line":87,"column":16,"index":1603}}, + "typeName": { + "type": "Identifier", + "start":1594,"end":1600,"loc":{"start":{"line":87,"column":7,"index":1594},"end":{"line":87,"column":13,"index":1600},"identifierName":"FooFn3"}, + "name": "FooFn3" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":1600,"end":1603,"loc":{"start":{"line":87,"column":13,"index":1600},"end":{"line":87,"column":16,"index":1603}}, + "params": [ + { + "type": "TSTypeReference", + "start":1601,"end":1602,"loc":{"start":{"line":87,"column":14,"index":1601},"end":{"line":87,"column":15,"index":1602}}, + "typeName": { + "type": "Identifier", + "start":1601,"end":1602,"loc":{"start":{"line":87,"column":14,"index":1601},"end":{"line":87,"column":15,"index":1602},"identifierName":"T"}, + "name": "T" + } + } + ] + } + } + } + } + ] + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":1608,"end":1650,"loc":{"start":{"line":90,"column":0,"index":1608},"end":{"line":90,"column":42,"index":1650}}, + "id": { + "type": "Identifier", + "start":1613,"end":1619,"loc":{"start":{"line":90,"column":5,"index":1613},"end":{"line":90,"column":11,"index":1619},"identifierName":"FooFn3"}, + "name": "FooFn3" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1619,"end":1622,"loc":{"start":{"line":90,"column":11,"index":1619},"end":{"line":90,"column":14,"index":1622}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1620,"end":1621,"loc":{"start":{"line":90,"column":12,"index":1620},"end":{"line":90,"column":13,"index":1621}}, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSFunctionType", + "start":1625,"end":1649,"loc":{"start":{"line":90,"column":17,"index":1625},"end":{"line":90,"column":41,"index":1649}}, + "parameters": [ + { + "type": "Identifier", + "start":1626,"end":1640,"loc":{"start":{"line":90,"column":18,"index":1626},"end":{"line":90,"column":32,"index":1640},"identifierName":"foo"}, + "name": "foo", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1629,"end":1640,"loc":{"start":{"line":90,"column":21,"index":1629},"end":{"line":90,"column":32,"index":1640}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1631,"end":1640,"loc":{"start":{"line":90,"column":23,"index":1631},"end":{"line":90,"column":32,"index":1640}}, + "typeName": { + "type": "Identifier", + "start":1631,"end":1635,"loc":{"start":{"line":90,"column":23,"index":1631},"end":{"line":90,"column":27,"index":1635},"identifierName":"Bar3"}, + "name": "Bar3" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":1635,"end":1640,"loc":{"start":{"line":90,"column":27,"index":1635},"end":{"line":90,"column":32,"index":1640}}, + "params": [ + { + "type": "TSArrayType", + "start":1636,"end":1639,"loc":{"start":{"line":90,"column":28,"index":1636},"end":{"line":90,"column":31,"index":1639}}, + "elementType": { + "type": "TSTypeReference", + "start":1636,"end":1637,"loc":{"start":{"line":90,"column":28,"index":1636},"end":{"line":90,"column":29,"index":1637}}, + "typeName": { + "type": "Identifier", + "start":1636,"end":1637,"loc":{"start":{"line":90,"column":28,"index":1636},"end":{"line":90,"column":29,"index":1637},"identifierName":"T"}, + "name": "T" + } + } + } + ] + } + } + } + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1642,"end":1649,"loc":{"start":{"line":90,"column":34,"index":1642},"end":{"line":90,"column":41,"index":1649}}, + "typeAnnotation": { + "type": "TSVoidKeyword", + "start":1645,"end":1649,"loc":{"start":{"line":90,"column":37,"index":1645},"end":{"line":90,"column":41,"index":1649}} + } + } + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":1652,"end":1692,"loc":{"start":{"line":92,"column":0,"index":1652},"end":{"line":94,"column":1,"index":1692}}, + "id": { + "type": "Identifier", + "start":1657,"end":1661,"loc":{"start":{"line":92,"column":5,"index":1657},"end":{"line":92,"column":9,"index":1661},"identifierName":"Bar3"}, + "name": "Bar3" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1661,"end":1664,"loc":{"start":{"line":92,"column":9,"index":1661},"end":{"line":92,"column":12,"index":1664}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1662,"end":1663,"loc":{"start":{"line":92,"column":10,"index":1662},"end":{"line":92,"column":11,"index":1663}}, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":1667,"end":1692,"loc":{"start":{"line":92,"column":15,"index":1667},"end":{"line":94,"column":1,"index":1692}}, + "members": [ + { + "type": "TSPropertySignature", + "start":1673,"end":1690,"loc":{"start":{"line":93,"column":4,"index":1673},"end":{"line":93,"column":21,"index":1690}}, + "key": { + "type": "Identifier", + "start":1673,"end":1678,"loc":{"start":{"line":93,"column":4,"index":1673},"end":{"line":93,"column":9,"index":1678},"identifierName":"value"}, + "name": "value" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1678,"end":1689,"loc":{"start":{"line":93,"column":9,"index":1678},"end":{"line":93,"column":20,"index":1689}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1680,"end":1689,"loc":{"start":{"line":93,"column":11,"index":1680},"end":{"line":93,"column":20,"index":1689}}, + "typeName": { + "type": "Identifier", + "start":1680,"end":1684,"loc":{"start":{"line":93,"column":11,"index":1680},"end":{"line":93,"column":15,"index":1684},"identifierName":"Foo3"}, + "name": "Foo3" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":1684,"end":1689,"loc":{"start":{"line":93,"column":15,"index":1684},"end":{"line":93,"column":20,"index":1689}}, + "params": [ + { + "type": "TSArrayType", + "start":1685,"end":1688,"loc":{"start":{"line":93,"column":16,"index":1685},"end":{"line":93,"column":19,"index":1688}}, + "elementType": { + "type": "TSTypeReference", + "start":1685,"end":1686,"loc":{"start":{"line":93,"column":16,"index":1685},"end":{"line":93,"column":17,"index":1686}}, + "typeName": { + "type": "Identifier", + "start":1685,"end":1686,"loc":{"start":{"line":93,"column":16,"index":1685},"end":{"line":93,"column":17,"index":1686},"identifierName":"T"}, + "name": "T" + } + } + } + ] + } + } + } + } + ] + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Wrong modifier usage", + "start":1694,"end":1717,"loc":{"start":{"line":96,"column":0,"index":1694},"end":{"line":96,"column":23,"index":1717}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":1719,"end":1742,"loc":{"start":{"line":98,"column":0,"index":1719},"end":{"line":98,"column":23,"index":1742}}, + "id": { + "type": "Identifier", + "start":1724,"end":1727,"loc":{"start":{"line":98,"column":5,"index":1724},"end":{"line":98,"column":8,"index":1727},"identifierName":"T20"}, + "name": "T20" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1727,"end":1737,"loc":{"start":{"line":98,"column":8,"index":1727},"end":{"line":98,"column":18,"index":1737}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1728,"end":1736,"loc":{"start":{"line":98,"column":9,"index":1728},"end":{"line":98,"column":17,"index":1736}}, + "accessibility": "public", + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1740,"end":1741,"loc":{"start":{"line":98,"column":21,"index":1740},"end":{"line":98,"column":22,"index":1741}}, + "typeName": { + "type": "Identifier", + "start":1740,"end":1741,"loc":{"start":{"line":98,"column":21,"index":1740},"end":{"line":98,"column":22,"index":1741},"identifierName":"T"}, + "name": "T" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1744,"end":1752,"loc":{"start":{"line":98,"column":25,"index":1744},"end":{"line":98,"column":33,"index":1752}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Wrong modifier usage", + "start":1694,"end":1717,"loc":{"start":{"line":96,"column":0,"index":1694},"end":{"line":96,"column":23,"index":1717}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":1753,"end":1779,"loc":{"start":{"line":99,"column":0,"index":1753},"end":{"line":99,"column":26,"index":1779}}, + "id": { + "type": "Identifier", + "start":1758,"end":1761,"loc":{"start":{"line":99,"column":5,"index":1758},"end":{"line":99,"column":8,"index":1761},"identifierName":"T21"}, + "name": "T21" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1761,"end":1774,"loc":{"start":{"line":99,"column":8,"index":1761},"end":{"line":99,"column":21,"index":1774}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1762,"end":1773,"loc":{"start":{"line":99,"column":9,"index":1762},"end":{"line":99,"column":20,"index":1773}}, + "in": true, + "out": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1777,"end":1778,"loc":{"start":{"line":99,"column":24,"index":1777},"end":{"line":99,"column":25,"index":1778}}, + "typeName": { + "type": "Identifier", + "start":1777,"end":1778,"loc":{"start":{"line":99,"column":24,"index":1777},"end":{"line":99,"column":25,"index":1778},"identifierName":"T"}, + "name": "T" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1781,"end":1789,"loc":{"start":{"line":99,"column":28,"index":1781},"end":{"line":99,"column":36,"index":1789}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1744,"end":1752,"loc":{"start":{"line":98,"column":25,"index":1744},"end":{"line":98,"column":33,"index":1752}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":1790,"end":1817,"loc":{"start":{"line":100,"column":0,"index":1790},"end":{"line":100,"column":27,"index":1817}}, + "id": { + "type": "Identifier", + "start":1795,"end":1798,"loc":{"start":{"line":100,"column":5,"index":1795},"end":{"line":100,"column":8,"index":1798},"identifierName":"T22"}, + "name": "T22" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1798,"end":1812,"loc":{"start":{"line":100,"column":8,"index":1798},"end":{"line":100,"column":22,"index":1812}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1799,"end":1811,"loc":{"start":{"line":100,"column":9,"index":1799},"end":{"line":100,"column":21,"index":1811}}, + "in": true, + "out": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1815,"end":1816,"loc":{"start":{"line":100,"column":25,"index":1815},"end":{"line":100,"column":26,"index":1816}}, + "typeName": { + "type": "Identifier", + "start":1815,"end":1816,"loc":{"start":{"line":100,"column":25,"index":1815},"end":{"line":100,"column":26,"index":1816},"identifierName":"T"}, + "name": "T" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1819,"end":1827,"loc":{"start":{"line":100,"column":29,"index":1819},"end":{"line":100,"column":37,"index":1827}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1781,"end":1789,"loc":{"start":{"line":99,"column":28,"index":1781},"end":{"line":99,"column":36,"index":1789}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":1828,"end":1851,"loc":{"start":{"line":101,"column":0,"index":1828},"end":{"line":101,"column":23,"index":1851}}, + "id": { + "type": "Identifier", + "start":1833,"end":1836,"loc":{"start":{"line":101,"column":5,"index":1833},"end":{"line":101,"column":8,"index":1836},"identifierName":"T23"}, + "name": "T23" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1836,"end":1846,"loc":{"start":{"line":101,"column":8,"index":1836},"end":{"line":101,"column":18,"index":1846}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1837,"end":1845,"loc":{"start":{"line":101,"column":9,"index":1837},"end":{"line":101,"column":17,"index":1845}}, + "out": true, + "in": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1849,"end":1850,"loc":{"start":{"line":101,"column":21,"index":1849},"end":{"line":101,"column":22,"index":1850}}, + "typeName": { + "type": "Identifier", + "start":1849,"end":1850,"loc":{"start":{"line":101,"column":21,"index":1849},"end":{"line":101,"column":22,"index":1850},"identifierName":"T"}, + "name": "T" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1853,"end":1861,"loc":{"start":{"line":101,"column":25,"index":1853},"end":{"line":101,"column":33,"index":1861}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1819,"end":1827,"loc":{"start":{"line":100,"column":29,"index":1819},"end":{"line":100,"column":37,"index":1827}} + } + ] + }, + { + "type": "TSDeclareFunction", + "start":1863,"end":1901,"loc":{"start":{"line":103,"column":0,"index":1863},"end":{"line":103,"column":38,"index":1901}}, + "declare": true, + "id": { + "type": "Identifier", + "start":1880,"end":1882,"loc":{"start":{"line":103,"column":17,"index":1880},"end":{"line":103,"column":19,"index":1882},"identifierName":"f1"}, + "name": "f1" + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1882,"end":1888,"loc":{"start":{"line":103,"column":19,"index":1882},"end":{"line":103,"column":25,"index":1888}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1883,"end":1887,"loc":{"start":{"line":103,"column":20,"index":1883},"end":{"line":103,"column":24,"index":1887}}, + "in": true, + "name": "T" + } + ] + }, + "params": [ + { + "type": "Identifier", + "start":1889,"end":1893,"loc":{"start":{"line":103,"column":26,"index":1889},"end":{"line":103,"column":30,"index":1893},"identifierName":"x"}, + "name": "x", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1890,"end":1893,"loc":{"start":{"line":103,"column":27,"index":1890},"end":{"line":103,"column":30,"index":1893}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1892,"end":1893,"loc":{"start":{"line":103,"column":29,"index":1892},"end":{"line":103,"column":30,"index":1893}}, + "typeName": { + "type": "Identifier", + "start":1892,"end":1893,"loc":{"start":{"line":103,"column":29,"index":1892},"end":{"line":103,"column":30,"index":1893},"identifierName":"T"}, + "name": "T" + } + } + } + } + ], + "returnType": { + "type": "TSTypeAnnotation", + "start":1894,"end":1900,"loc":{"start":{"line":103,"column":31,"index":1894},"end":{"line":103,"column":37,"index":1900}}, + "typeAnnotation": { + "type": "TSVoidKeyword", + "start":1896,"end":1900,"loc":{"start":{"line":103,"column":33,"index":1896},"end":{"line":103,"column":37,"index":1900}} + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1903,"end":1911,"loc":{"start":{"line":103,"column":40,"index":1903},"end":{"line":103,"column":48,"index":1911}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1853,"end":1861,"loc":{"start":{"line":101,"column":25,"index":1853},"end":{"line":101,"column":33,"index":1861}} + } + ] + }, + { + "type": "TSDeclareFunction", + "start":1912,"end":1944,"loc":{"start":{"line":104,"column":0,"index":1912},"end":{"line":104,"column":32,"index":1944}}, + "declare": true, + "id": { + "type": "Identifier", + "start":1929,"end":1931,"loc":{"start":{"line":104,"column":17,"index":1929},"end":{"line":104,"column":19,"index":1931},"identifierName":"f2"}, + "name": "f2" + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1931,"end":1938,"loc":{"start":{"line":104,"column":19,"index":1931},"end":{"line":104,"column":26,"index":1938}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1932,"end":1937,"loc":{"start":{"line":104,"column":20,"index":1932},"end":{"line":104,"column":25,"index":1937}}, + "out": true, + "name": "T" + } + ] + }, + "params": [], + "returnType": { + "type": "TSTypeAnnotation", + "start":1940,"end":1943,"loc":{"start":{"line":104,"column":28,"index":1940},"end":{"line":104,"column":31,"index":1943}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1942,"end":1943,"loc":{"start":{"line":104,"column":30,"index":1942},"end":{"line":104,"column":31,"index":1943}}, + "typeName": { + "type": "Identifier", + "start":1942,"end":1943,"loc":{"start":{"line":104,"column":30,"index":1942},"end":{"line":104,"column":31,"index":1943},"identifierName":"T"}, + "name": "T" + } + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1946,"end":1954,"loc":{"start":{"line":104,"column":34,"index":1946},"end":{"line":104,"column":42,"index":1954}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1903,"end":1911,"loc":{"start":{"line":103,"column":40,"index":1903},"end":{"line":103,"column":48,"index":1911}} + } + ] + }, + { + "type": "ClassDeclaration", + "start":1956,"end":2016,"loc":{"start":{"line":106,"column":0,"index":1956},"end":{"line":109,"column":1,"index":2016}}, + "id": { + "type": "Identifier", + "start":1962,"end":1963,"loc":{"start":{"line":106,"column":6,"index":1962},"end":{"line":106,"column":7,"index":1963},"identifierName":"C"}, + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start":1964,"end":2016,"loc":{"start":{"line":106,"column":8,"index":1964},"end":{"line":109,"column":1,"index":2016}}, + "body": [ + { + "type": "ClassProperty", + "start":1970,"end":1979,"loc":{"start":{"line":107,"column":4,"index":1970},"end":{"line":107,"column":13,"index":1979}}, + "in": true, + "static": false, + "key": { + "type": "Identifier", + "start":1973,"end":1974,"loc":{"start":{"line":107,"column":7,"index":1973},"end":{"line":107,"column":8,"index":1974},"identifierName":"a"}, + "name": "a" + }, + "computed": false, + "value": { + "type": "NumericLiteral", + "start":1977,"end":1978,"loc":{"start":{"line":107,"column":11,"index":1977},"end":{"line":107,"column":12,"index":1978}}, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1981,"end":1989,"loc":{"start":{"line":107,"column":15,"index":1981},"end":{"line":107,"column":23,"index":1989}} + } + ] + }, + { + "type": "ClassProperty", + "start":1994,"end":2004,"loc":{"start":{"line":108,"column":4,"index":1994},"end":{"line":108,"column":14,"index":2004}}, + "out": true, + "static": false, + "key": { + "type": "Identifier", + "start":1998,"end":1999,"loc":{"start":{"line":108,"column":8,"index":1998},"end":{"line":108,"column":9,"index":1999},"identifierName":"b"}, + "name": "b" + }, + "computed": false, + "value": { + "type": "NumericLiteral", + "start":2002,"end":2003,"loc":{"start":{"line":108,"column":12,"index":2002},"end":{"line":108,"column":13,"index":2003}}, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":2006,"end":2014,"loc":{"start":{"line":108,"column":16,"index":2006},"end":{"line":108,"column":24,"index":2014}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1981,"end":1989,"loc":{"start":{"line":107,"column":15,"index":1981},"end":{"line":107,"column":23,"index":1989}} + } + ] + } + ] + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Interface merging", + "start":2018,"end":2038,"loc":{"start":{"line":111,"column":0,"index":2018},"end":{"line":111,"column":20,"index":2038}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1946,"end":1954,"loc":{"start":{"line":104,"column":34,"index":1946},"end":{"line":104,"column":42,"index":1954}} + } + ] + }, + { + "type": "TSInterfaceDeclaration", + "start":2040,"end":2063,"loc":{"start":{"line":113,"column":0,"index":2040},"end":{"line":113,"column":23,"index":2063}}, + "id": { + "type": "Identifier", + "start":2050,"end":2053,"loc":{"start":{"line":113,"column":10,"index":2050},"end":{"line":113,"column":13,"index":2053},"identifierName":"Baz"}, + "name": "Baz" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":2053,"end":2060,"loc":{"start":{"line":113,"column":13,"index":2053},"end":{"line":113,"column":20,"index":2060}}, + "params": [ + { + "type": "TSTypeParameter", + "start":2054,"end":2059,"loc":{"start":{"line":113,"column":14,"index":2054},"end":{"line":113,"column":19,"index":2059}}, + "out": true, + "name": "T" + } + ] + }, + "body": { + "type": "TSInterfaceBody", + "start":2061,"end":2063,"loc":{"start":{"line":113,"column":21,"index":2061},"end":{"line":113,"column":23,"index":2063}}, + "body": [] + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Interface merging", + "start":2018,"end":2038,"loc":{"start":{"line":111,"column":0,"index":2018},"end":{"line":111,"column":20,"index":2038}} + } + ] + }, + { + "type": "TSInterfaceDeclaration", + "start":2064,"end":2086,"loc":{"start":{"line":114,"column":0,"index":2064},"end":{"line":114,"column":22,"index":2086}}, + "id": { + "type": "Identifier", + "start":2074,"end":2077,"loc":{"start":{"line":114,"column":10,"index":2074},"end":{"line":114,"column":13,"index":2077},"identifierName":"Baz"}, + "name": "Baz" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":2077,"end":2083,"loc":{"start":{"line":114,"column":13,"index":2077},"end":{"line":114,"column":19,"index":2083}}, + "params": [ + { + "type": "TSTypeParameter", + "start":2078,"end":2082,"loc":{"start":{"line":114,"column":14,"index":2078},"end":{"line":114,"column":18,"index":2082}}, + "in": true, + "name": "T" + } + ] + }, + "body": { + "type": "TSInterfaceBody", + "start":2084,"end":2086,"loc":{"start":{"line":114,"column":20,"index":2084},"end":{"line":114,"column":22,"index":2086}}, + "body": [] + } + }, + { + "type": "VariableDeclaration", + "start":2088,"end":2119,"loc":{"start":{"line":116,"column":0,"index":2088},"end":{"line":116,"column":31,"index":2119}}, + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "start":2100,"end":2118,"loc":{"start":{"line":116,"column":12,"index":2100},"end":{"line":116,"column":30,"index":2118}}, + "id": { + "type": "Identifier", + "start":2100,"end":2118,"loc":{"start":{"line":116,"column":12,"index":2100},"end":{"line":116,"column":30,"index":2118},"identifierName":"baz1"}, + "name": "baz1", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2104,"end":2118,"loc":{"start":{"line":116,"column":16,"index":2104},"end":{"line":116,"column":30,"index":2118}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2106,"end":2118,"loc":{"start":{"line":116,"column":18,"index":2106},"end":{"line":116,"column":30,"index":2118}}, + "typeName": { + "type": "Identifier", + "start":2106,"end":2109,"loc":{"start":{"line":116,"column":18,"index":2106},"end":{"line":116,"column":21,"index":2109},"identifierName":"Baz"}, + "name": "Baz" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2109,"end":2118,"loc":{"start":{"line":116,"column":21,"index":2109},"end":{"line":116,"column":30,"index":2118}}, + "params": [ + { + "type": "TSUnknownKeyword", + "start":2110,"end":2117,"loc":{"start":{"line":116,"column":22,"index":2110},"end":{"line":116,"column":29,"index":2117}} + } + ] + } + } + } + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "VariableDeclaration", + "start":2120,"end":2150,"loc":{"start":{"line":117,"column":0,"index":2120},"end":{"line":117,"column":30,"index":2150}}, + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "start":2132,"end":2149,"loc":{"start":{"line":117,"column":12,"index":2132},"end":{"line":117,"column":29,"index":2149}}, + "id": { + "type": "Identifier", + "start":2132,"end":2149,"loc":{"start":{"line":117,"column":12,"index":2132},"end":{"line":117,"column":29,"index":2149},"identifierName":"baz2"}, + "name": "baz2", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2136,"end":2149,"loc":{"start":{"line":117,"column":16,"index":2136},"end":{"line":117,"column":29,"index":2149}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2138,"end":2149,"loc":{"start":{"line":117,"column":18,"index":2138},"end":{"line":117,"column":29,"index":2149}}, + "typeName": { + "type": "Identifier", + "start":2138,"end":2141,"loc":{"start":{"line":117,"column":18,"index":2138},"end":{"line":117,"column":21,"index":2141},"identifierName":"Baz"}, + "name": "Baz" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2141,"end":2149,"loc":{"start":{"line":117,"column":21,"index":2141},"end":{"line":117,"column":29,"index":2149}}, + "params": [ + { + "type": "TSStringKeyword", + "start":2142,"end":2148,"loc":{"start":{"line":117,"column":22,"index":2142},"end":{"line":117,"column":28,"index":2148}} + } + ] + } + } + } + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "ExpressionStatement", + "start":2152,"end":2164,"loc":{"start":{"line":119,"column":0,"index":2152},"end":{"line":119,"column":12,"index":2164}}, + "expression": { + "type": "AssignmentExpression", + "start":2152,"end":2163,"loc":{"start":{"line":119,"column":0,"index":2152},"end":{"line":119,"column":11,"index":2163}}, + "operator": "=", + "left": { + "type": "Identifier", + "start":2152,"end":2156,"loc":{"start":{"line":119,"column":0,"index":2152},"end":{"line":119,"column":4,"index":2156},"identifierName":"baz1"}, + "name": "baz1" + }, + "right": { + "type": "Identifier", + "start":2159,"end":2163,"loc":{"start":{"line":119,"column":7,"index":2159},"end":{"line":119,"column":11,"index":2163},"identifierName":"baz2"}, + "name": "baz2" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":2166,"end":2174,"loc":{"start":{"line":119,"column":14,"index":2166},"end":{"line":119,"column":22,"index":2174}} + } + ] + }, + { + "type": "ExpressionStatement", + "start":2175,"end":2187,"loc":{"start":{"line":120,"column":0,"index":2175},"end":{"line":120,"column":12,"index":2187}}, + "expression": { + "type": "AssignmentExpression", + "start":2175,"end":2186,"loc":{"start":{"line":120,"column":0,"index":2175},"end":{"line":120,"column":11,"index":2186}}, + "operator": "=", + "left": { + "type": "Identifier", + "start":2175,"end":2179,"loc":{"start":{"line":120,"column":0,"index":2175},"end":{"line":120,"column":4,"index":2179},"identifierName":"baz2"}, + "name": "baz2" + }, + "right": { + "type": "Identifier", + "start":2182,"end":2186,"loc":{"start":{"line":120,"column":7,"index":2182},"end":{"line":120,"column":11,"index":2186},"identifierName":"baz1"}, + "name": "baz1" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":2189,"end":2197,"loc":{"start":{"line":120,"column":14,"index":2189},"end":{"line":120,"column":22,"index":2197}} + }, + { + "type": "CommentLine", + "value": " Repro from #44572", + "start":2199,"end":2219,"loc":{"start":{"line":122,"column":0,"index":2199},"end":{"line":122,"column":20,"index":2219}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":2166,"end":2174,"loc":{"start":{"line":119,"column":14,"index":2166},"end":{"line":119,"column":22,"index":2174}} + } + ] + }, + { + "type": "TSInterfaceDeclaration", + "start":2221,"end":2306,"loc":{"start":{"line":124,"column":0,"index":2221},"end":{"line":127,"column":1,"index":2306}}, + "id": { + "type": "Identifier", + "start":2231,"end":2237,"loc":{"start":{"line":124,"column":10,"index":2231},"end":{"line":124,"column":16,"index":2237},"identifierName":"Parent"}, + "name": "Parent" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":2237,"end":2244,"loc":{"start":{"line":124,"column":16,"index":2237},"end":{"line":124,"column":23,"index":2244}}, + "params": [ + { + "type": "TSTypeParameter", + "start":2238,"end":2243,"loc":{"start":{"line":124,"column":17,"index":2238},"end":{"line":124,"column":22,"index":2243}}, + "out": true, + "name": "A" + } + ] + }, + "body": { + "type": "TSInterfaceBody", + "start":2245,"end":2306,"loc":{"start":{"line":124,"column":24,"index":2245},"end":{"line":127,"column":1,"index":2306}}, + "body": [ + { + "type": "TSPropertySignature", + "start":2251,"end":2274,"loc":{"start":{"line":125,"column":4,"index":2251},"end":{"line":125,"column":27,"index":2274}}, + "key": { + "type": "Identifier", + "start":2251,"end":2256,"loc":{"start":{"line":125,"column":4,"index":2251},"end":{"line":125,"column":9,"index":2256},"identifierName":"child"}, + "name": "child" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2256,"end":2273,"loc":{"start":{"line":125,"column":9,"index":2256},"end":{"line":125,"column":26,"index":2273}}, + "typeAnnotation": { + "type": "TSUnionType", + "start":2258,"end":2273,"loc":{"start":{"line":125,"column":11,"index":2258},"end":{"line":125,"column":26,"index":2273}}, + "types": [ + { + "type": "TSTypeReference", + "start":2258,"end":2266,"loc":{"start":{"line":125,"column":11,"index":2258},"end":{"line":125,"column":19,"index":2266}}, + "typeName": { + "type": "Identifier", + "start":2258,"end":2263,"loc":{"start":{"line":125,"column":11,"index":2258},"end":{"line":125,"column":16,"index":2263},"identifierName":"Child"}, + "name": "Child" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2263,"end":2266,"loc":{"start":{"line":125,"column":16,"index":2263},"end":{"line":125,"column":19,"index":2266}}, + "params": [ + { + "type": "TSTypeReference", + "start":2264,"end":2265,"loc":{"start":{"line":125,"column":17,"index":2264},"end":{"line":125,"column":18,"index":2265}}, + "typeName": { + "type": "Identifier", + "start":2264,"end":2265,"loc":{"start":{"line":125,"column":17,"index":2264},"end":{"line":125,"column":18,"index":2265},"identifierName":"A"}, + "name": "A" + } + } + ] + } + }, + { + "type": "TSNullKeyword", + "start":2269,"end":2273,"loc":{"start":{"line":125,"column":22,"index":2269},"end":{"line":125,"column":26,"index":2273}} + } + ] + } + } + }, + { + "type": "TSPropertySignature", + "start":2279,"end":2304,"loc":{"start":{"line":126,"column":4,"index":2279},"end":{"line":126,"column":29,"index":2304}}, + "key": { + "type": "Identifier", + "start":2279,"end":2285,"loc":{"start":{"line":126,"column":4,"index":2279},"end":{"line":126,"column":10,"index":2285},"identifierName":"parent"}, + "name": "parent" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2285,"end":2303,"loc":{"start":{"line":126,"column":10,"index":2285},"end":{"line":126,"column":28,"index":2303}}, + "typeAnnotation": { + "type": "TSUnionType", + "start":2287,"end":2303,"loc":{"start":{"line":126,"column":12,"index":2287},"end":{"line":126,"column":28,"index":2303}}, + "types": [ + { + "type": "TSTypeReference", + "start":2287,"end":2296,"loc":{"start":{"line":126,"column":12,"index":2287},"end":{"line":126,"column":21,"index":2296}}, + "typeName": { + "type": "Identifier", + "start":2287,"end":2293,"loc":{"start":{"line":126,"column":12,"index":2287},"end":{"line":126,"column":18,"index":2293},"identifierName":"Parent"}, + "name": "Parent" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2293,"end":2296,"loc":{"start":{"line":126,"column":18,"index":2293},"end":{"line":126,"column":21,"index":2296}}, + "params": [ + { + "type": "TSTypeReference", + "start":2294,"end":2295,"loc":{"start":{"line":126,"column":19,"index":2294},"end":{"line":126,"column":20,"index":2295}}, + "typeName": { + "type": "Identifier", + "start":2294,"end":2295,"loc":{"start":{"line":126,"column":19,"index":2294},"end":{"line":126,"column":20,"index":2295},"identifierName":"A"}, + "name": "A" + } + } + ] + } + }, + { + "type": "TSNullKeyword", + "start":2299,"end":2303,"loc":{"start":{"line":126,"column":24,"index":2299},"end":{"line":126,"column":28,"index":2303}} + } + ] + } + } + } + ] + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":2189,"end":2197,"loc":{"start":{"line":120,"column":14,"index":2189},"end":{"line":120,"column":22,"index":2197}} + }, + { + "type": "CommentLine", + "value": " Repro from #44572", + "start":2199,"end":2219,"loc":{"start":{"line":122,"column":0,"index":2199},"end":{"line":122,"column":20,"index":2219}} + } + ] + }, + { + "type": "TSInterfaceDeclaration", + "start":2308,"end":2399,"loc":{"start":{"line":129,"column":0,"index":2308},"end":{"line":132,"column":1,"index":2399}}, + "id": { + "type": "Identifier", + "start":2318,"end":2323,"loc":{"start":{"line":129,"column":10,"index":2318},"end":{"line":129,"column":15,"index":2323},"identifierName":"Child"}, + "name": "Child" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":2323,"end":2339,"loc":{"start":{"line":129,"column":15,"index":2323},"end":{"line":129,"column":31,"index":2339}}, + "params": [ + { + "type": "TSTypeParameter", + "start":2324,"end":2325,"loc":{"start":{"line":129,"column":16,"index":2324},"end":{"line":129,"column":17,"index":2325}}, + "name": "A" + }, + { + "type": "TSTypeParameter", + "start":2327,"end":2338,"loc":{"start":{"line":129,"column":19,"index":2327},"end":{"line":129,"column":30,"index":2338}}, + "name": "B", + "default": { + "type": "TSUnknownKeyword", + "start":2331,"end":2338,"loc":{"start":{"line":129,"column":23,"index":2331},"end":{"line":129,"column":30,"index":2338}} + } + } + ] + }, + "extends": [ + { + "type": "TSExpressionWithTypeArguments", + "start":2348,"end":2357,"loc":{"start":{"line":129,"column":40,"index":2348},"end":{"line":129,"column":49,"index":2357}}, + "expression": { + "type": "Identifier", + "start":2348,"end":2354,"loc":{"start":{"line":129,"column":40,"index":2348},"end":{"line":129,"column":46,"index":2354},"identifierName":"Parent"}, + "name": "Parent" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2354,"end":2357,"loc":{"start":{"line":129,"column":46,"index":2354},"end":{"line":129,"column":49,"index":2357}}, + "params": [ + { + "type": "TSTypeReference", + "start":2355,"end":2356,"loc":{"start":{"line":129,"column":47,"index":2355},"end":{"line":129,"column":48,"index":2356}}, + "typeName": { + "type": "Identifier", + "start":2355,"end":2356,"loc":{"start":{"line":129,"column":47,"index":2355},"end":{"line":129,"column":48,"index":2356},"identifierName":"A"}, + "name": "A" + } + } + ] + } + } + ], + "body": { + "type": "TSInterfaceBody", + "start":2358,"end":2399,"loc":{"start":{"line":129,"column":50,"index":2358},"end":{"line":132,"column":1,"index":2399}}, + "body": [ + { + "type": "TSPropertySignature", + "start":2364,"end":2378,"loc":{"start":{"line":130,"column":4,"index":2364},"end":{"line":130,"column":18,"index":2378}}, + "readonly": true, + "key": { + "type": "Identifier", + "start":2373,"end":2374,"loc":{"start":{"line":130,"column":13,"index":2373},"end":{"line":130,"column":14,"index":2374},"identifierName":"a"}, + "name": "a" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2374,"end":2377,"loc":{"start":{"line":130,"column":14,"index":2374},"end":{"line":130,"column":17,"index":2377}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2376,"end":2377,"loc":{"start":{"line":130,"column":16,"index":2376},"end":{"line":130,"column":17,"index":2377}}, + "typeName": { + "type": "Identifier", + "start":2376,"end":2377,"loc":{"start":{"line":130,"column":16,"index":2376},"end":{"line":130,"column":17,"index":2377},"identifierName":"A"}, + "name": "A" + } + } + } + }, + { + "type": "TSPropertySignature", + "start":2383,"end":2397,"loc":{"start":{"line":131,"column":4,"index":2383},"end":{"line":131,"column":18,"index":2397}}, + "readonly": true, + "key": { + "type": "Identifier", + "start":2392,"end":2393,"loc":{"start":{"line":131,"column":13,"index":2392},"end":{"line":131,"column":14,"index":2393},"identifierName":"b"}, + "name": "b" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2393,"end":2396,"loc":{"start":{"line":131,"column":14,"index":2393},"end":{"line":131,"column":17,"index":2396}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2395,"end":2396,"loc":{"start":{"line":131,"column":16,"index":2395},"end":{"line":131,"column":17,"index":2396}}, + "typeName": { + "type": "Identifier", + "start":2395,"end":2396,"loc":{"start":{"line":131,"column":16,"index":2395},"end":{"line":131,"column":17,"index":2396},"identifierName":"B"}, + "name": "B" + } + } + } + } + ] + } + }, + { + "type": "FunctionDeclaration", + "start":2401,"end":2469,"loc":{"start":{"line":134,"column":0,"index":2401},"end":{"line":136,"column":1,"index":2469}}, + "id": { + "type": "Identifier", + "start":2410,"end":2412,"loc":{"start":{"line":134,"column":9,"index":2410},"end":{"line":134,"column":11,"index":2412},"identifierName":"fn"}, + "name": "fn" + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":2412,"end":2415,"loc":{"start":{"line":134,"column":11,"index":2412},"end":{"line":134,"column":14,"index":2415}}, + "params": [ + { + "type": "TSTypeParameter", + "start":2413,"end":2414,"loc":{"start":{"line":134,"column":12,"index":2413},"end":{"line":134,"column":13,"index":2414}}, + "name": "A" + } + ] + }, + "params": [ + { + "type": "Identifier", + "start":2416,"end":2429,"loc":{"start":{"line":134,"column":15,"index":2416},"end":{"line":134,"column":28,"index":2429},"identifierName":"inp"}, + "name": "inp", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2419,"end":2429,"loc":{"start":{"line":134,"column":18,"index":2419},"end":{"line":134,"column":28,"index":2429}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2421,"end":2429,"loc":{"start":{"line":134,"column":20,"index":2421},"end":{"line":134,"column":28,"index":2429}}, + "typeName": { + "type": "Identifier", + "start":2421,"end":2426,"loc":{"start":{"line":134,"column":20,"index":2421},"end":{"line":134,"column":25,"index":2426},"identifierName":"Child"}, + "name": "Child" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2426,"end":2429,"loc":{"start":{"line":134,"column":25,"index":2426},"end":{"line":134,"column":28,"index":2429}}, + "params": [ + { + "type": "TSTypeReference", + "start":2427,"end":2428,"loc":{"start":{"line":134,"column":26,"index":2427},"end":{"line":134,"column":27,"index":2428}}, + "typeName": { + "type": "Identifier", + "start":2427,"end":2428,"loc":{"start":{"line":134,"column":26,"index":2427},"end":{"line":134,"column":27,"index":2428},"identifierName":"A"}, + "name": "A" + } + } + ] + } + } + } + } + ], + "body": { + "type": "BlockStatement", + "start":2431,"end":2469,"loc":{"start":{"line":134,"column":30,"index":2431},"end":{"line":136,"column":1,"index":2469}}, + "body": [ + { + "type": "VariableDeclaration", + "start":2437,"end":2467,"loc":{"start":{"line":135,"column":4,"index":2437},"end":{"line":135,"column":34,"index":2467}}, + "declarations": [ + { + "type": "VariableDeclarator", + "start":2443,"end":2466,"loc":{"start":{"line":135,"column":10,"index":2443},"end":{"line":135,"column":33,"index":2466}}, + "id": { + "type": "Identifier", + "start":2443,"end":2460,"loc":{"start":{"line":135,"column":10,"index":2443},"end":{"line":135,"column":27,"index":2460},"identifierName":"a"}, + "name": "a", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2444,"end":2460,"loc":{"start":{"line":135,"column":11,"index":2444},"end":{"line":135,"column":27,"index":2460}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2446,"end":2460,"loc":{"start":{"line":135,"column":13,"index":2446},"end":{"line":135,"column":27,"index":2460}}, + "typeName": { + "type": "Identifier", + "start":2446,"end":2451,"loc":{"start":{"line":135,"column":13,"index":2446},"end":{"line":135,"column":18,"index":2451},"identifierName":"Child"}, + "name": "Child" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2451,"end":2460,"loc":{"start":{"line":135,"column":18,"index":2451},"end":{"line":135,"column":27,"index":2460}}, + "params": [ + { + "type": "TSUnknownKeyword", + "start":2452,"end":2459,"loc":{"start":{"line":135,"column":19,"index":2452},"end":{"line":135,"column":26,"index":2459}} + } + ] + } + } + } + }, + "init": { + "type": "Identifier", + "start":2463,"end":2466,"loc":{"start":{"line":135,"column":30,"index":2463},"end":{"line":135,"column":33,"index":2466},"identifierName":"inp"}, + "name": "inp" + } + } + ], + "kind": "const" + } + ], + "directives": [] + } + }, + { + "type": "VariableDeclaration", + "start":2471,"end":2566,"loc":{"start":{"line":138,"column":0,"index":2471},"end":{"line":138,"column":95,"index":2566}}, + "declarations": [ + { + "type": "VariableDeclarator", + "start":2477,"end":2565,"loc":{"start":{"line":138,"column":6,"index":2477},"end":{"line":138,"column":94,"index":2565}}, + "id": { + "type": "Identifier", + "start":2477,"end":2496,"loc":{"start":{"line":138,"column":6,"index":2477},"end":{"line":138,"column":25,"index":2496},"identifierName":"pu"}, + "name": "pu", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2479,"end":2496,"loc":{"start":{"line":138,"column":8,"index":2479},"end":{"line":138,"column":25,"index":2496}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2481,"end":2496,"loc":{"start":{"line":138,"column":10,"index":2481},"end":{"line":138,"column":25,"index":2496}}, + "typeName": { + "type": "Identifier", + "start":2481,"end":2487,"loc":{"start":{"line":138,"column":10,"index":2481},"end":{"line":138,"column":16,"index":2487},"identifierName":"Parent"}, + "name": "Parent" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2487,"end":2496,"loc":{"start":{"line":138,"column":16,"index":2487},"end":{"line":138,"column":25,"index":2496}}, + "params": [ + { + "type": "TSUnknownKeyword", + "start":2488,"end":2495,"loc":{"start":{"line":138,"column":17,"index":2488},"end":{"line":138,"column":24,"index":2495}} + } + ] + } + } + } + }, + "init": { + "type": "ObjectExpression", + "start":2499,"end":2565,"loc":{"start":{"line":138,"column":28,"index":2499},"end":{"line":138,"column":94,"index":2565}}, + "properties": [ + { + "type": "ObjectProperty", + "start":2501,"end":2549,"loc":{"start":{"line":138,"column":30,"index":2501},"end":{"line":138,"column":78,"index":2549}}, + "method": false, + "key": { + "type": "Identifier", + "start":2501,"end":2506,"loc":{"start":{"line":138,"column":30,"index":2501},"end":{"line":138,"column":35,"index":2506},"identifierName":"child"}, + "name": "child" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "ObjectExpression", + "start":2508,"end":2549,"loc":{"start":{"line":138,"column":37,"index":2508},"end":{"line":138,"column":78,"index":2549}}, + "properties": [ + { + "type": "ObjectProperty", + "start":2510,"end":2514,"loc":{"start":{"line":138,"column":39,"index":2510},"end":{"line":138,"column":43,"index":2514}}, + "method": false, + "key": { + "type": "Identifier", + "start":2510,"end":2511,"loc":{"start":{"line":138,"column":39,"index":2510},"end":{"line":138,"column":40,"index":2511},"identifierName":"a"}, + "name": "a" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NumericLiteral", + "start":2513,"end":2514,"loc":{"start":{"line":138,"column":42,"index":2513},"end":{"line":138,"column":43,"index":2514}}, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + { + "type": "ObjectProperty", + "start":2516,"end":2520,"loc":{"start":{"line":138,"column":45,"index":2516},"end":{"line":138,"column":49,"index":2520}}, + "method": false, + "key": { + "type": "Identifier", + "start":2516,"end":2517,"loc":{"start":{"line":138,"column":45,"index":2516},"end":{"line":138,"column":46,"index":2517},"identifierName":"b"}, + "name": "b" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NumericLiteral", + "start":2519,"end":2520,"loc":{"start":{"line":138,"column":48,"index":2519},"end":{"line":138,"column":49,"index":2520}}, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + { + "type": "ObjectProperty", + "start":2522,"end":2533,"loc":{"start":{"line":138,"column":51,"index":2522},"end":{"line":138,"column":62,"index":2533}}, + "method": false, + "key": { + "type": "Identifier", + "start":2522,"end":2527,"loc":{"start":{"line":138,"column":51,"index":2522},"end":{"line":138,"column":56,"index":2527},"identifierName":"child"}, + "name": "child" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NullLiteral", + "start":2529,"end":2533,"loc":{"start":{"line":138,"column":58,"index":2529},"end":{"line":138,"column":62,"index":2533}} + } + }, + { + "type": "ObjectProperty", + "start":2535,"end":2547,"loc":{"start":{"line":138,"column":64,"index":2535},"end":{"line":138,"column":76,"index":2547}}, + "method": false, + "key": { + "type": "Identifier", + "start":2535,"end":2541,"loc":{"start":{"line":138,"column":64,"index":2535},"end":{"line":138,"column":70,"index":2541},"identifierName":"parent"}, + "name": "parent" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NullLiteral", + "start":2543,"end":2547,"loc":{"start":{"line":138,"column":72,"index":2543},"end":{"line":138,"column":76,"index":2547}} + } + } + ] + } + }, + { + "type": "ObjectProperty", + "start":2551,"end":2563,"loc":{"start":{"line":138,"column":80,"index":2551},"end":{"line":138,"column":92,"index":2563}}, + "method": false, + "key": { + "type": "Identifier", + "start":2551,"end":2557,"loc":{"start":{"line":138,"column":80,"index":2551},"end":{"line":138,"column":86,"index":2557},"identifierName":"parent"}, + "name": "parent" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NullLiteral", + "start":2559,"end":2563,"loc":{"start":{"line":138,"column":88,"index":2559},"end":{"line":138,"column":92,"index":2563}} + } + } + ] + } + } + ], + "kind": "const" + }, + { + "type": "VariableDeclaration", + "start":2567,"end":2604,"loc":{"start":{"line":139,"column":0,"index":2567},"end":{"line":139,"column":37,"index":2604}}, + "declarations": [ + { + "type": "VariableDeclarator", + "start":2573,"end":2603,"loc":{"start":{"line":139,"column":6,"index":2573},"end":{"line":139,"column":36,"index":2603}}, + "id": { + "type": "Identifier", + "start":2573,"end":2598,"loc":{"start":{"line":139,"column":6,"index":2573},"end":{"line":139,"column":31,"index":2598},"identifierName":"notString"}, + "name": "notString", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2582,"end":2598,"loc":{"start":{"line":139,"column":15,"index":2582},"end":{"line":139,"column":31,"index":2598}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2584,"end":2598,"loc":{"start":{"line":139,"column":17,"index":2584},"end":{"line":139,"column":31,"index":2598}}, + "typeName": { + "type": "Identifier", + "start":2584,"end":2590,"loc":{"start":{"line":139,"column":17,"index":2584},"end":{"line":139,"column":23,"index":2590},"identifierName":"Parent"}, + "name": "Parent" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2590,"end":2598,"loc":{"start":{"line":139,"column":23,"index":2590},"end":{"line":139,"column":31,"index":2598}}, + "params": [ + { + "type": "TSStringKeyword", + "start":2591,"end":2597,"loc":{"start":{"line":139,"column":24,"index":2591},"end":{"line":139,"column":30,"index":2597}} + } + ] + } + } + } + }, + "init": { + "type": "Identifier", + "start":2601,"end":2603,"loc":{"start":{"line":139,"column":34,"index":2601},"end":{"line":139,"column":36,"index":2603},"identifierName":"pu"}, + "name": "pu" + } + } + ], + "kind": "const", + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":2606,"end":2614,"loc":{"start":{"line":139,"column":39,"index":2606},"end":{"line":139,"column":47,"index":2614}} + }, + { + "type": "CommentLine", + "value": " Repro from comment in #44572", + "start":2616,"end":2647,"loc":{"start":{"line":141,"column":0,"index":2616},"end":{"line":141,"column":31,"index":2647}} + } + ] + }, + { + "type": "ClassDeclaration", + "start":2649,"end":2825,"loc":{"start":{"line":143,"column":0,"index":2649},"end":{"line":147,"column":1,"index":2825}}, + "declare": true, + "id": { + "type": "Identifier", + "start":2663,"end":2672,"loc":{"start":{"line":143,"column":14,"index":2663},"end":{"line":143,"column":23,"index":2672},"identifierName":"StateNode"}, + "name": "StateNode" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":2672,"end":2722,"loc":{"start":{"line":143,"column":23,"index":2672},"end":{"line":143,"column":73,"index":2722}}, + "params": [ + { + "type": "TSTypeParameter", + "start":2673,"end":2681,"loc":{"start":{"line":143,"column":24,"index":2673},"end":{"line":143,"column":32,"index":2681}}, + "name": "TContext" + }, + { + "type": "TSTypeParameter", + "start":2683,"end":2721,"loc":{"start":{"line":143,"column":34,"index":2683},"end":{"line":143,"column":72,"index":2721}}, + "in": true, + "out": true, + "name": "TEvent", + "constraint": { + "type": "TSTypeLiteral", + "start":2705,"end":2721,"loc":{"start":{"line":143,"column":56,"index":2705},"end":{"line":143,"column":72,"index":2721}}, + "members": [ + { + "type": "TSPropertySignature", + "start":2707,"end":2719,"loc":{"start":{"line":143,"column":58,"index":2707},"end":{"line":143,"column":70,"index":2719}}, + "key": { + "type": "Identifier", + "start":2707,"end":2711,"loc":{"start":{"line":143,"column":58,"index":2707},"end":{"line":143,"column":62,"index":2711},"identifierName":"type"}, + "name": "type" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2711,"end":2719,"loc":{"start":{"line":143,"column":62,"index":2711},"end":{"line":143,"column":70,"index":2719}}, + "typeAnnotation": { + "type": "TSStringKeyword", + "start":2713,"end":2719,"loc":{"start":{"line":143,"column":64,"index":2713},"end":{"line":143,"column":70,"index":2719}} + } + } + } + ] + } + } + ] + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start":2723,"end":2825,"loc":{"start":{"line":143,"column":74,"index":2723},"end":{"line":147,"column":1,"index":2825}}, + "body": [ + { + "type": "ClassProperty", + "start":2729,"end":2750,"loc":{"start":{"line":144,"column":4,"index":2729},"end":{"line":144,"column":25,"index":2750}}, + "static": false, + "key": { + "type": "Identifier", + "start":2729,"end":2741,"loc":{"start":{"line":144,"column":4,"index":2729},"end":{"line":144,"column":16,"index":2741},"identifierName":"_storedEvent"}, + "name": "_storedEvent" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2741,"end":2749,"loc":{"start":{"line":144,"column":16,"index":2741},"end":{"line":144,"column":24,"index":2749}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2743,"end":2749,"loc":{"start":{"line":144,"column":18,"index":2743},"end":{"line":144,"column":24,"index":2749}}, + "typeName": { + "type": "Identifier", + "start":2743,"end":2749,"loc":{"start":{"line":144,"column":18,"index":2743},"end":{"line":144,"column":24,"index":2749},"identifierName":"TEvent"}, + "name": "TEvent" + } + } + }, + "value": null + }, + { + "type": "ClassProperty", + "start":2755,"end":2785,"loc":{"start":{"line":145,"column":4,"index":2755},"end":{"line":145,"column":34,"index":2785}}, + "static": false, + "key": { + "type": "Identifier", + "start":2755,"end":2762,"loc":{"start":{"line":145,"column":4,"index":2755},"end":{"line":145,"column":11,"index":2762},"identifierName":"_action"}, + "name": "_action" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2762,"end":2784,"loc":{"start":{"line":145,"column":11,"index":2762},"end":{"line":145,"column":33,"index":2784}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2764,"end":2784,"loc":{"start":{"line":145,"column":13,"index":2764},"end":{"line":145,"column":33,"index":2784}}, + "typeName": { + "type": "Identifier", + "start":2764,"end":2776,"loc":{"start":{"line":145,"column":13,"index":2764},"end":{"line":145,"column":25,"index":2776},"identifierName":"ActionObject"}, + "name": "ActionObject" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2776,"end":2784,"loc":{"start":{"line":145,"column":25,"index":2776},"end":{"line":145,"column":33,"index":2784}}, + "params": [ + { + "type": "TSTypeReference", + "start":2777,"end":2783,"loc":{"start":{"line":145,"column":26,"index":2777},"end":{"line":145,"column":32,"index":2783}}, + "typeName": { + "type": "Identifier", + "start":2777,"end":2783,"loc":{"start":{"line":145,"column":26,"index":2777},"end":{"line":145,"column":32,"index":2783},"identifierName":"TEvent"}, + "name": "TEvent" + } + } + ] + } + } + }, + "value": null + }, + { + "type": "ClassProperty", + "start":2790,"end":2823,"loc":{"start":{"line":146,"column":4,"index":2790},"end":{"line":146,"column":37,"index":2823}}, + "static": false, + "key": { + "type": "Identifier", + "start":2790,"end":2796,"loc":{"start":{"line":146,"column":4,"index":2790},"end":{"line":146,"column":10,"index":2796},"identifierName":"_state"}, + "name": "_state" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2796,"end":2822,"loc":{"start":{"line":146,"column":10,"index":2796},"end":{"line":146,"column":36,"index":2822}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2798,"end":2822,"loc":{"start":{"line":146,"column":12,"index":2798},"end":{"line":146,"column":36,"index":2822}}, + "typeName": { + "type": "Identifier", + "start":2798,"end":2807,"loc":{"start":{"line":146,"column":12,"index":2798},"end":{"line":146,"column":21,"index":2807},"identifierName":"StateNode"}, + "name": "StateNode" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2807,"end":2822,"loc":{"start":{"line":146,"column":21,"index":2807},"end":{"line":146,"column":36,"index":2822}}, + "params": [ + { + "type": "TSTypeReference", + "start":2808,"end":2816,"loc":{"start":{"line":146,"column":22,"index":2808},"end":{"line":146,"column":30,"index":2816}}, + "typeName": { + "type": "Identifier", + "start":2808,"end":2816,"loc":{"start":{"line":146,"column":22,"index":2808},"end":{"line":146,"column":30,"index":2816},"identifierName":"TContext"}, + "name": "TContext" + } + }, + { + "type": "TSAnyKeyword", + "start":2818,"end":2821,"loc":{"start":{"line":146,"column":32,"index":2818},"end":{"line":146,"column":35,"index":2821}} + } + ] + } + } + }, + "value": null + } + ] + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":2606,"end":2614,"loc":{"start":{"line":139,"column":39,"index":2606},"end":{"line":139,"column":47,"index":2614}} + }, + { + "type": "CommentLine", + "value": " Repro from comment in #44572", + "start":2616,"end":2647,"loc":{"start":{"line":141,"column":0,"index":2616},"end":{"line":141,"column":31,"index":2647}} + } + ] + }, + { + "type": "TSInterfaceDeclaration", + "start":2827,"end":2936,"loc":{"start":{"line":149,"column":0,"index":2827},"end":{"line":151,"column":1,"index":2936}}, + "id": { + "type": "Identifier", + "start":2837,"end":2849,"loc":{"start":{"line":149,"column":10,"index":2837},"end":{"line":149,"column":22,"index":2849},"identifierName":"ActionObject"}, + "name": "ActionObject" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":2849,"end":2882,"loc":{"start":{"line":149,"column":22,"index":2849},"end":{"line":149,"column":55,"index":2882}}, + "params": [ + { + "type": "TSTypeParameter", + "start":2850,"end":2881,"loc":{"start":{"line":149,"column":23,"index":2850},"end":{"line":149,"column":54,"index":2881}}, + "name": "TEvent", + "constraint": { + "type": "TSTypeLiteral", + "start":2865,"end":2881,"loc":{"start":{"line":149,"column":38,"index":2865},"end":{"line":149,"column":54,"index":2881}}, + "members": [ + { + "type": "TSPropertySignature", + "start":2867,"end":2879,"loc":{"start":{"line":149,"column":40,"index":2867},"end":{"line":149,"column":52,"index":2879}}, + "key": { + "type": "Identifier", + "start":2867,"end":2871,"loc":{"start":{"line":149,"column":40,"index":2867},"end":{"line":149,"column":44,"index":2871},"identifierName":"type"}, + "name": "type" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2871,"end":2879,"loc":{"start":{"line":149,"column":44,"index":2871},"end":{"line":149,"column":52,"index":2879}}, + "typeAnnotation": { + "type": "TSStringKeyword", + "start":2873,"end":2879,"loc":{"start":{"line":149,"column":46,"index":2873},"end":{"line":149,"column":52,"index":2879}} + } + } + } + ] + } + } + ] + }, + "body": { + "type": "TSInterfaceBody", + "start":2883,"end":2936,"loc":{"start":{"line":149,"column":56,"index":2883},"end":{"line":151,"column":1,"index":2936}}, + "body": [ + { + "type": "TSPropertySignature", + "start":2889,"end":2934,"loc":{"start":{"line":150,"column":4,"index":2889},"end":{"line":150,"column":49,"index":2934}}, + "key": { + "type": "Identifier", + "start":2889,"end":2893,"loc":{"start":{"line":150,"column":4,"index":2889},"end":{"line":150,"column":8,"index":2893},"identifierName":"exec"}, + "name": "exec" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2893,"end":2933,"loc":{"start":{"line":150,"column":8,"index":2893},"end":{"line":150,"column":48,"index":2933}}, + "typeAnnotation": { + "type": "TSFunctionType", + "start":2895,"end":2933,"loc":{"start":{"line":150,"column":10,"index":2895},"end":{"line":150,"column":48,"index":2933}}, + "parameters": [ + { + "type": "Identifier", + "start":2896,"end":2924,"loc":{"start":{"line":150,"column":11,"index":2896},"end":{"line":150,"column":39,"index":2924},"identifierName":"meta"}, + "name": "meta", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2900,"end":2924,"loc":{"start":{"line":150,"column":15,"index":2900},"end":{"line":150,"column":39,"index":2924}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2902,"end":2924,"loc":{"start":{"line":150,"column":17,"index":2902},"end":{"line":150,"column":39,"index":2924}}, + "typeName": { + "type": "Identifier", + "start":2902,"end":2911,"loc":{"start":{"line":150,"column":17,"index":2902},"end":{"line":150,"column":26,"index":2911},"identifierName":"StateNode"}, + "name": "StateNode" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2911,"end":2924,"loc":{"start":{"line":150,"column":26,"index":2911},"end":{"line":150,"column":39,"index":2924}}, + "params": [ + { + "type": "TSAnyKeyword", + "start":2912,"end":2915,"loc":{"start":{"line":150,"column":27,"index":2912},"end":{"line":150,"column":30,"index":2915}} + }, + { + "type": "TSTypeReference", + "start":2917,"end":2923,"loc":{"start":{"line":150,"column":32,"index":2917},"end":{"line":150,"column":38,"index":2923}}, + "typeName": { + "type": "Identifier", + "start":2917,"end":2923,"loc":{"start":{"line":150,"column":32,"index":2917},"end":{"line":150,"column":38,"index":2923},"identifierName":"TEvent"}, + "name": "TEvent" + } + } + ] + } + } + } + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2926,"end":2933,"loc":{"start":{"line":150,"column":41,"index":2926},"end":{"line":150,"column":48,"index":2933}}, + "typeAnnotation": { + "type": "TSVoidKeyword", + "start":2929,"end":2933,"loc":{"start":{"line":150,"column":44,"index":2929},"end":{"line":150,"column":48,"index":2933}} + } + } + } + } + } + ] + } + }, + { + "type": "TSDeclareFunction", + "start":2938,"end":3053,"loc":{"start":{"line":153,"column":0,"index":2938},"end":{"line":153,"column":115,"index":3053}}, + "declare": true, + "id": { + "type": "Identifier", + "start":2955,"end":2968,"loc":{"start":{"line":153,"column":17,"index":2955},"end":{"line":153,"column":30,"index":2968},"identifierName":"createMachine"}, + "name": "createMachine" + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":2968,"end":3001,"loc":{"start":{"line":153,"column":30,"index":2968},"end":{"line":153,"column":63,"index":3001}}, + "params": [ + { + "type": "TSTypeParameter", + "start":2969,"end":3000,"loc":{"start":{"line":153,"column":31,"index":2969},"end":{"line":153,"column":62,"index":3000}}, + "name": "TEvent", + "constraint": { + "type": "TSTypeLiteral", + "start":2984,"end":3000,"loc":{"start":{"line":153,"column":46,"index":2984},"end":{"line":153,"column":62,"index":3000}}, + "members": [ + { + "type": "TSPropertySignature", + "start":2986,"end":2998,"loc":{"start":{"line":153,"column":48,"index":2986},"end":{"line":153,"column":60,"index":2998}}, + "key": { + "type": "Identifier", + "start":2986,"end":2990,"loc":{"start":{"line":153,"column":48,"index":2986},"end":{"line":153,"column":52,"index":2990},"identifierName":"type"}, + "name": "type" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2990,"end":2998,"loc":{"start":{"line":153,"column":52,"index":2990},"end":{"line":153,"column":60,"index":2998}}, + "typeAnnotation": { + "type": "TSStringKeyword", + "start":2992,"end":2998,"loc":{"start":{"line":153,"column":54,"index":2992},"end":{"line":153,"column":60,"index":2998}} + } + } + } + ] + } + } + ] + }, + "params": [ + { + "type": "Identifier", + "start":3002,"end":3030,"loc":{"start":{"line":153,"column":64,"index":3002},"end":{"line":153,"column":92,"index":3030},"identifierName":"action"}, + "name": "action", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3008,"end":3030,"loc":{"start":{"line":153,"column":70,"index":3008},"end":{"line":153,"column":92,"index":3030}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":3010,"end":3030,"loc":{"start":{"line":153,"column":72,"index":3010},"end":{"line":153,"column":92,"index":3030}}, + "typeName": { + "type": "Identifier", + "start":3010,"end":3022,"loc":{"start":{"line":153,"column":72,"index":3010},"end":{"line":153,"column":84,"index":3022},"identifierName":"ActionObject"}, + "name": "ActionObject" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":3022,"end":3030,"loc":{"start":{"line":153,"column":84,"index":3022},"end":{"line":153,"column":92,"index":3030}}, + "params": [ + { + "type": "TSTypeReference", + "start":3023,"end":3029,"loc":{"start":{"line":153,"column":85,"index":3023},"end":{"line":153,"column":91,"index":3029}}, + "typeName": { + "type": "Identifier", + "start":3023,"end":3029,"loc":{"start":{"line":153,"column":85,"index":3023},"end":{"line":153,"column":91,"index":3029},"identifierName":"TEvent"}, + "name": "TEvent" + } + } + ] + } + } + } + } + ], + "returnType": { + "type": "TSTypeAnnotation", + "start":3031,"end":3052,"loc":{"start":{"line":153,"column":93,"index":3031},"end":{"line":153,"column":114,"index":3052}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":3033,"end":3052,"loc":{"start":{"line":153,"column":95,"index":3033},"end":{"line":153,"column":114,"index":3052}}, + "typeName": { + "type": "Identifier", + "start":3033,"end":3042,"loc":{"start":{"line":153,"column":95,"index":3033},"end":{"line":153,"column":104,"index":3042},"identifierName":"StateNode"}, + "name": "StateNode" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":3042,"end":3052,"loc":{"start":{"line":153,"column":104,"index":3042},"end":{"line":153,"column":114,"index":3052}}, + "params": [ + { + "type": "TSAnyKeyword", + "start":3043,"end":3046,"loc":{"start":{"line":153,"column":105,"index":3043},"end":{"line":153,"column":108,"index":3046}} + }, + { + "type": "TSAnyKeyword", + "start":3048,"end":3051,"loc":{"start":{"line":153,"column":110,"index":3048},"end":{"line":153,"column":113,"index":3051}} + } + ] + } + } + } + }, + { + "type": "TSDeclareFunction", + "start":3055,"end":3133,"loc":{"start":{"line":155,"column":0,"index":3055},"end":{"line":155,"column":78,"index":3133}}, + "declare": true, + "id": { + "type": "Identifier", + "start":3072,"end":3081,"loc":{"start":{"line":155,"column":17,"index":3072},"end":{"line":155,"column":26,"index":3081},"identifierName":"interpret"}, + "name": "interpret" + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":3081,"end":3091,"loc":{"start":{"line":155,"column":26,"index":3081},"end":{"line":155,"column":36,"index":3091}}, + "params": [ + { + "type": "TSTypeParameter", + "start":3082,"end":3090,"loc":{"start":{"line":155,"column":27,"index":3082},"end":{"line":155,"column":35,"index":3090}}, + "name": "TContext" + } + ] + }, + "params": [ + { + "type": "Identifier", + "start":3092,"end":3125,"loc":{"start":{"line":155,"column":37,"index":3092},"end":{"line":155,"column":70,"index":3125},"identifierName":"machine"}, + "name": "machine", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3099,"end":3125,"loc":{"start":{"line":155,"column":44,"index":3099},"end":{"line":155,"column":70,"index":3125}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":3101,"end":3125,"loc":{"start":{"line":155,"column":46,"index":3101},"end":{"line":155,"column":70,"index":3125}}, + "typeName": { + "type": "Identifier", + "start":3101,"end":3110,"loc":{"start":{"line":155,"column":46,"index":3101},"end":{"line":155,"column":55,"index":3110},"identifierName":"StateNode"}, + "name": "StateNode" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":3110,"end":3125,"loc":{"start":{"line":155,"column":55,"index":3110},"end":{"line":155,"column":70,"index":3125}}, + "params": [ + { + "type": "TSTypeReference", + "start":3111,"end":3119,"loc":{"start":{"line":155,"column":56,"index":3111},"end":{"line":155,"column":64,"index":3119}}, + "typeName": { + "type": "Identifier", + "start":3111,"end":3119,"loc":{"start":{"line":155,"column":56,"index":3111},"end":{"line":155,"column":64,"index":3119},"identifierName":"TContext"}, + "name": "TContext" + } + }, + { + "type": "TSAnyKeyword", + "start":3121,"end":3124,"loc":{"start":{"line":155,"column":66,"index":3121},"end":{"line":155,"column":69,"index":3124}} + } + ] + } + } + } + } + ], + "returnType": { + "type": "TSTypeAnnotation", + "start":3126,"end":3132,"loc":{"start":{"line":155,"column":71,"index":3126},"end":{"line":155,"column":77,"index":3132}}, + "typeAnnotation": { + "type": "TSVoidKeyword", + "start":3128,"end":3132,"loc":{"start":{"line":155,"column":73,"index":3128},"end":{"line":155,"column":77,"index":3132}} + } + } + }, + { + "type": "VariableDeclaration", + "start":3135,"end":3176,"loc":{"start":{"line":157,"column":0,"index":3135},"end":{"line":157,"column":41,"index":3176}}, + "declarations": [ + { + "type": "VariableDeclarator", + "start":3141,"end":3175,"loc":{"start":{"line":157,"column":6,"index":3141},"end":{"line":157,"column":40,"index":3175}}, + "id": { + "type": "Identifier", + "start":3141,"end":3148,"loc":{"start":{"line":157,"column":6,"index":3141},"end":{"line":157,"column":13,"index":3148},"identifierName":"machine"}, + "name": "machine" + }, + "init": { + "type": "CallExpression", + "start":3151,"end":3175,"loc":{"start":{"line":157,"column":16,"index":3151},"end":{"line":157,"column":40,"index":3175}}, + "callee": { + "type": "Identifier", + "start":3151,"end":3164,"loc":{"start":{"line":157,"column":16,"index":3151},"end":{"line":157,"column":29,"index":3164},"identifierName":"createMachine"}, + "name": "createMachine" + }, + "arguments": [ + { + "type": "TSAsExpression", + "start":3165,"end":3174,"loc":{"start":{"line":157,"column":30,"index":3165},"end":{"line":157,"column":39,"index":3174}}, + "expression": { + "type": "ObjectExpression", + "start":3165,"end":3167,"loc":{"start":{"line":157,"column":30,"index":3165},"end":{"line":157,"column":32,"index":3167}}, + "properties": [] + }, + "typeAnnotation": { + "type": "TSAnyKeyword", + "start":3171,"end":3174,"loc":{"start":{"line":157,"column":36,"index":3171},"end":{"line":157,"column":39,"index":3174}} + } + } + ] + } + } + ], + "kind": "const" + }, + { + "type": "ExpressionStatement", + "start":3178,"end":3197,"loc":{"start":{"line":159,"column":0,"index":3178},"end":{"line":159,"column":19,"index":3197}}, + "expression": { + "type": "CallExpression", + "start":3178,"end":3196,"loc":{"start":{"line":159,"column":0,"index":3178},"end":{"line":159,"column":18,"index":3196}}, + "callee": { + "type": "Identifier", + "start":3178,"end":3187,"loc":{"start":{"line":159,"column":0,"index":3178},"end":{"line":159,"column":9,"index":3187},"identifierName":"interpret"}, + "name": "interpret" + }, + "arguments": [ + { + "type": "Identifier", + "start":3188,"end":3195,"loc":{"start":{"line":159,"column":10,"index":3188},"end":{"line":159,"column":17,"index":3195},"identifierName":"machine"}, + "name": "machine" + } + ] + } + }, + { + "type": "VariableDeclaration", + "start":3199,"end":3263,"loc":{"start":{"line":161,"column":0,"index":3199},"end":{"line":161,"column":64,"index":3263}}, + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "start":3213,"end":3262,"loc":{"start":{"line":161,"column":14,"index":3213},"end":{"line":161,"column":63,"index":3262}}, + "id": { + "type": "Identifier", + "start":3213,"end":3262,"loc":{"start":{"line":161,"column":14,"index":3213},"end":{"line":161,"column":63,"index":3262},"identifierName":"qq"}, + "name": "qq", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3215,"end":3262,"loc":{"start":{"line":161,"column":16,"index":3215},"end":{"line":161,"column":63,"index":3262}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":3217,"end":3262,"loc":{"start":{"line":161,"column":18,"index":3217},"end":{"line":161,"column":63,"index":3262}}, + "typeName": { + "type": "Identifier", + "start":3217,"end":3229,"loc":{"start":{"line":161,"column":18,"index":3217},"end":{"line":161,"column":30,"index":3229},"identifierName":"ActionObject"}, + "name": "ActionObject" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":3229,"end":3262,"loc":{"start":{"line":161,"column":30,"index":3229},"end":{"line":161,"column":63,"index":3262}}, + "params": [ + { + "type": "TSTypeLiteral", + "start":3230,"end":3261,"loc":{"start":{"line":161,"column":31,"index":3230},"end":{"line":161,"column":62,"index":3261}}, + "members": [ + { + "type": "TSPropertySignature", + "start":3232,"end":3245,"loc":{"start":{"line":161,"column":33,"index":3232},"end":{"line":161,"column":46,"index":3245}}, + "key": { + "type": "Identifier", + "start":3232,"end":3236,"loc":{"start":{"line":161,"column":33,"index":3232},"end":{"line":161,"column":37,"index":3236},"identifierName":"type"}, + "name": "type" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3236,"end":3244,"loc":{"start":{"line":161,"column":37,"index":3236},"end":{"line":161,"column":45,"index":3244}}, + "typeAnnotation": { + "type": "TSLiteralType", + "start":3238,"end":3244,"loc":{"start":{"line":161,"column":39,"index":3238},"end":{"line":161,"column":45,"index":3244}}, + "literal": { + "type": "StringLiteral", + "start":3238,"end":3244,"loc":{"start":{"line":161,"column":39,"index":3238},"end":{"line":161,"column":45,"index":3244}}, + "extra": { + "rawValue": "PLAY", + "raw": "\"PLAY\"" + }, + "value": "PLAY" + } + } + } + }, + { + "type": "TSPropertySignature", + "start":3246,"end":3259,"loc":{"start":{"line":161,"column":47,"index":3246},"end":{"line":161,"column":60,"index":3259}}, + "key": { + "type": "Identifier", + "start":3246,"end":3251,"loc":{"start":{"line":161,"column":47,"index":3246},"end":{"line":161,"column":52,"index":3251},"identifierName":"value"}, + "name": "value" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3251,"end":3259,"loc":{"start":{"line":161,"column":52,"index":3251},"end":{"line":161,"column":60,"index":3259}}, + "typeAnnotation": { + "type": "TSNumberKeyword", + "start":3253,"end":3259,"loc":{"start":{"line":161,"column":54,"index":3253},"end":{"line":161,"column":60,"index":3259}} + } + } + } + ] + } + ] + } + } + } + }, + "init": null + } + ], + "kind": "const" + }, + { + "type": "ExpressionStatement", + "start":3265,"end":3336,"loc":{"start":{"line":163,"column":0,"index":3265},"end":{"line":163,"column":71,"index":3336}}, + "expression": { + "type": "CallExpression", + "start":3265,"end":3335,"loc":{"start":{"line":163,"column":0,"index":3265},"end":{"line":163,"column":70,"index":3335}}, + "callee": { + "type": "Identifier", + "start":3265,"end":3278,"loc":{"start":{"line":163,"column":0,"index":3265},"end":{"line":163,"column":13,"index":3278},"identifierName":"createMachine"}, + "name": "createMachine" + }, + "arguments": [ + { + "type": "Identifier", + "start":3332,"end":3334,"loc":{"start":{"line":163,"column":67,"index":3332},"end":{"line":163,"column":69,"index":3334},"identifierName":"qq"}, + "name": "qq" + } + ], + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":3278,"end":3331,"loc":{"start":{"line":163,"column":13,"index":3278},"end":{"line":163,"column":66,"index":3331}}, + "params": [ + { + "type": "TSUnionType", + "start":3279,"end":3330,"loc":{"start":{"line":163,"column":14,"index":3279},"end":{"line":163,"column":65,"index":3330}}, + "types": [ + { + "type": "TSTypeLiteral", + "start":3279,"end":3310,"loc":{"start":{"line":163,"column":14,"index":3279},"end":{"line":163,"column":45,"index":3310}}, + "members": [ + { + "type": "TSPropertySignature", + "start":3281,"end":3294,"loc":{"start":{"line":163,"column":16,"index":3281},"end":{"line":163,"column":29,"index":3294}}, + "key": { + "type": "Identifier", + "start":3281,"end":3285,"loc":{"start":{"line":163,"column":16,"index":3281},"end":{"line":163,"column":20,"index":3285},"identifierName":"type"}, + "name": "type" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3285,"end":3293,"loc":{"start":{"line":163,"column":20,"index":3285},"end":{"line":163,"column":28,"index":3293}}, + "typeAnnotation": { + "type": "TSLiteralType", + "start":3287,"end":3293,"loc":{"start":{"line":163,"column":22,"index":3287},"end":{"line":163,"column":28,"index":3293}}, + "literal": { + "type": "StringLiteral", + "start":3287,"end":3293,"loc":{"start":{"line":163,"column":22,"index":3287},"end":{"line":163,"column":28,"index":3293}}, + "extra": { + "rawValue": "PLAY", + "raw": "\"PLAY\"" + }, + "value": "PLAY" + } + } + } + }, + { + "type": "TSPropertySignature", + "start":3295,"end":3308,"loc":{"start":{"line":163,"column":30,"index":3295},"end":{"line":163,"column":43,"index":3308}}, + "key": { + "type": "Identifier", + "start":3295,"end":3300,"loc":{"start":{"line":163,"column":30,"index":3295},"end":{"line":163,"column":35,"index":3300},"identifierName":"value"}, + "name": "value" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3300,"end":3308,"loc":{"start":{"line":163,"column":35,"index":3300},"end":{"line":163,"column":43,"index":3308}}, + "typeAnnotation": { + "type": "TSNumberKeyword", + "start":3302,"end":3308,"loc":{"start":{"line":163,"column":37,"index":3302},"end":{"line":163,"column":43,"index":3308}} + } + } + } + ] + }, + { + "type": "TSTypeLiteral", + "start":3313,"end":3330,"loc":{"start":{"line":163,"column":48,"index":3313},"end":{"line":163,"column":65,"index":3330}}, + "members": [ + { + "type": "TSPropertySignature", + "start":3315,"end":3328,"loc":{"start":{"line":163,"column":50,"index":3315},"end":{"line":163,"column":63,"index":3328}}, + "key": { + "type": "Identifier", + "start":3315,"end":3319,"loc":{"start":{"line":163,"column":50,"index":3315},"end":{"line":163,"column":54,"index":3319},"identifierName":"type"}, + "name": "type" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3319,"end":3328,"loc":{"start":{"line":163,"column":54,"index":3319},"end":{"line":163,"column":63,"index":3328}}, + "typeAnnotation": { + "type": "TSLiteralType", + "start":3321,"end":3328,"loc":{"start":{"line":163,"column":56,"index":3321},"end":{"line":163,"column":63,"index":3328}}, + "literal": { + "type": "StringLiteral", + "start":3321,"end":3328,"loc":{"start":{"line":163,"column":56,"index":3321},"end":{"line":163,"column":63,"index":3328}}, + "extra": { + "rawValue": "RESET", + "raw": "\"RESET\"" + }, + "value": "RESET" + } + } + } + } + ] + } + ] + } + ] + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":3338,"end":3346,"loc":{"start":{"line":163,"column":73,"index":3338},"end":{"line":163,"column":81,"index":3346}} + } + ] + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": " valid JSX", + "start":0,"end":12,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":12,"index":12}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":237,"end":245,"loc":{"start":{"line":12,"column":34,"index":237},"end":{"line":12,"column":42,"index":245}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":456,"end":464,"loc":{"start":{"line":21,"column":42,"index":456},"end":{"line":21,"column":50,"index":464}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":689,"end":697,"loc":{"start":{"line":31,"column":34,"index":689},"end":{"line":31,"column":42,"index":697}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":732,"end":740,"loc":{"start":{"line":32,"column":34,"index":732},"end":{"line":32,"column":42,"index":740}} + }, + { + "type": "CommentLine", + "value": " Variance of various type constructors", + "start":742,"end":782,"loc":{"start":{"line":34,"column":0,"index":742},"end":{"line":34,"column":40,"index":782}} + }, + { + "type": "CommentLine", + "value": " Variance annotation errors", + "start":912,"end":941,"loc":{"start":{"line":41,"column":0,"index":912},"end":{"line":41,"column":29,"index":941}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":970,"end":978,"loc":{"start":{"line":43,"column":27,"index":970},"end":{"line":43,"column":35,"index":978}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1031,"end":1039,"loc":{"start":{"line":47,"column":39,"index":1031},"end":{"line":47,"column":47,"index":1039}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1073,"end":1081,"loc":{"start":{"line":49,"column":32,"index":1073},"end":{"line":49,"column":40,"index":1081}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1135,"end":1143,"loc":{"start":{"line":53,"column":27,"index":1135},"end":{"line":53,"column":35,"index":1143}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1195,"end":1203,"loc":{"start":{"line":57,"column":28,"index":1195},"end":{"line":57,"column":36,"index":1203}} + }, + { + "type": "CommentLine", + "value": " Variance in circular types", + "start":1227,"end":1256,"loc":{"start":{"line":61,"column":0,"index":1227},"end":{"line":61,"column":29,"index":1256}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1279,"end":1287,"loc":{"start":{"line":63,"column":21,"index":1279},"end":{"line":63,"column":29,"index":1287}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1427,"end":1435,"loc":{"start":{"line":74,"column":22,"index":1427},"end":{"line":74,"column":30,"index":1435}} + }, + { + "type": "CommentLine", + "value": " Wrong modifier usage", + "start":1694,"end":1717,"loc":{"start":{"line":96,"column":0,"index":1694},"end":{"line":96,"column":23,"index":1717}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1744,"end":1752,"loc":{"start":{"line":98,"column":25,"index":1744},"end":{"line":98,"column":33,"index":1752}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1781,"end":1789,"loc":{"start":{"line":99,"column":28,"index":1781},"end":{"line":99,"column":36,"index":1789}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1819,"end":1827,"loc":{"start":{"line":100,"column":29,"index":1819},"end":{"line":100,"column":37,"index":1827}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1853,"end":1861,"loc":{"start":{"line":101,"column":25,"index":1853},"end":{"line":101,"column":33,"index":1861}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1903,"end":1911,"loc":{"start":{"line":103,"column":40,"index":1903},"end":{"line":103,"column":48,"index":1911}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1946,"end":1954,"loc":{"start":{"line":104,"column":34,"index":1946},"end":{"line":104,"column":42,"index":1954}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1981,"end":1989,"loc":{"start":{"line":107,"column":15,"index":1981},"end":{"line":107,"column":23,"index":1989}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":2006,"end":2014,"loc":{"start":{"line":108,"column":16,"index":2006},"end":{"line":108,"column":24,"index":2014}} + }, + { + "type": "CommentLine", + "value": " Interface merging", + "start":2018,"end":2038,"loc":{"start":{"line":111,"column":0,"index":2018},"end":{"line":111,"column":20,"index":2038}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":2166,"end":2174,"loc":{"start":{"line":119,"column":14,"index":2166},"end":{"line":119,"column":22,"index":2174}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":2189,"end":2197,"loc":{"start":{"line":120,"column":14,"index":2189},"end":{"line":120,"column":22,"index":2197}} + }, + { + "type": "CommentLine", + "value": " Repro from #44572", + "start":2199,"end":2219,"loc":{"start":{"line":122,"column":0,"index":2199},"end":{"line":122,"column":20,"index":2219}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":2606,"end":2614,"loc":{"start":{"line":139,"column":39,"index":2606},"end":{"line":139,"column":47,"index":2614}} + }, + { + "type": "CommentLine", + "value": " Repro from comment in #44572", + "start":2616,"end":2647,"loc":{"start":{"line":141,"column":0,"index":2616},"end":{"line":141,"column":31,"index":2647}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":3338,"end":3346,"loc":{"start":{"line":163,"column":73,"index":3338},"end":{"line":163,"column":81,"index":3346}} + } + ] +} diff --git a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx/options.json b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx/options.json index dd8a3a5c8749..2aa729f27600 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx/options.json +++ b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx/options.json @@ -1,4 +1,7 @@ { - "BABEL_8_BREAKING": false, - "plugins": ["jsx", "typescript"] + "BABEL_8_BREAKING": true, + "plugins": [ + "jsx", + "typescript" + ] } diff --git a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx/output.json b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx/output.json index 1c4773d8258a..6bb0f8b66fea 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx/output.json @@ -2,6 +2,7 @@ "type": "File", "start":0,"end":3346,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":163,"column":81,"index":3346}}, "errors": [ + "SyntaxError: Unexpected token `>`. Did you mean `>` or `{'>'}`? (2:10)", "SyntaxError: 'public' modifier cannot appear on a type parameter. (98:9)", "SyntaxError: Duplicate modifier: 'in'. (99:16)", "SyntaxError: 'in' modifier must precede 'out' modifier. (99:16)", @@ -99,7 +100,11 @@ "type": "TSTypeParameter", "start":50,"end":55,"loc":{"start":{"line":4,"column":15,"index":50},"end":{"line":4,"column":20,"index":55}}, "out": true, - "name": "T" + "name": { + "type": "Identifier", + "start":54,"end":55,"loc":{"start":{"line":4,"column":19,"index":54},"end":{"line":4,"column":20,"index":55},"identifierName":"T"}, + "name": "T" + } } ] }, @@ -276,7 +281,11 @@ "type": "TSTypeParameter", "start":266,"end":270,"loc":{"start":{"line":14,"column":19,"index":266},"end":{"line":14,"column":23,"index":270}}, "in": true, - "name": "T" + "name": { + "type": "Identifier", + "start":269,"end":270,"loc":{"start":{"line":14,"column":22,"index":269},"end":{"line":14,"column":23,"index":270},"identifierName":"T"}, + "name": "T" + } } ] }, @@ -299,7 +308,7 @@ "typeAnnotation": { "type": "TSFunctionType", "start":283,"end":297,"loc":{"start":{"line":15,"column":7,"index":283},"end":{"line":15,"column":21,"index":297}}, - "parameters": [ + "params": [ { "type": "Identifier", "start":284,"end":288,"loc":{"start":{"line":15,"column":8,"index":284},"end":{"line":15,"column":12,"index":288},"identifierName":"x"}, @@ -319,7 +328,7 @@ } } ], - "typeAnnotation": { + "returnType": { "type": "TSTypeAnnotation", "start":290,"end":297,"loc":{"start":{"line":15,"column":14,"index":290},"end":{"line":15,"column":21,"index":297}}, "typeAnnotation": { @@ -491,7 +500,11 @@ "start":522,"end":530,"loc":{"start":{"line":24,"column":15,"index":522},"end":{"line":24,"column":23,"index":530}}, "in": true, "out": true, - "name": "T" + "name": { + "type": "Identifier", + "start":529,"end":530,"loc":{"start":{"line":24,"column":22,"index":529},"end":{"line":24,"column":23,"index":530},"identifierName":"T"}, + "name": "T" + } } ] }, @@ -514,7 +527,7 @@ "typeAnnotation": { "type": "TSFunctionType", "start":543,"end":554,"loc":{"start":{"line":25,"column":7,"index":543},"end":{"line":25,"column":18,"index":554}}, - "parameters": [ + "params": [ { "type": "Identifier", "start":544,"end":548,"loc":{"start":{"line":25,"column":8,"index":544},"end":{"line":25,"column":12,"index":548},"identifierName":"x"}, @@ -534,7 +547,7 @@ } } ], - "typeAnnotation": { + "returnType": { "type": "TSTypeAnnotation", "start":550,"end":554,"loc":{"start":{"line":25,"column":14,"index":550},"end":{"line":25,"column":18,"index":554}}, "typeAnnotation": { @@ -715,7 +728,11 @@ "type": "TSTypeParameter", "start":793,"end":798,"loc":{"start":{"line":36,"column":9,"index":793},"end":{"line":36,"column":14,"index":798}}, "out": true, - "name": "T" + "name": { + "type": "Identifier", + "start":797,"end":798,"loc":{"start":{"line":36,"column":13,"index":797},"end":{"line":36,"column":14,"index":798},"identifierName":"T"}, + "name": "T" + } } ] }, @@ -757,7 +774,11 @@ "type": "TSTypeParameter", "start":814,"end":818,"loc":{"start":{"line":37,"column":9,"index":814},"end":{"line":37,"column":13,"index":818}}, "in": true, - "name": "T" + "name": { + "type": "Identifier", + "start":817,"end":818,"loc":{"start":{"line":37,"column":12,"index":817},"end":{"line":37,"column":13,"index":818},"identifierName":"T"}, + "name": "T" + } } ] }, @@ -792,13 +813,21 @@ "type": "TSTypeParameter", "start":840,"end":845,"loc":{"start":{"line":38,"column":9,"index":840},"end":{"line":38,"column":14,"index":845}}, "out": true, - "name": "T" + "name": { + "type": "Identifier", + "start":844,"end":845,"loc":{"start":{"line":38,"column":13,"index":844},"end":{"line":38,"column":14,"index":845},"identifierName":"T"}, + "name": "T" + } }, { "type": "TSTypeParameter", "start":847,"end":868,"loc":{"start":{"line":38,"column":16,"index":847},"end":{"line":38,"column":37,"index":868}}, "out": true, - "name": "K", + "name": { + "type": "Identifier", + "start":851,"end":852,"loc":{"start":{"line":38,"column":20,"index":851},"end":{"line":38,"column":21,"index":852},"identifierName":"K"}, + "name": "K" + }, "constraint": { "type": "TSTypeOperator", "start":861,"end":868,"loc":{"start":{"line":38,"column":30,"index":861},"end":{"line":38,"column":37,"index":868}}, @@ -856,7 +885,11 @@ "start":887,"end":895,"loc":{"start":{"line":39,"column":9,"index":887},"end":{"line":39,"column":17,"index":895}}, "in": true, "out": true, - "name": "T" + "name": { + "type": "Identifier", + "start":894,"end":895,"loc":{"start":{"line":39,"column":16,"index":894},"end":{"line":39,"column":17,"index":895},"identifierName":"T"}, + "name": "T" + } } ] }, @@ -911,7 +944,11 @@ "type": "TSTypeParameter", "start":959,"end":963,"loc":{"start":{"line":43,"column":16,"index":959},"end":{"line":43,"column":20,"index":963}}, "in": true, - "name": "T" + "name": { + "type": "Identifier", + "start":962,"end":963,"loc":{"start":{"line":43,"column":19,"index":962},"end":{"line":43,"column":20,"index":963},"identifierName":"T"}, + "name": "T" + } } ] }, @@ -975,7 +1012,11 @@ "type": "TSTypeParameter", "start":1012,"end":1017,"loc":{"start":{"line":47,"column":20,"index":1012},"end":{"line":47,"column":25,"index":1017}}, "out": true, - "name": "T" + "name": { + "type": "Identifier", + "start":1016,"end":1017,"loc":{"start":{"line":47,"column":24,"index":1016},"end":{"line":47,"column":25,"index":1017},"identifierName":"T"}, + "name": "T" + } } ] }, @@ -1017,7 +1058,11 @@ "type": "TSTypeParameter", "start":1061,"end":1066,"loc":{"start":{"line":49,"column":20,"index":1061},"end":{"line":49,"column":25,"index":1066}}, "out": true, - "name": "T" + "name": { + "type": "Identifier", + "start":1065,"end":1066,"loc":{"start":{"line":49,"column":24,"index":1065},"end":{"line":49,"column":25,"index":1066},"identifierName":"T"}, + "name": "T" + } } ] }, @@ -1040,7 +1085,7 @@ "typeAnnotation": { "type": "TSFunctionType", "start":1089,"end":1103,"loc":{"start":{"line":50,"column":7,"index":1089},"end":{"line":50,"column":21,"index":1103}}, - "parameters": [ + "params": [ { "type": "Identifier", "start":1090,"end":1094,"loc":{"start":{"line":50,"column":8,"index":1090},"end":{"line":50,"column":12,"index":1094},"identifierName":"x"}, @@ -1060,7 +1105,7 @@ } } ], - "typeAnnotation": { + "returnType": { "type": "TSTypeAnnotation", "start":1096,"end":1103,"loc":{"start":{"line":50,"column":14,"index":1096},"end":{"line":50,"column":21,"index":1103}}, "typeAnnotation": { @@ -1104,7 +1149,11 @@ "type": "TSTypeParameter", "start":1124,"end":1128,"loc":{"start":{"line":53,"column":16,"index":1124},"end":{"line":53,"column":20,"index":1128}}, "in": true, - "name": "T" + "name": { + "type": "Identifier", + "start":1127,"end":1128,"loc":{"start":{"line":53,"column":19,"index":1127},"end":{"line":53,"column":20,"index":1128},"identifierName":"T"}, + "name": "T" + } } ] }, @@ -1127,7 +1176,7 @@ "typeAnnotation": { "type": "TSFunctionType", "start":1151,"end":1162,"loc":{"start":{"line":54,"column":7,"index":1151},"end":{"line":54,"column":18,"index":1162}}, - "parameters": [ + "params": [ { "type": "Identifier", "start":1152,"end":1156,"loc":{"start":{"line":54,"column":8,"index":1152},"end":{"line":54,"column":12,"index":1156},"identifierName":"x"}, @@ -1147,7 +1196,7 @@ } } ], - "typeAnnotation": { + "returnType": { "type": "TSTypeAnnotation", "start":1158,"end":1162,"loc":{"start":{"line":54,"column":14,"index":1158},"end":{"line":54,"column":18,"index":1162}}, "typeAnnotation": { @@ -1189,7 +1238,11 @@ "type": "TSTypeParameter", "start":1183,"end":1188,"loc":{"start":{"line":57,"column":16,"index":1183},"end":{"line":57,"column":21,"index":1188}}, "out": true, - "name": "T" + "name": { + "type": "Identifier", + "start":1187,"end":1188,"loc":{"start":{"line":57,"column":20,"index":1187},"end":{"line":57,"column":21,"index":1188},"identifierName":"T"}, + "name": "T" + } } ] }, @@ -1212,7 +1265,7 @@ "typeAnnotation": { "type": "TSFunctionType", "start":1211,"end":1222,"loc":{"start":{"line":58,"column":7,"index":1211},"end":{"line":58,"column":18,"index":1222}}, - "parameters": [ + "params": [ { "type": "Identifier", "start":1212,"end":1216,"loc":{"start":{"line":58,"column":8,"index":1212},"end":{"line":58,"column":12,"index":1216},"identifierName":"x"}, @@ -1232,7 +1285,7 @@ } } ], - "typeAnnotation": { + "returnType": { "type": "TSTypeAnnotation", "start":1218,"end":1222,"loc":{"start":{"line":58,"column":14,"index":1218},"end":{"line":58,"column":18,"index":1222}}, "typeAnnotation": { @@ -1281,7 +1334,11 @@ "type": "TSTypeParameter", "start":1268,"end":1272,"loc":{"start":{"line":63,"column":10,"index":1268},"end":{"line":63,"column":14,"index":1272}}, "in": true, - "name": "T" + "name": { + "type": "Identifier", + "start":1271,"end":1272,"loc":{"start":{"line":63,"column":13,"index":1271},"end":{"line":63,"column":14,"index":1272},"identifierName":"T"}, + "name": "T" + } } ] }, @@ -1382,14 +1439,18 @@ { "type": "TSTypeParameter", "start":1331,"end":1332,"loc":{"start":{"line":68,"column":12,"index":1331},"end":{"line":68,"column":13,"index":1332}}, - "name": "T" + "name": { + "type": "Identifier", + "start":1331,"end":1332,"loc":{"start":{"line":68,"column":12,"index":1331},"end":{"line":68,"column":13,"index":1332},"identifierName":"T"}, + "name": "T" + } } ] }, "typeAnnotation": { "type": "TSFunctionType", "start":1336,"end":1360,"loc":{"start":{"line":68,"column":17,"index":1336},"end":{"line":68,"column":41,"index":1360}}, - "parameters": [ + "params": [ { "type": "Identifier", "start":1337,"end":1351,"loc":{"start":{"line":68,"column":18,"index":1337},"end":{"line":68,"column":32,"index":1351},"identifierName":"foo"}, @@ -1428,7 +1489,7 @@ } } ], - "typeAnnotation": { + "returnType": { "type": "TSTypeAnnotation", "start":1353,"end":1360,"loc":{"start":{"line":68,"column":34,"index":1353},"end":{"line":68,"column":41,"index":1360}}, "typeAnnotation": { @@ -1453,7 +1514,11 @@ { "type": "TSTypeParameter", "start":1373,"end":1374,"loc":{"start":{"line":70,"column":10,"index":1373},"end":{"line":70,"column":11,"index":1374}}, - "name": "T" + "name": { + "type": "Identifier", + "start":1373,"end":1374,"loc":{"start":{"line":70,"column":10,"index":1373},"end":{"line":70,"column":11,"index":1374},"identifierName":"T"}, + "name": "T" + } } ] }, @@ -1522,7 +1587,11 @@ "type": "TSTypeParameter", "start":1415,"end":1420,"loc":{"start":{"line":74,"column":10,"index":1415},"end":{"line":74,"column":15,"index":1420}}, "out": true, - "name": "T" + "name": { + "type": "Identifier", + "start":1419,"end":1420,"loc":{"start":{"line":74,"column":14,"index":1419},"end":{"line":74,"column":15,"index":1420},"identifierName":"T"}, + "name": "T" + } } ] }, @@ -1616,14 +1685,18 @@ { "type": "TSTypeParameter", "start":1479,"end":1480,"loc":{"start":{"line":79,"column":12,"index":1479},"end":{"line":79,"column":13,"index":1480}}, - "name": "T" + "name": { + "type": "Identifier", + "start":1479,"end":1480,"loc":{"start":{"line":79,"column":12,"index":1479},"end":{"line":79,"column":13,"index":1480},"identifierName":"T"}, + "name": "T" + } } ] }, "typeAnnotation": { "type": "TSFunctionType", "start":1484,"end":1508,"loc":{"start":{"line":79,"column":17,"index":1484},"end":{"line":79,"column":41,"index":1508}}, - "parameters": [ + "params": [ { "type": "Identifier", "start":1485,"end":1499,"loc":{"start":{"line":79,"column":18,"index":1485},"end":{"line":79,"column":32,"index":1499},"identifierName":"foo"}, @@ -1662,7 +1735,7 @@ } } ], - "typeAnnotation": { + "returnType": { "type": "TSTypeAnnotation", "start":1501,"end":1508,"loc":{"start":{"line":79,"column":34,"index":1501},"end":{"line":79,"column":41,"index":1508}}, "typeAnnotation": { @@ -1687,7 +1760,11 @@ { "type": "TSTypeParameter", "start":1521,"end":1522,"loc":{"start":{"line":81,"column":10,"index":1521},"end":{"line":81,"column":11,"index":1522}}, - "name": "T" + "name": { + "type": "Identifier", + "start":1521,"end":1522,"loc":{"start":{"line":81,"column":10,"index":1521},"end":{"line":81,"column":11,"index":1522},"identifierName":"T"}, + "name": "T" + } } ] }, @@ -1757,7 +1834,11 @@ "start":1563,"end":1571,"loc":{"start":{"line":85,"column":10,"index":1563},"end":{"line":85,"column":18,"index":1571}}, "in": true, "out": true, - "name": "T" + "name": { + "type": "Identifier", + "start":1570,"end":1571,"loc":{"start":{"line":85,"column":17,"index":1570},"end":{"line":85,"column":18,"index":1571},"identifierName":"T"}, + "name": "T" + } } ] }, @@ -1844,14 +1925,18 @@ { "type": "TSTypeParameter", "start":1620,"end":1621,"loc":{"start":{"line":90,"column":12,"index":1620},"end":{"line":90,"column":13,"index":1621}}, - "name": "T" + "name": { + "type": "Identifier", + "start":1620,"end":1621,"loc":{"start":{"line":90,"column":12,"index":1620},"end":{"line":90,"column":13,"index":1621},"identifierName":"T"}, + "name": "T" + } } ] }, "typeAnnotation": { "type": "TSFunctionType", "start":1625,"end":1649,"loc":{"start":{"line":90,"column":17,"index":1625},"end":{"line":90,"column":41,"index":1649}}, - "parameters": [ + "params": [ { "type": "Identifier", "start":1626,"end":1640,"loc":{"start":{"line":90,"column":18,"index":1626},"end":{"line":90,"column":32,"index":1640},"identifierName":"foo"}, @@ -1890,7 +1975,7 @@ } } ], - "typeAnnotation": { + "returnType": { "type": "TSTypeAnnotation", "start":1642,"end":1649,"loc":{"start":{"line":90,"column":34,"index":1642},"end":{"line":90,"column":41,"index":1649}}, "typeAnnotation": { @@ -1915,7 +2000,11 @@ { "type": "TSTypeParameter", "start":1662,"end":1663,"loc":{"start":{"line":92,"column":10,"index":1662},"end":{"line":92,"column":11,"index":1663}}, - "name": "T" + "name": { + "type": "Identifier", + "start":1662,"end":1663,"loc":{"start":{"line":92,"column":10,"index":1662},"end":{"line":92,"column":11,"index":1663},"identifierName":"T"}, + "name": "T" + } } ] }, @@ -1991,7 +2080,11 @@ "type": "TSTypeParameter", "start":1728,"end":1736,"loc":{"start":{"line":98,"column":9,"index":1728},"end":{"line":98,"column":17,"index":1736}}, "accessibility": "public", - "name": "T" + "name": { + "type": "Identifier", + "start":1735,"end":1736,"loc":{"start":{"line":98,"column":16,"index":1735},"end":{"line":98,"column":17,"index":1736},"identifierName":"T"}, + "name": "T" + } } ] }, @@ -2036,7 +2129,11 @@ "start":1762,"end":1773,"loc":{"start":{"line":99,"column":9,"index":1762},"end":{"line":99,"column":20,"index":1773}}, "in": true, "out": true, - "name": "T" + "name": { + "type": "Identifier", + "start":1772,"end":1773,"loc":{"start":{"line":99,"column":19,"index":1772},"end":{"line":99,"column":20,"index":1773},"identifierName":"T"}, + "name": "T" + } } ] }, @@ -2081,7 +2178,11 @@ "start":1799,"end":1811,"loc":{"start":{"line":100,"column":9,"index":1799},"end":{"line":100,"column":21,"index":1811}}, "in": true, "out": true, - "name": "T" + "name": { + "type": "Identifier", + "start":1810,"end":1811,"loc":{"start":{"line":100,"column":20,"index":1810},"end":{"line":100,"column":21,"index":1811},"identifierName":"T"}, + "name": "T" + } } ] }, @@ -2126,7 +2227,11 @@ "start":1837,"end":1845,"loc":{"start":{"line":101,"column":9,"index":1837},"end":{"line":101,"column":17,"index":1845}}, "out": true, "in": true, - "name": "T" + "name": { + "type": "Identifier", + "start":1844,"end":1845,"loc":{"start":{"line":101,"column":16,"index":1844},"end":{"line":101,"column":17,"index":1845},"identifierName":"T"}, + "name": "T" + } } ] }, @@ -2173,7 +2278,11 @@ "type": "TSTypeParameter", "start":1883,"end":1887,"loc":{"start":{"line":103,"column":20,"index":1883},"end":{"line":103,"column":24,"index":1887}}, "in": true, - "name": "T" + "name": { + "type": "Identifier", + "start":1886,"end":1887,"loc":{"start":{"line":103,"column":23,"index":1886},"end":{"line":103,"column":24,"index":1887},"identifierName":"T"}, + "name": "T" + } } ] }, @@ -2239,7 +2348,11 @@ "type": "TSTypeParameter", "start":1932,"end":1937,"loc":{"start":{"line":104,"column":20,"index":1932},"end":{"line":104,"column":25,"index":1937}}, "out": true, - "name": "T" + "name": { + "type": "Identifier", + "start":1936,"end":1937,"loc":{"start":{"line":104,"column":24,"index":1936},"end":{"line":104,"column":25,"index":1937},"identifierName":"T"}, + "name": "T" + } } ] }, @@ -2381,7 +2494,11 @@ "type": "TSTypeParameter", "start":2054,"end":2059,"loc":{"start":{"line":113,"column":14,"index":2054},"end":{"line":113,"column":19,"index":2059}}, "out": true, - "name": "T" + "name": { + "type": "Identifier", + "start":2058,"end":2059,"loc":{"start":{"line":113,"column":18,"index":2058},"end":{"line":113,"column":19,"index":2059},"identifierName":"T"}, + "name": "T" + } } ] }, @@ -2414,7 +2531,11 @@ "type": "TSTypeParameter", "start":2078,"end":2082,"loc":{"start":{"line":114,"column":14,"index":2078},"end":{"line":114,"column":18,"index":2082}}, "in": true, - "name": "T" + "name": { + "type": "Identifier", + "start":2081,"end":2082,"loc":{"start":{"line":114,"column":17,"index":2081},"end":{"line":114,"column":18,"index":2082},"identifierName":"T"}, + "name": "T" + } } ] }, @@ -2586,7 +2707,11 @@ "type": "TSTypeParameter", "start":2238,"end":2243,"loc":{"start":{"line":124,"column":17,"index":2238},"end":{"line":124,"column":22,"index":2243}}, "out": true, - "name": "A" + "name": { + "type": "Identifier", + "start":2242,"end":2243,"loc":{"start":{"line":124,"column":21,"index":2242},"end":{"line":124,"column":22,"index":2243},"identifierName":"A"}, + "name": "A" + } } ] }, @@ -2720,12 +2845,20 @@ { "type": "TSTypeParameter", "start":2324,"end":2325,"loc":{"start":{"line":129,"column":16,"index":2324},"end":{"line":129,"column":17,"index":2325}}, - "name": "A" + "name": { + "type": "Identifier", + "start":2324,"end":2325,"loc":{"start":{"line":129,"column":16,"index":2324},"end":{"line":129,"column":17,"index":2325},"identifierName":"A"}, + "name": "A" + } }, { "type": "TSTypeParameter", "start":2327,"end":2338,"loc":{"start":{"line":129,"column":19,"index":2327},"end":{"line":129,"column":30,"index":2338}}, - "name": "B", + "name": { + "type": "Identifier", + "start":2327,"end":2328,"loc":{"start":{"line":129,"column":19,"index":2327},"end":{"line":129,"column":20,"index":2328},"identifierName":"B"}, + "name": "B" + }, "default": { "type": "TSUnknownKeyword", "start":2331,"end":2338,"loc":{"start":{"line":129,"column":23,"index":2331},"end":{"line":129,"column":30,"index":2338}} @@ -2831,7 +2964,11 @@ { "type": "TSTypeParameter", "start":2413,"end":2414,"loc":{"start":{"line":134,"column":12,"index":2413},"end":{"line":134,"column":13,"index":2414}}, - "name": "A" + "name": { + "type": "Identifier", + "start":2413,"end":2414,"loc":{"start":{"line":134,"column":12,"index":2413},"end":{"line":134,"column":13,"index":2414},"identifierName":"A"}, + "name": "A" + } } ] }, @@ -3147,14 +3284,22 @@ { "type": "TSTypeParameter", "start":2673,"end":2681,"loc":{"start":{"line":143,"column":24,"index":2673},"end":{"line":143,"column":32,"index":2681}}, - "name": "TContext" + "name": { + "type": "Identifier", + "start":2673,"end":2681,"loc":{"start":{"line":143,"column":24,"index":2673},"end":{"line":143,"column":32,"index":2681},"identifierName":"TContext"}, + "name": "TContext" + } }, { "type": "TSTypeParameter", "start":2683,"end":2721,"loc":{"start":{"line":143,"column":34,"index":2683},"end":{"line":143,"column":72,"index":2721}}, "in": true, "out": true, - "name": "TEvent", + "name": { + "type": "Identifier", + "start":2690,"end":2696,"loc":{"start":{"line":143,"column":41,"index":2690},"end":{"line":143,"column":47,"index":2696},"identifierName":"TEvent"}, + "name": "TEvent" + }, "constraint": { "type": "TSTypeLiteral", "start":2705,"end":2721,"loc":{"start":{"line":143,"column":56,"index":2705},"end":{"line":143,"column":72,"index":2721}}, @@ -3326,7 +3471,11 @@ { "type": "TSTypeParameter", "start":2850,"end":2881,"loc":{"start":{"line":149,"column":23,"index":2850},"end":{"line":149,"column":54,"index":2881}}, - "name": "TEvent", + "name": { + "type": "Identifier", + "start":2850,"end":2856,"loc":{"start":{"line":149,"column":23,"index":2850},"end":{"line":149,"column":29,"index":2856},"identifierName":"TEvent"}, + "name": "TEvent" + }, "constraint": { "type": "TSTypeLiteral", "start":2865,"end":2881,"loc":{"start":{"line":149,"column":38,"index":2865},"end":{"line":149,"column":54,"index":2881}}, @@ -3373,7 +3522,7 @@ "typeAnnotation": { "type": "TSFunctionType", "start":2895,"end":2933,"loc":{"start":{"line":150,"column":10,"index":2895},"end":{"line":150,"column":48,"index":2933}}, - "parameters": [ + "params": [ { "type": "Identifier", "start":2896,"end":2924,"loc":{"start":{"line":150,"column":11,"index":2896},"end":{"line":150,"column":39,"index":2924},"identifierName":"meta"}, @@ -3412,7 +3561,7 @@ } } ], - "typeAnnotation": { + "returnType": { "type": "TSTypeAnnotation", "start":2926,"end":2933,"loc":{"start":{"line":150,"column":41,"index":2926},"end":{"line":150,"column":48,"index":2933}}, "typeAnnotation": { @@ -3444,7 +3593,11 @@ { "type": "TSTypeParameter", "start":2969,"end":3000,"loc":{"start":{"line":153,"column":31,"index":2969},"end":{"line":153,"column":62,"index":3000}}, - "name": "TEvent", + "name": { + "type": "Identifier", + "start":2969,"end":2975,"loc":{"start":{"line":153,"column":31,"index":2969},"end":{"line":153,"column":37,"index":2975},"identifierName":"TEvent"}, + "name": "TEvent" + }, "constraint": { "type": "TSTypeLiteral", "start":2984,"end":3000,"loc":{"start":{"line":153,"column":46,"index":2984},"end":{"line":153,"column":62,"index":3000}}, @@ -3553,7 +3706,11 @@ { "type": "TSTypeParameter", "start":3082,"end":3090,"loc":{"start":{"line":155,"column":27,"index":3082},"end":{"line":155,"column":35,"index":3090}}, - "name": "TContext" + "name": { + "type": "Identifier", + "start":3082,"end":3090,"loc":{"start":{"line":155,"column":27,"index":3082},"end":{"line":155,"column":35,"index":3090},"identifierName":"TContext"}, + "name": "TContext" + } } ] },