From ddc567d058ca207f6e65b0188514468d91c7066e Mon Sep 17 00:00:00 2001 From: magic-akari Date: Tue, 15 Mar 2022 20:20:25 +0800 Subject: [PATCH 1/8] feat: support optional variance annotations --- .../src/generators/typescript.ts | 10 + .../src/plugins/typescript/index.js | 48 +++- packages/babel-parser/src/types.js | 4 + .../types/variance-annotations-error/input.ts | 4 + .../variance-annotations-error/output.json | 214 +++++++++++++++++ .../types/variance-annotations/input.ts | 11 + .../types/variance-annotations/output.json | 215 ++++++++++++++++++ .../src/ast-types/generated/index.ts | 2 + .../babel-types/src/definitions/typescript.ts | 8 + 9 files changed, 511 insertions(+), 5 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/typescript/types/variance-annotations-error/input.ts create mode 100644 packages/babel-parser/test/fixtures/typescript/types/variance-annotations-error/output.json create mode 100644 packages/babel-parser/test/fixtures/typescript/types/variance-annotations/input.ts create mode 100644 packages/babel-parser/test/fixtures/typescript/types/variance-annotations/output.json diff --git a/packages/babel-generator/src/generators/typescript.ts b/packages/babel-generator/src/generators/typescript.ts index bdddbf06fae0..91d4232becc5 100644 --- a/packages/babel-generator/src/generators/typescript.ts +++ b/packages/babel-generator/src/generators/typescript.ts @@ -25,6 +25,16 @@ export function TSTypeParameterInstantiation( export { TSTypeParameterInstantiation as TSTypeParameterDeclaration }; export function TSTypeParameter(this: Printer, node: t.TSTypeParameter) { + if (node.in) { + this.word("in"); + this.space(); + } + + if (node.out) { + this.word("out"); + this.space(); + } + this.word( !process.env.BABEL_8_BREAKING ? (node.name as unknown as string) diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js index 0cd8a0a15759..d9d6081c49ba 100644 --- a/packages/babel-parser/src/plugins/typescript/index.js +++ b/packages/babel-parser/src/plugins/typescript/index.js @@ -35,7 +35,11 @@ import TypeScriptScopeHandler from "./scope"; import * as charCodes from "charcodes"; import type { ExpressionErrors } from "../../parser/util"; import { PARAM } from "../../util/production-parameter"; -import { Errors, ParseErrorEnum } from "../../parse-error"; +import { + Errors, + type ParseErrorConstructor, + ParseErrorEnum, +} from "../../parse-error"; import { cloneIdentifier } from "../../parser/node"; const getOwn = (object, key) => @@ -47,7 +51,8 @@ type TsModifier = | "declare" | "static" | "override" - | N.Accessibility; + | N.Accessibility + | N.VarianceAnnotations; function nonNull(x: ?T): T { if (x == null) { @@ -153,6 +158,10 @@ const TSErrors = ParseErrorEnum`typescript`(_ => ({ InvalidModifierOnTypeMember: _<{| modifier: TsModifier |}>( ({ modifier }) => `'${modifier}' modifier cannot appear on a type member.`, ), + InvalidModifierOnTypeParameter: _<{| modifier: TsModifier |}>( + ({ modifier }) => + `'${modifier}' modifier cannot appear on a type parameter.`, + ), InvalidModifiersOrder: _<{| orderedModifiers: [TsModifier, TsModifier] |}>( ({ orderedModifiers }) => `'${orderedModifiers[0]}' modifier must precede '${orderedModifiers[1]}' modifier.`, @@ -286,6 +295,10 @@ function tsIsAccessModifier(modifier: string): boolean %checks { ); } +function tsIsVarianceAnnotations(modifier: string): boolean %checks { + return modifier === "in" || modifier === "out"; +} + export default (superClass: Class): Class => class extends superClass { getScopeHandler(): Class { @@ -324,7 +337,7 @@ export default (superClass: Class): Class => allowedModifiers: T[], stopOnStartOfClassStaticBlock?: boolean, ): ?T { - if (!tokenIsIdentifier(this.state.type)) { + if (!tokenIsIdentifier(this.state.type) && this.state.type !== tt._in) { return undefined; } @@ -345,11 +358,12 @@ export default (superClass: Class): Class => * this.tsParseModifiers({ modified: node, allowedModifiers: ["public"] }); * this.tsParseModifiers({ modified: node, allowedModifiers: ["abstract", "readonly"] }); */ - tsParseModifiers({ + tsParseModifiers({ modified, allowedModifiers, disallowedModifiers, stopOnStartOfClassStaticBlock, + errorTemplate, }: { modified: { [key: TsModifier]: ?true, @@ -358,6 +372,7 @@ export default (superClass: Class): Class => allowedModifiers: TsModifier[], disallowedModifiers?: TsModifier[], stopOnStartOfClassStaticBlock?: boolean, + errorTemplate?: ParseErrorConstructor, }): void { const enforceOrder = (loc, modifier, before, after) => { if (modifier === before && modified[after]) { @@ -401,6 +416,13 @@ export default (superClass: Class): Class => modified.accessibility = modifier; } + } else if (tsIsVarianceAnnotations(modifier)) { + if (modified[modifier]) { + this.raise(TSErrors.DuplicateModifier, { at: startLoc, modifier }); + } + modified[modifier] = true; + + enforceOrder(startLoc, modifier, "in", "out"); } else { if (Object.hasOwnProperty.call(modified, modifier)) { this.raise(TSErrors.DuplicateModifier, { at: startLoc, modifier }); @@ -417,7 +439,7 @@ export default (superClass: Class): Class => } if (disallowedModifiers?.includes(modifier)) { - this.raise(TSErrors.InvalidModifierOnTypeMember, { + this.raise(errorTemplate ?? TSErrors.InvalidModifierOnTypeMember, { at: startLoc, modifier, }); @@ -635,6 +657,22 @@ export default (superClass: Class): Class => tsParseTypeParameter(): N.TsTypeParameter { const node: N.TsTypeParameter = this.startNode(); + + this.tsParseModifiers({ + modified: node, + allowedModifiers: ["in", "out"], + disallowedModifiers: [ + "public", + "private", + "protected", + "readonly", + "declare", + "abstract", + "override", + ], + errorTemplate: TSErrors.InvalidModifierOnTypeParameter, + }); + node.name = this.tsParseTypeParameterName(); node.constraint = this.tsEatThenParseType(tt._extends); node.default = this.tsEatThenParseType(tt.eq); diff --git a/packages/babel-parser/src/types.js b/packages/babel-parser/src/types.js index e6b53e381722..2652bd57ef79 100644 --- a/packages/babel-parser/src/types.js +++ b/packages/babel-parser/src/types.js @@ -707,6 +707,8 @@ export type ModuleExpression = NodeBase & { // TypeScript access modifiers export type Accessibility = "public" | "protected" | "private"; +export type VarianceAnnotations = "in" | "out"; + export type PatternBase = HasDecorators & { // TODO: All not in spec // Flow/TypeScript only: @@ -1040,6 +1042,8 @@ export type TsTypeParameter = NodeBase & { type: "TSTypeParameter", // TODO(Babel-8): remove string type support name: string | Identifier, + in?: boolean, + out?: boolean, constraint?: TsType, default?: TsType, }; diff --git a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-error/input.ts b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-error/input.ts new file mode 100644 index 000000000000..53a49071e800 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-error/input.ts @@ -0,0 +1,4 @@ +type T20 = T; // Error +type T21 = T; // Error +type T22 = T; // Error +type T23 = T; // Error \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-error/output.json b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-error/output.json new file mode 100644 index 000000000000..b0a8f5789c34 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-error/output.json @@ -0,0 +1,214 @@ +{ + "type": "File", + "start":0,"end":142,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":4,"column":33,"index":142}}, + "errors": [ + "SyntaxError: 'public' modifier cannot appear on a type parameter. (1:9)", + "SyntaxError: Duplicate modifier: 'in'. (2:16)", + "SyntaxError: 'in' modifier must precede 'out' modifier. (2:16)", + "SyntaxError: Duplicate modifier: 'out'. (3:16)", + "SyntaxError: 'in' modifier must precede 'out' modifier. (4:13)" + ], + "program": { + "type": "Program", + "start":0,"end":142,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":4,"column":33,"index":142}}, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSTypeAliasDeclaration", + "start":0,"end":23,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":23,"index":23}}, + "id": { + "type": "Identifier", + "start":5,"end":8,"loc":{"start":{"line":1,"column":5,"index":5},"end":{"line":1,"column":8,"index":8},"identifierName":"T20"}, + "name": "T20" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":8,"end":18,"loc":{"start":{"line":1,"column":8,"index":8},"end":{"line":1,"column":18,"index":18}}, + "params": [ + { + "type": "TSTypeParameter", + "start":9,"end":17,"loc":{"start":{"line":1,"column":9,"index":9},"end":{"line":1,"column":17,"index":17}}, + "accessibility": "public", + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeReference", + "start":21,"end":22,"loc":{"start":{"line":1,"column":21,"index":21},"end":{"line":1,"column":22,"index":22}}, + "typeName": { + "type": "Identifier", + "start":21,"end":22,"loc":{"start":{"line":1,"column":21,"index":21},"end":{"line":1,"column":22,"index":22},"identifierName":"T"}, + "name": "T" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":25,"end":33,"loc":{"start":{"line":1,"column":25,"index":25},"end":{"line":1,"column":33,"index":33}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":34,"end":60,"loc":{"start":{"line":2,"column":0,"index":34},"end":{"line":2,"column":26,"index":60}}, + "id": { + "type": "Identifier", + "start":39,"end":42,"loc":{"start":{"line":2,"column":5,"index":39},"end":{"line":2,"column":8,"index":42},"identifierName":"T21"}, + "name": "T21" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":42,"end":55,"loc":{"start":{"line":2,"column":8,"index":42},"end":{"line":2,"column":21,"index":55}}, + "params": [ + { + "type": "TSTypeParameter", + "start":43,"end":54,"loc":{"start":{"line":2,"column":9,"index":43},"end":{"line":2,"column":20,"index":54}}, + "in": true, + "out": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeReference", + "start":58,"end":59,"loc":{"start":{"line":2,"column":24,"index":58},"end":{"line":2,"column":25,"index":59}}, + "typeName": { + "type": "Identifier", + "start":58,"end":59,"loc":{"start":{"line":2,"column":24,"index":58},"end":{"line":2,"column":25,"index":59},"identifierName":"T"}, + "name": "T" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":62,"end":70,"loc":{"start":{"line":2,"column":28,"index":62},"end":{"line":2,"column":36,"index":70}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":25,"end":33,"loc":{"start":{"line":1,"column":25,"index":25},"end":{"line":1,"column":33,"index":33}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":71,"end":98,"loc":{"start":{"line":3,"column":0,"index":71},"end":{"line":3,"column":27,"index":98}}, + "id": { + "type": "Identifier", + "start":76,"end":79,"loc":{"start":{"line":3,"column":5,"index":76},"end":{"line":3,"column":8,"index":79},"identifierName":"T22"}, + "name": "T22" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":79,"end":93,"loc":{"start":{"line":3,"column":8,"index":79},"end":{"line":3,"column":22,"index":93}}, + "params": [ + { + "type": "TSTypeParameter", + "start":80,"end":92,"loc":{"start":{"line":3,"column":9,"index":80},"end":{"line":3,"column":21,"index":92}}, + "in": true, + "out": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeReference", + "start":96,"end":97,"loc":{"start":{"line":3,"column":25,"index":96},"end":{"line":3,"column":26,"index":97}}, + "typeName": { + "type": "Identifier", + "start":96,"end":97,"loc":{"start":{"line":3,"column":25,"index":96},"end":{"line":3,"column":26,"index":97},"identifierName":"T"}, + "name": "T" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":100,"end":108,"loc":{"start":{"line":3,"column":29,"index":100},"end":{"line":3,"column":37,"index":108}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":62,"end":70,"loc":{"start":{"line":2,"column":28,"index":62},"end":{"line":2,"column":36,"index":70}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":109,"end":132,"loc":{"start":{"line":4,"column":0,"index":109},"end":{"line":4,"column":23,"index":132}}, + "id": { + "type": "Identifier", + "start":114,"end":117,"loc":{"start":{"line":4,"column":5,"index":114},"end":{"line":4,"column":8,"index":117},"identifierName":"T23"}, + "name": "T23" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":117,"end":127,"loc":{"start":{"line":4,"column":8,"index":117},"end":{"line":4,"column":18,"index":127}}, + "params": [ + { + "type": "TSTypeParameter", + "start":118,"end":126,"loc":{"start":{"line":4,"column":9,"index":118},"end":{"line":4,"column":17,"index":126}}, + "out": true, + "in": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeReference", + "start":130,"end":131,"loc":{"start":{"line":4,"column":21,"index":130},"end":{"line":4,"column":22,"index":131}}, + "typeName": { + "type": "Identifier", + "start":130,"end":131,"loc":{"start":{"line":4,"column":21,"index":130},"end":{"line":4,"column":22,"index":131},"identifierName":"T"}, + "name": "T" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":134,"end":142,"loc":{"start":{"line":4,"column":25,"index":134},"end":{"line":4,"column":33,"index":142}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":100,"end":108,"loc":{"start":{"line":3,"column":29,"index":100},"end":{"line":3,"column":37,"index":108}} + } + ] + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": " Error", + "start":25,"end":33,"loc":{"start":{"line":1,"column":25,"index":25},"end":{"line":1,"column":33,"index":33}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":62,"end":70,"loc":{"start":{"line":2,"column":28,"index":62},"end":{"line":2,"column":36,"index":70}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":100,"end":108,"loc":{"start":{"line":3,"column":29,"index":100},"end":{"line":3,"column":37,"index":108}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":134,"end":142,"loc":{"start":{"line":4,"column":25,"index":134},"end":{"line":4,"column":33,"index":142}} + } + ] +} diff --git a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations/input.ts b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations/input.ts new file mode 100644 index 000000000000..d08fc6d65106 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations/input.ts @@ -0,0 +1,11 @@ +type Covariant = { + x: T; +} + +type Contravariant = { + f: (x: T) => void; +} + +type Invariant = { + f: (x: T) => T; +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations/output.json b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations/output.json new file mode 100644 index 000000000000..07b70afb66e4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations/output.json @@ -0,0 +1,215 @@ +{ + "type": "File", + "start":0,"end":144,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":11,"column":1,"index":144}}, + "program": { + "type": "Program", + "start":0,"end":144,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":11,"column":1,"index":144}}, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSTypeAliasDeclaration", + "start":0,"end":37,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":3,"column":1,"index":37}}, + "id": { + "type": "Identifier", + "start":5,"end":14,"loc":{"start":{"line":1,"column":5,"index":5},"end":{"line":1,"column":14,"index":14},"identifierName":"Covariant"}, + "name": "Covariant" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":14,"end":21,"loc":{"start":{"line":1,"column":14,"index":14},"end":{"line":1,"column":21,"index":21}}, + "params": [ + { + "type": "TSTypeParameter", + "start":15,"end":20,"loc":{"start":{"line":1,"column":15,"index":15},"end":{"line":1,"column":20,"index":20}}, + "out": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":24,"end":37,"loc":{"start":{"line":1,"column":24,"index":24},"end":{"line":3,"column":1,"index":37}}, + "members": [ + { + "type": "TSPropertySignature", + "start":30,"end":35,"loc":{"start":{"line":2,"column":4,"index":30},"end":{"line":2,"column":9,"index":35}}, + "key": { + "type": "Identifier", + "start":30,"end":31,"loc":{"start":{"line":2,"column":4,"index":30},"end":{"line":2,"column":5,"index":31},"identifierName":"x"}, + "name": "x" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":31,"end":34,"loc":{"start":{"line":2,"column":5,"index":31},"end":{"line":2,"column":8,"index":34}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":33,"end":34,"loc":{"start":{"line":2,"column":7,"index":33},"end":{"line":2,"column":8,"index":34}}, + "typeName": { + "type": "Identifier", + "start":33,"end":34,"loc":{"start":{"line":2,"column":7,"index":33},"end":{"line":2,"column":8,"index":34},"identifierName":"T"}, + "name": "T" + } + } + } + } + ] + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":39,"end":92,"loc":{"start":{"line":5,"column":0,"index":39},"end":{"line":7,"column":1,"index":92}}, + "id": { + "type": "Identifier", + "start":44,"end":57,"loc":{"start":{"line":5,"column":5,"index":44},"end":{"line":5,"column":18,"index":57},"identifierName":"Contravariant"}, + "name": "Contravariant" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":57,"end":63,"loc":{"start":{"line":5,"column":18,"index":57},"end":{"line":5,"column":24,"index":63}}, + "params": [ + { + "type": "TSTypeParameter", + "start":58,"end":62,"loc":{"start":{"line":5,"column":19,"index":58},"end":{"line":5,"column":23,"index":62}}, + "in": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":66,"end":92,"loc":{"start":{"line":5,"column":27,"index":66},"end":{"line":7,"column":1,"index":92}}, + "members": [ + { + "type": "TSPropertySignature", + "start":72,"end":90,"loc":{"start":{"line":6,"column":4,"index":72},"end":{"line":6,"column":22,"index":90}}, + "key": { + "type": "Identifier", + "start":72,"end":73,"loc":{"start":{"line":6,"column":4,"index":72},"end":{"line":6,"column":5,"index":73},"identifierName":"f"}, + "name": "f" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":73,"end":89,"loc":{"start":{"line":6,"column":5,"index":73},"end":{"line":6,"column":21,"index":89}}, + "typeAnnotation": { + "type": "TSFunctionType", + "start":75,"end":89,"loc":{"start":{"line":6,"column":7,"index":75},"end":{"line":6,"column":21,"index":89}}, + "parameters": [ + { + "type": "Identifier", + "start":76,"end":80,"loc":{"start":{"line":6,"column":8,"index":76},"end":{"line":6,"column":12,"index":80},"identifierName":"x"}, + "name": "x", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":77,"end":80,"loc":{"start":{"line":6,"column":9,"index":77},"end":{"line":6,"column":12,"index":80}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":79,"end":80,"loc":{"start":{"line":6,"column":11,"index":79},"end":{"line":6,"column":12,"index":80}}, + "typeName": { + "type": "Identifier", + "start":79,"end":80,"loc":{"start":{"line":6,"column":11,"index":79},"end":{"line":6,"column":12,"index":80},"identifierName":"T"}, + "name": "T" + } + } + } + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":82,"end":89,"loc":{"start":{"line":6,"column":14,"index":82},"end":{"line":6,"column":21,"index":89}}, + "typeAnnotation": { + "type": "TSVoidKeyword", + "start":85,"end":89,"loc":{"start":{"line":6,"column":17,"index":85},"end":{"line":6,"column":21,"index":89}} + } + } + } + } + } + ] + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":94,"end":144,"loc":{"start":{"line":9,"column":0,"index":94},"end":{"line":11,"column":1,"index":144}}, + "id": { + "type": "Identifier", + "start":99,"end":108,"loc":{"start":{"line":9,"column":5,"index":99},"end":{"line":9,"column":14,"index":108},"identifierName":"Invariant"}, + "name": "Invariant" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":108,"end":118,"loc":{"start":{"line":9,"column":14,"index":108},"end":{"line":9,"column":24,"index":118}}, + "params": [ + { + "type": "TSTypeParameter", + "start":109,"end":117,"loc":{"start":{"line":9,"column":15,"index":109},"end":{"line":9,"column":23,"index":117}}, + "in": true, + "out": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":121,"end":144,"loc":{"start":{"line":9,"column":27,"index":121},"end":{"line":11,"column":1,"index":144}}, + "members": [ + { + "type": "TSPropertySignature", + "start":127,"end":142,"loc":{"start":{"line":10,"column":4,"index":127},"end":{"line":10,"column":19,"index":142}}, + "key": { + "type": "Identifier", + "start":127,"end":128,"loc":{"start":{"line":10,"column":4,"index":127},"end":{"line":10,"column":5,"index":128},"identifierName":"f"}, + "name": "f" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":128,"end":141,"loc":{"start":{"line":10,"column":5,"index":128},"end":{"line":10,"column":18,"index":141}}, + "typeAnnotation": { + "type": "TSFunctionType", + "start":130,"end":141,"loc":{"start":{"line":10,"column":7,"index":130},"end":{"line":10,"column":18,"index":141}}, + "parameters": [ + { + "type": "Identifier", + "start":131,"end":135,"loc":{"start":{"line":10,"column":8,"index":131},"end":{"line":10,"column":12,"index":135},"identifierName":"x"}, + "name": "x", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":132,"end":135,"loc":{"start":{"line":10,"column":9,"index":132},"end":{"line":10,"column":12,"index":135}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":134,"end":135,"loc":{"start":{"line":10,"column":11,"index":134},"end":{"line":10,"column":12,"index":135}}, + "typeName": { + "type": "Identifier", + "start":134,"end":135,"loc":{"start":{"line":10,"column":11,"index":134},"end":{"line":10,"column":12,"index":135},"identifierName":"T"}, + "name": "T" + } + } + } + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":137,"end":141,"loc":{"start":{"line":10,"column":14,"index":137},"end":{"line":10,"column":18,"index":141}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":140,"end":141,"loc":{"start":{"line":10,"column":17,"index":140},"end":{"line":10,"column":18,"index":141}}, + "typeName": { + "type": "Identifier", + "start":140,"end":141,"loc":{"start":{"line":10,"column":17,"index":140},"end":{"line":10,"column":18,"index":141},"identifierName":"T"}, + "name": "T" + } + } + } + } + } + } + ] + } + } + ], + "directives": [] + } +} diff --git a/packages/babel-types/src/ast-types/generated/index.ts b/packages/babel-types/src/ast-types/generated/index.ts index f750429c735d..d3c69235fad6 100644 --- a/packages/babel-types/src/ast-types/generated/index.ts +++ b/packages/babel-types/src/ast-types/generated/index.ts @@ -2030,6 +2030,8 @@ export interface TSTypeParameter extends BaseNode { constraint?: TSType | null; default?: TSType | null; name: string; + in?: boolean | null; + out?: boolean | null; } export type Standardized = diff --git a/packages/babel-types/src/definitions/typescript.ts b/packages/babel-types/src/definitions/typescript.ts index 42dcf6accd24..58b2536973aa 100644 --- a/packages/babel-types/src/definitions/typescript.ts +++ b/packages/babel-types/src/definitions/typescript.ts @@ -607,6 +607,14 @@ defineType("TSTypeParameter", { ? assertValueType("string") : assertNodeType("Identifier"), }, + in: { + validate: assertValueType("boolean"), + optional: true, + }, + out: { + validate: assertValueType("boolean"), + optional: true, + }, constraint: { validate: assertNodeType("TSType"), optional: true, From f30cbf0af6dfd174d37c0cbdf3a58653e007767b Mon Sep 17 00:00:00 2001 From: magic-akari Date: Wed, 16 Mar 2022 08:52:54 +0800 Subject: [PATCH 2/8] fix: flow check --- .../babel-parser/src/plugins/typescript/index.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js index d9d6081c49ba..a803a63b73e7 100644 --- a/packages/babel-parser/src/plugins/typescript/index.js +++ b/packages/babel-parser/src/plugins/typescript/index.js @@ -35,11 +35,7 @@ import TypeScriptScopeHandler from "./scope"; import * as charCodes from "charcodes"; import type { ExpressionErrors } from "../../parser/util"; import { PARAM } from "../../util/production-parameter"; -import { - Errors, - type ParseErrorConstructor, - ParseErrorEnum, -} from "../../parse-error"; +import { Errors, ParseErrorEnum } from "../../parse-error"; import { cloneIdentifier } from "../../parser/node"; const getOwn = (object, key) => @@ -358,12 +354,12 @@ export default (superClass: Class): Class => * this.tsParseModifiers({ modified: node, allowedModifiers: ["public"] }); * this.tsParseModifiers({ modified: node, allowedModifiers: ["abstract", "readonly"] }); */ - tsParseModifiers({ + tsParseModifiers({ modified, allowedModifiers, disallowedModifiers, stopOnStartOfClassStaticBlock, - errorTemplate, + errorTemplate = TSErrors.InvalidModifierOnTypeMember, }: { modified: { [key: TsModifier]: ?true, @@ -372,7 +368,8 @@ export default (superClass: Class): Class => allowedModifiers: TsModifier[], disallowedModifiers?: TsModifier[], stopOnStartOfClassStaticBlock?: boolean, - errorTemplate?: ParseErrorConstructor, + // FIXME: make sure errorTemplate can receive `modifier` + errorTemplate?: any, }): void { const enforceOrder = (loc, modifier, before, after) => { if (modifier === before && modified[after]) { @@ -439,7 +436,7 @@ export default (superClass: Class): Class => } if (disallowedModifiers?.includes(modifier)) { - this.raise(errorTemplate ?? TSErrors.InvalidModifierOnTypeMember, { + this.raise(errorTemplate, { at: startLoc, modifier, }); From c6db874a512427a102f6f2edec785415944eb2e2 Mon Sep 17 00:00:00 2001 From: magic-akari Date: Wed, 16 Mar 2022 15:46:23 +0800 Subject: [PATCH 3/8] fix: BABEL_8_BREAKING --- .../variance-annotations-babel-7/input.ts | 11 + .../variance-annotations-babel-7/options.json | 3 + .../variance-annotations-babel-7/output.json | 215 ++++++++++++++++++ .../variance-annotations-error/options.json | 3 + .../variance-annotations-error/output.json | 24 +- .../types/variance-annotations/options.json | 3 + .../types/variance-annotations/output.json | 26 ++- 7 files changed, 274 insertions(+), 11 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/typescript/types/variance-annotations-babel-7/input.ts create mode 100644 packages/babel-parser/test/fixtures/typescript/types/variance-annotations-babel-7/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/types/variance-annotations-babel-7/output.json create mode 100644 packages/babel-parser/test/fixtures/typescript/types/variance-annotations-error/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/types/variance-annotations/options.json diff --git a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-babel-7/input.ts b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-babel-7/input.ts new file mode 100644 index 000000000000..d08fc6d65106 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-babel-7/input.ts @@ -0,0 +1,11 @@ +type Covariant = { + x: T; +} + +type Contravariant = { + f: (x: T) => void; +} + +type Invariant = { + f: (x: T) => T; +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-babel-7/options.json b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-babel-7/options.json new file mode 100644 index 000000000000..29a3f0e84167 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-babel-7/options.json @@ -0,0 +1,3 @@ +{ + "BABEL_8_BREAKING": false +} diff --git a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-babel-7/output.json b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-babel-7/output.json new file mode 100644 index 000000000000..07b70afb66e4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-babel-7/output.json @@ -0,0 +1,215 @@ +{ + "type": "File", + "start":0,"end":144,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":11,"column":1,"index":144}}, + "program": { + "type": "Program", + "start":0,"end":144,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":11,"column":1,"index":144}}, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSTypeAliasDeclaration", + "start":0,"end":37,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":3,"column":1,"index":37}}, + "id": { + "type": "Identifier", + "start":5,"end":14,"loc":{"start":{"line":1,"column":5,"index":5},"end":{"line":1,"column":14,"index":14},"identifierName":"Covariant"}, + "name": "Covariant" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":14,"end":21,"loc":{"start":{"line":1,"column":14,"index":14},"end":{"line":1,"column":21,"index":21}}, + "params": [ + { + "type": "TSTypeParameter", + "start":15,"end":20,"loc":{"start":{"line":1,"column":15,"index":15},"end":{"line":1,"column":20,"index":20}}, + "out": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":24,"end":37,"loc":{"start":{"line":1,"column":24,"index":24},"end":{"line":3,"column":1,"index":37}}, + "members": [ + { + "type": "TSPropertySignature", + "start":30,"end":35,"loc":{"start":{"line":2,"column":4,"index":30},"end":{"line":2,"column":9,"index":35}}, + "key": { + "type": "Identifier", + "start":30,"end":31,"loc":{"start":{"line":2,"column":4,"index":30},"end":{"line":2,"column":5,"index":31},"identifierName":"x"}, + "name": "x" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":31,"end":34,"loc":{"start":{"line":2,"column":5,"index":31},"end":{"line":2,"column":8,"index":34}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":33,"end":34,"loc":{"start":{"line":2,"column":7,"index":33},"end":{"line":2,"column":8,"index":34}}, + "typeName": { + "type": "Identifier", + "start":33,"end":34,"loc":{"start":{"line":2,"column":7,"index":33},"end":{"line":2,"column":8,"index":34},"identifierName":"T"}, + "name": "T" + } + } + } + } + ] + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":39,"end":92,"loc":{"start":{"line":5,"column":0,"index":39},"end":{"line":7,"column":1,"index":92}}, + "id": { + "type": "Identifier", + "start":44,"end":57,"loc":{"start":{"line":5,"column":5,"index":44},"end":{"line":5,"column":18,"index":57},"identifierName":"Contravariant"}, + "name": "Contravariant" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":57,"end":63,"loc":{"start":{"line":5,"column":18,"index":57},"end":{"line":5,"column":24,"index":63}}, + "params": [ + { + "type": "TSTypeParameter", + "start":58,"end":62,"loc":{"start":{"line":5,"column":19,"index":58},"end":{"line":5,"column":23,"index":62}}, + "in": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":66,"end":92,"loc":{"start":{"line":5,"column":27,"index":66},"end":{"line":7,"column":1,"index":92}}, + "members": [ + { + "type": "TSPropertySignature", + "start":72,"end":90,"loc":{"start":{"line":6,"column":4,"index":72},"end":{"line":6,"column":22,"index":90}}, + "key": { + "type": "Identifier", + "start":72,"end":73,"loc":{"start":{"line":6,"column":4,"index":72},"end":{"line":6,"column":5,"index":73},"identifierName":"f"}, + "name": "f" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":73,"end":89,"loc":{"start":{"line":6,"column":5,"index":73},"end":{"line":6,"column":21,"index":89}}, + "typeAnnotation": { + "type": "TSFunctionType", + "start":75,"end":89,"loc":{"start":{"line":6,"column":7,"index":75},"end":{"line":6,"column":21,"index":89}}, + "parameters": [ + { + "type": "Identifier", + "start":76,"end":80,"loc":{"start":{"line":6,"column":8,"index":76},"end":{"line":6,"column":12,"index":80},"identifierName":"x"}, + "name": "x", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":77,"end":80,"loc":{"start":{"line":6,"column":9,"index":77},"end":{"line":6,"column":12,"index":80}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":79,"end":80,"loc":{"start":{"line":6,"column":11,"index":79},"end":{"line":6,"column":12,"index":80}}, + "typeName": { + "type": "Identifier", + "start":79,"end":80,"loc":{"start":{"line":6,"column":11,"index":79},"end":{"line":6,"column":12,"index":80},"identifierName":"T"}, + "name": "T" + } + } + } + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":82,"end":89,"loc":{"start":{"line":6,"column":14,"index":82},"end":{"line":6,"column":21,"index":89}}, + "typeAnnotation": { + "type": "TSVoidKeyword", + "start":85,"end":89,"loc":{"start":{"line":6,"column":17,"index":85},"end":{"line":6,"column":21,"index":89}} + } + } + } + } + } + ] + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":94,"end":144,"loc":{"start":{"line":9,"column":0,"index":94},"end":{"line":11,"column":1,"index":144}}, + "id": { + "type": "Identifier", + "start":99,"end":108,"loc":{"start":{"line":9,"column":5,"index":99},"end":{"line":9,"column":14,"index":108},"identifierName":"Invariant"}, + "name": "Invariant" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":108,"end":118,"loc":{"start":{"line":9,"column":14,"index":108},"end":{"line":9,"column":24,"index":118}}, + "params": [ + { + "type": "TSTypeParameter", + "start":109,"end":117,"loc":{"start":{"line":9,"column":15,"index":109},"end":{"line":9,"column":23,"index":117}}, + "in": true, + "out": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":121,"end":144,"loc":{"start":{"line":9,"column":27,"index":121},"end":{"line":11,"column":1,"index":144}}, + "members": [ + { + "type": "TSPropertySignature", + "start":127,"end":142,"loc":{"start":{"line":10,"column":4,"index":127},"end":{"line":10,"column":19,"index":142}}, + "key": { + "type": "Identifier", + "start":127,"end":128,"loc":{"start":{"line":10,"column":4,"index":127},"end":{"line":10,"column":5,"index":128},"identifierName":"f"}, + "name": "f" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":128,"end":141,"loc":{"start":{"line":10,"column":5,"index":128},"end":{"line":10,"column":18,"index":141}}, + "typeAnnotation": { + "type": "TSFunctionType", + "start":130,"end":141,"loc":{"start":{"line":10,"column":7,"index":130},"end":{"line":10,"column":18,"index":141}}, + "parameters": [ + { + "type": "Identifier", + "start":131,"end":135,"loc":{"start":{"line":10,"column":8,"index":131},"end":{"line":10,"column":12,"index":135},"identifierName":"x"}, + "name": "x", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":132,"end":135,"loc":{"start":{"line":10,"column":9,"index":132},"end":{"line":10,"column":12,"index":135}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":134,"end":135,"loc":{"start":{"line":10,"column":11,"index":134},"end":{"line":10,"column":12,"index":135}}, + "typeName": { + "type": "Identifier", + "start":134,"end":135,"loc":{"start":{"line":10,"column":11,"index":134},"end":{"line":10,"column":12,"index":135},"identifierName":"T"}, + "name": "T" + } + } + } + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":137,"end":141,"loc":{"start":{"line":10,"column":14,"index":137},"end":{"line":10,"column":18,"index":141}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":140,"end":141,"loc":{"start":{"line":10,"column":17,"index":140},"end":{"line":10,"column":18,"index":141}}, + "typeName": { + "type": "Identifier", + "start":140,"end":141,"loc":{"start":{"line":10,"column":17,"index":140},"end":{"line":10,"column":18,"index":141},"identifierName":"T"}, + "name": "T" + } + } + } + } + } + } + ] + } + } + ], + "directives": [] + } +} diff --git a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-error/options.json b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-error/options.json new file mode 100644 index 000000000000..cbf6d1595427 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-error/options.json @@ -0,0 +1,3 @@ +{ + "BABEL_8_BREAKING": true +} diff --git a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-error/output.json b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-error/output.json index b0a8f5789c34..ea0f512c6f32 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-error/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-error/output.json @@ -30,7 +30,11 @@ "type": "TSTypeParameter", "start":9,"end":17,"loc":{"start":{"line":1,"column":9,"index":9},"end":{"line":1,"column":17,"index":17}}, "accessibility": "public", - "name": "T" + "name": { + "type": "Identifier", + "start":16,"end":17,"loc":{"start":{"line":1,"column":16,"index":16},"end":{"line":1,"column":17,"index":17},"identifierName":"T"}, + "name": "T" + } } ] }, @@ -68,7 +72,11 @@ "start":43,"end":54,"loc":{"start":{"line":2,"column":9,"index":43},"end":{"line":2,"column":20,"index":54}}, "in": true, "out": true, - "name": "T" + "name": { + "type": "Identifier", + "start":53,"end":54,"loc":{"start":{"line":2,"column":19,"index":53},"end":{"line":2,"column":20,"index":54},"identifierName":"T"}, + "name": "T" + } } ] }, @@ -113,7 +121,11 @@ "start":80,"end":92,"loc":{"start":{"line":3,"column":9,"index":80},"end":{"line":3,"column":21,"index":92}}, "in": true, "out": true, - "name": "T" + "name": { + "type": "Identifier", + "start":91,"end":92,"loc":{"start":{"line":3,"column":20,"index":91},"end":{"line":3,"column":21,"index":92},"identifierName":"T"}, + "name": "T" + } } ] }, @@ -158,7 +170,11 @@ "start":118,"end":126,"loc":{"start":{"line":4,"column":9,"index":118},"end":{"line":4,"column":17,"index":126}}, "out": true, "in": true, - "name": "T" + "name": { + "type": "Identifier", + "start":125,"end":126,"loc":{"start":{"line":4,"column":16,"index":125},"end":{"line":4,"column":17,"index":126},"identifierName":"T"}, + "name": "T" + } } ] }, diff --git a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations/options.json b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations/options.json new file mode 100644 index 000000000000..cbf6d1595427 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations/options.json @@ -0,0 +1,3 @@ +{ + "BABEL_8_BREAKING": true +} diff --git a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations/output.json b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations/output.json index 07b70afb66e4..74dbd690bedb 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations/output.json @@ -23,7 +23,11 @@ "type": "TSTypeParameter", "start":15,"end":20,"loc":{"start":{"line":1,"column":15,"index":15},"end":{"line":1,"column":20,"index":20}}, "out": true, - "name": "T" + "name": { + "type": "Identifier", + "start":19,"end":20,"loc":{"start":{"line":1,"column":19,"index":19},"end":{"line":1,"column":20,"index":20},"identifierName":"T"}, + "name": "T" + } } ] }, @@ -73,7 +77,11 @@ "type": "TSTypeParameter", "start":58,"end":62,"loc":{"start":{"line":5,"column":19,"index":58},"end":{"line":5,"column":23,"index":62}}, "in": true, - "name": "T" + "name": { + "type": "Identifier", + "start":61,"end":62,"loc":{"start":{"line":5,"column":22,"index":61},"end":{"line":5,"column":23,"index":62},"identifierName":"T"}, + "name": "T" + } } ] }, @@ -96,7 +104,7 @@ "typeAnnotation": { "type": "TSFunctionType", "start":75,"end":89,"loc":{"start":{"line":6,"column":7,"index":75},"end":{"line":6,"column":21,"index":89}}, - "parameters": [ + "params": [ { "type": "Identifier", "start":76,"end":80,"loc":{"start":{"line":6,"column":8,"index":76},"end":{"line":6,"column":12,"index":80},"identifierName":"x"}, @@ -116,7 +124,7 @@ } } ], - "typeAnnotation": { + "returnType": { "type": "TSTypeAnnotation", "start":82,"end":89,"loc":{"start":{"line":6,"column":14,"index":82},"end":{"line":6,"column":21,"index":89}}, "typeAnnotation": { @@ -147,7 +155,11 @@ "start":109,"end":117,"loc":{"start":{"line":9,"column":15,"index":109},"end":{"line":9,"column":23,"index":117}}, "in": true, "out": true, - "name": "T" + "name": { + "type": "Identifier", + "start":116,"end":117,"loc":{"start":{"line":9,"column":22,"index":116},"end":{"line":9,"column":23,"index":117},"identifierName":"T"}, + "name": "T" + } } ] }, @@ -170,7 +182,7 @@ "typeAnnotation": { "type": "TSFunctionType", "start":130,"end":141,"loc":{"start":{"line":10,"column":7,"index":130},"end":{"line":10,"column":18,"index":141}}, - "parameters": [ + "params": [ { "type": "Identifier", "start":131,"end":135,"loc":{"start":{"line":10,"column":8,"index":131},"end":{"line":10,"column":12,"index":135},"identifierName":"x"}, @@ -190,7 +202,7 @@ } } ], - "typeAnnotation": { + "returnType": { "type": "TSTypeAnnotation", "start":137,"end":141,"loc":{"start":{"line":10,"column":14,"index":137},"end":{"line":10,"column":18,"index":141}}, "typeAnnotation": { From c13020b137bdd412fead02ba2d236a7f8aee381d Mon Sep 17 00:00:00 2001 From: magic-akari Date: Thu, 17 Mar 2022 17:48:46 +0800 Subject: [PATCH 4/8] chore: add test cases --- .../variance-annotations-with-jsx/input.tsx | 5 + .../options.json | 4 + .../variance-annotations-with-jsx/output.js | 4 + .../input.tsx | 5 + .../options.json | 4 + .../output.json | 137 ++++++++++++++++++ 6 files changed, 159 insertions(+) create mode 100644 packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx/input.tsx create mode 100644 packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx/options.json create mode 100644 packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx/output.js create mode 100644 packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-error/input.tsx create mode 100644 packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-error/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-error/output.json diff --git a/packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx/input.tsx b/packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx/input.tsx new file mode 100644 index 000000000000..8fbfbbe13250 --- /dev/null +++ b/packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx/input.tsx @@ -0,0 +1,5 @@ +// valid JSX +() => {}; + +// type variance annotations with a trailing comma +() => {}; \ 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 new file mode 100644 index 000000000000..dd8a3a5c8749 --- /dev/null +++ b/packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx/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/output.js b/packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx/output.js new file mode 100644 index 000000000000..966d8dea86bd --- /dev/null +++ b/packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx/output.js @@ -0,0 +1,4 @@ +// valid JSX +() => {}; // type variance annotations with a trailing comma + +() => {}; \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-error/input.tsx b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-error/input.tsx new file mode 100644 index 000000000000..245cd63d5396 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-error/input.tsx @@ -0,0 +1,5 @@ +// valid JSX +() => {}; + +// SyntaxError: Single type parameter T should have a trailing comma. +() => {}; diff --git a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-error/options.json b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-error/options.json new file mode 100644 index 000000000000..dd8a3a5c8749 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-error/options.json @@ -0,0 +1,4 @@ +{ + "BABEL_8_BREAKING": false, + "plugins": ["jsx", "typescript"] +} diff --git a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-error/output.json b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-error/output.json new file mode 100644 index 000000000000..281caed37781 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-error/output.json @@ -0,0 +1,137 @@ +{ + "type": "File", + "start":0,"end":120,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":5,"column":15,"index":120}}, + "errors": [ + "SyntaxError: Single type parameter T should have a trailing comma. Example usage: . (5:6)" + ], + "program": { + "type": "Program", + "start":0,"end":120,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":5,"column":15,"index":120}}, + "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}} + } + } + ] + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " SyntaxError: Single type parameter T should have a trailing comma.", + "start":35,"end":104,"loc":{"start":{"line":4,"column":0,"index":35},"end":{"line":4,"column":69,"index":104}} + } + ], + "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": "ExpressionStatement", + "start":105,"end":120,"loc":{"start":{"line":5,"column":0,"index":105},"end":{"line":5,"column":15,"index":120}}, + "expression": { + "type": "ArrowFunctionExpression", + "start":105,"end":119,"loc":{"start":{"line":5,"column":0,"index":105},"end":{"line":5,"column":14,"index":119}}, + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start":117,"end":119,"loc":{"start":{"line":5,"column":12,"index":117},"end":{"line":5,"column":14,"index":119}}, + "body": [], + "directives": [] + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":105,"end":111,"loc":{"start":{"line":5,"column":0,"index":105},"end":{"line":5,"column":6,"index":111}}, + "params": [ + { + "type": "TSTypeParameter", + "start":106,"end":110,"loc":{"start":{"line":5,"column":1,"index":106},"end":{"line":5,"column":5,"index":110}}, + "in": true, + "name": "T" + } + ] + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " SyntaxError: Single type parameter T should have a trailing comma.", + "start":35,"end":104,"loc":{"start":{"line":4,"column":0,"index":35},"end":{"line":4,"column":69,"index":104}} + } + ] + } + ], + "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": " SyntaxError: Single type parameter T should have a trailing comma.", + "start":35,"end":104,"loc":{"start":{"line":4,"column":0,"index":35},"end":{"line":4,"column":69,"index":104}} + } + ] +} From a626604e79f77a8fe0836b071f49392705f3e783 Mon Sep 17 00:00:00 2001 From: magic-akari Date: Sun, 3 Apr 2022 18:01:50 +0800 Subject: [PATCH 5/8] fix: TS1274 variance modifier can only appear on a type parameter of a class, interface or type alias --- .../variance-annotations-with-jsx/input.tsx | 93 +- .../variance-annotations-with-jsx/output.js | 78 +- .../src/plugins/typescript/index.js | 50 +- .../variance-annotations-babel-7/input.ts | 152 +- .../variance-annotations-babel-7/output.json | 3804 +++++++++++++++- .../types/variance-annotations-error/input.ts | 4 - .../variance-annotations-error/options.json | 3 - .../variance-annotations-error/output.json | 230 - .../input.tsx | 5 - .../output.json | 137 - .../variance-annotations-with-jsx/input.tsx | 164 + .../options.json | 0 .../variance-annotations-with-jsx/output.json | 4019 +++++++++++++++++ .../types/variance-annotations/input.ts | 152 +- 14 files changed, 8461 insertions(+), 430 deletions(-) delete mode 100644 packages/babel-parser/test/fixtures/typescript/types/variance-annotations-error/input.ts delete mode 100644 packages/babel-parser/test/fixtures/typescript/types/variance-annotations-error/options.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/types/variance-annotations-error/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-error/input.tsx delete mode 100644 packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-error/output.json create mode 100644 packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx/input.tsx rename packages/babel-parser/test/fixtures/typescript/types/{variance-annotations-with-jsx-error => variance-annotations-with-jsx}/options.json (100%) create mode 100644 packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx/output.json diff --git a/packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx/input.tsx b/packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx/input.tsx index 8fbfbbe13250..d0f89c1c2cf6 100644 --- a/packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx/input.tsx +++ b/packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx/input.tsx @@ -1,5 +1,94 @@ // valid JSX () => {}; -// type variance annotations with a trailing comma -() => {}; \ No newline at end of file +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/output.js b/packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx/output.js index 966d8dea86bd..762be81ca726 100644 --- a/packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx/output.js +++ b/packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx/output.js @@ -1,4 +1,78 @@ // valid JSX -() => {}; // type variance annotations with a trailing comma +() => {}; +type Covariant = { + x: T; +}; +declare let super_covariant: Covariant; +declare let sub_covariant: Covariant; +super_covariant = sub_covariant; +sub_covariant = super_covariant; // Error -() => {}; \ No newline at end of file +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-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js index a803a63b73e7..abe257e0b096 100644 --- a/packages/babel-parser/src/plugins/typescript/index.js +++ b/packages/babel-parser/src/plugins/typescript/index.js @@ -158,6 +158,10 @@ const TSErrors = ParseErrorEnum`typescript`(_ => ({ ({ modifier }) => `'${modifier}' modifier cannot appear on a type parameter.`, ), + InvalidModifierOnTypeParameterPositions: _<{| modifier: TsModifier |}>( + ({ modifier }) => + `'${modifier}' modifier can only appear on a type parameter of a class, interface or type alias.`, + ), InvalidModifiersOrder: _<{| orderedModifiers: [TsModifier, TsModifier] |}>( ({ orderedModifiers }) => `'${orderedModifiers[0]}' modifier must precede '${orderedModifiers[1]}' modifier.`, @@ -652,9 +656,7 @@ export default (superClass: Class): Class => return this.finishNode(node, "TSTypeQuery"); } - tsParseTypeParameter(): N.TsTypeParameter { - const node: N.TsTypeParameter = this.startNode(); - + tsParseInOutModifiers(node: N.TsTypeParameter) { this.tsParseModifiers({ modified: node, allowedModifiers: ["in", "out"], @@ -669,6 +671,26 @@ export default (superClass: Class): Class => ], errorTemplate: TSErrors.InvalidModifierOnTypeParameter, }); + } + + // for better error recover + tsParseNoneModifiers(node: N.TsTypeParameter) { + this.tsParseModifiers({ + modified: node, + allowedModifiers: [], + disallowedModifiers: ["in", "out"], + errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions, + }); + } + + tsParseTypeParameter( + parseModifiers: ?( + node: N.TsTypeParameter, + ) => void = this.tsParseNoneModifiers.bind(this), + ): N.TsTypeParameter { + const node: N.TsTypeParameter = this.startNode(); + + parseModifiers(node); node.name = this.tsParseTypeParameterName(); node.constraint = this.tsEatThenParseType(tt._extends); @@ -676,13 +698,15 @@ export default (superClass: Class): Class => return this.finishNode(node, "TSTypeParameter"); } - tsTryParseTypeParameters(): ?N.TsTypeParameterDeclaration { + tsTryParseTypeParameters( + parseModifiers: ?(node: N.TsTypeParameter) => void, + ): ?N.TsTypeParameterDeclaration { if (this.match(tt.lt)) { - return this.tsParseTypeParameters(); + return this.tsParseTypeParameters(parseModifiers); } } - tsParseTypeParameters() { + tsParseTypeParameters(parseModifiers: ?(node: N.TsTypeParameter) => void) { const node: N.TsTypeParameterDeclaration = this.startNode(); if (this.match(tt.lt) || this.match(tt.jsxTagStart)) { @@ -695,7 +719,7 @@ export default (superClass: Class): Class => node.params = this.tsParseBracketedList( "TypeParametersOrArguments", - this.tsParseTypeParameter.bind(this), + this.tsParseTypeParameter.bind(this, parseModifiers), /* bracket */ false, /* skipFirstToken */ true, refTrailingCommaPos, @@ -1658,7 +1682,9 @@ export default (superClass: Class): Class => this.raise(TSErrors.MissingInterfaceName, { at: this.state.startLoc }); } - node.typeParameters = this.tsTryParseTypeParameters(); + node.typeParameters = this.tsTryParseTypeParameters( + this.tsParseInOutModifiers.bind(this), + ); if (this.eat(tt._extends)) { node.extends = this.tsParseHeritageClause("extends"); } @@ -1674,7 +1700,9 @@ export default (superClass: Class): Class => node.id = this.parseIdentifier(); this.checkIdentifier(node.id, BIND_TS_TYPE); - node.typeParameters = this.tsTryParseTypeParameters(); + node.typeParameters = this.tsTryParseTypeParameters( + this.tsParseInOutModifiers.bind(this), + ); node.typeAnnotation = this.tsInType(() => { this.expect(tt.eq); @@ -2939,7 +2967,9 @@ export default (superClass: Class): Class => optionalId, (node: any).declare ? BIND_TS_AMBIENT : BIND_CLASS, ); - const typeParameters = this.tsTryParseTypeParameters(); + const typeParameters = this.tsTryParseTypeParameters( + this.tsParseInOutModifiers.bind(this), + ); if (typeParameters) node.typeParameters = typeParameters; } diff --git a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-babel-7/input.ts b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-babel-7/input.ts index d08fc6d65106..ce573862a9e1 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-babel-7/input.ts +++ b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-babel-7/input.ts @@ -2,10 +2,160 @@ 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; -} \ No newline at end of file +} + +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 + +// FIXME: this should be recoverable 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-babel-7/output.json b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-babel-7/output.json index 07b70afb66e4..c3ee05465c01 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-babel-7/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-babel-7/output.json @@ -1,9 +1,18 @@ { "type": "File", - "start":0,"end":144,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":11,"column":1,"index":144}}, + "start":0,"end":3366,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":161,"column":81,"index":3366}}, + "errors": [ + "SyntaxError: 'public' modifier cannot appear on a type parameter. (95:9)", + "SyntaxError: Duplicate modifier: 'in'. (96:16)", + "SyntaxError: 'in' modifier must precede 'out' modifier. (96:16)", + "SyntaxError: Duplicate modifier: 'out'. (97:16)", + "SyntaxError: 'in' modifier must precede 'out' modifier. (98:13)", + "SyntaxError: 'in' modifier can only appear on a type parameter of a class, interface or type alias. (100:20)", + "SyntaxError: 'out' modifier can only appear on a type parameter of a class, interface or type alias. (101:20)" + ], "program": { "type": "Program", - "start":0,"end":144,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":11,"column":1,"index":144}}, + "start":0,"end":3366,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":161,"column":81,"index":3366}}, "sourceType": "module", "interpreter": null, "body": [ @@ -57,21 +66,148 @@ ] } }, + { + "type": "VariableDeclaration", + "start":39,"end":87,"loc":{"start":{"line":5,"column":0,"index":39},"end":{"line":5,"column":48,"index":87}}, + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "start":51,"end":86,"loc":{"start":{"line":5,"column":12,"index":51},"end":{"line":5,"column":47,"index":86}}, + "id": { + "type": "Identifier", + "start":51,"end":86,"loc":{"start":{"line":5,"column":12,"index":51},"end":{"line":5,"column":47,"index":86},"identifierName":"super_covariant"}, + "name": "super_covariant", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":66,"end":86,"loc":{"start":{"line":5,"column":27,"index":66},"end":{"line":5,"column":47,"index":86}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":68,"end":86,"loc":{"start":{"line":5,"column":29,"index":68},"end":{"line":5,"column":47,"index":86}}, + "typeName": { + "type": "Identifier", + "start":68,"end":77,"loc":{"start":{"line":5,"column":29,"index":68},"end":{"line":5,"column":38,"index":77},"identifierName":"Covariant"}, + "name": "Covariant" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":77,"end":86,"loc":{"start":{"line":5,"column":38,"index":77},"end":{"line":5,"column":47,"index":86}}, + "params": [ + { + "type": "TSUnknownKeyword", + "start":78,"end":85,"loc":{"start":{"line":5,"column":39,"index":78},"end":{"line":5,"column":46,"index":85}} + } + ] + } + } + } + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "VariableDeclaration", + "start":88,"end":133,"loc":{"start":{"line":6,"column":0,"index":88},"end":{"line":6,"column":45,"index":133}}, + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "start":100,"end":132,"loc":{"start":{"line":6,"column":12,"index":100},"end":{"line":6,"column":44,"index":132}}, + "id": { + "type": "Identifier", + "start":100,"end":132,"loc":{"start":{"line":6,"column":12,"index":100},"end":{"line":6,"column":44,"index":132},"identifierName":"sub_covariant"}, + "name": "sub_covariant", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":113,"end":132,"loc":{"start":{"line":6,"column":25,"index":113},"end":{"line":6,"column":44,"index":132}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":115,"end":132,"loc":{"start":{"line":6,"column":27,"index":115},"end":{"line":6,"column":44,"index":132}}, + "typeName": { + "type": "Identifier", + "start":115,"end":124,"loc":{"start":{"line":6,"column":27,"index":115},"end":{"line":6,"column":36,"index":124},"identifierName":"Covariant"}, + "name": "Covariant" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":124,"end":132,"loc":{"start":{"line":6,"column":36,"index":124},"end":{"line":6,"column":44,"index":132}}, + "params": [ + { + "type": "TSStringKeyword", + "start":125,"end":131,"loc":{"start":{"line":6,"column":37,"index":125},"end":{"line":6,"column":43,"index":131}} + } + ] + } + } + } + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "ExpressionStatement", + "start":135,"end":167,"loc":{"start":{"line":8,"column":0,"index":135},"end":{"line":8,"column":32,"index":167}}, + "expression": { + "type": "AssignmentExpression", + "start":135,"end":166,"loc":{"start":{"line":8,"column":0,"index":135},"end":{"line":8,"column":31,"index":166}}, + "operator": "=", + "left": { + "type": "Identifier", + "start":135,"end":150,"loc":{"start":{"line":8,"column":0,"index":135},"end":{"line":8,"column":15,"index":150},"identifierName":"super_covariant"}, + "name": "super_covariant" + }, + "right": { + "type": "Identifier", + "start":153,"end":166,"loc":{"start":{"line":8,"column":18,"index":153},"end":{"line":8,"column":31,"index":166},"identifierName":"sub_covariant"}, + "name": "sub_covariant" + } + } + }, + { + "type": "ExpressionStatement", + "start":168,"end":200,"loc":{"start":{"line":9,"column":0,"index":168},"end":{"line":9,"column":32,"index":200}}, + "expression": { + "type": "AssignmentExpression", + "start":168,"end":199,"loc":{"start":{"line":9,"column":0,"index":168},"end":{"line":9,"column":31,"index":199}}, + "operator": "=", + "left": { + "type": "Identifier", + "start":168,"end":181,"loc":{"start":{"line":9,"column":0,"index":168},"end":{"line":9,"column":13,"index":181},"identifierName":"sub_covariant"}, + "name": "sub_covariant" + }, + "right": { + "type": "Identifier", + "start":184,"end":199,"loc":{"start":{"line":9,"column":16,"index":184},"end":{"line":9,"column":31,"index":199},"identifierName":"super_covariant"}, + "name": "super_covariant" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":202,"end":210,"loc":{"start":{"line":9,"column":34,"index":202},"end":{"line":9,"column":42,"index":210}} + } + ] + }, { "type": "TSTypeAliasDeclaration", - "start":39,"end":92,"loc":{"start":{"line":5,"column":0,"index":39},"end":{"line":7,"column":1,"index":92}}, + "start":212,"end":265,"loc":{"start":{"line":11,"column":0,"index":212},"end":{"line":13,"column":1,"index":265}}, "id": { "type": "Identifier", - "start":44,"end":57,"loc":{"start":{"line":5,"column":5,"index":44},"end":{"line":5,"column":18,"index":57},"identifierName":"Contravariant"}, + "start":217,"end":230,"loc":{"start":{"line":11,"column":5,"index":217},"end":{"line":11,"column":18,"index":230},"identifierName":"Contravariant"}, "name": "Contravariant" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":57,"end":63,"loc":{"start":{"line":5,"column":18,"index":57},"end":{"line":5,"column":24,"index":63}}, + "start":230,"end":236,"loc":{"start":{"line":11,"column":18,"index":230},"end":{"line":11,"column":24,"index":236}}, "params": [ { "type": "TSTypeParameter", - "start":58,"end":62,"loc":{"start":{"line":5,"column":19,"index":58},"end":{"line":5,"column":23,"index":62}}, + "start":231,"end":235,"loc":{"start":{"line":11,"column":19,"index":231},"end":{"line":11,"column":23,"index":235}}, "in": true, "name": "T" } @@ -79,37 +215,37 @@ }, "typeAnnotation": { "type": "TSTypeLiteral", - "start":66,"end":92,"loc":{"start":{"line":5,"column":27,"index":66},"end":{"line":7,"column":1,"index":92}}, + "start":239,"end":265,"loc":{"start":{"line":11,"column":27,"index":239},"end":{"line":13,"column":1,"index":265}}, "members": [ { "type": "TSPropertySignature", - "start":72,"end":90,"loc":{"start":{"line":6,"column":4,"index":72},"end":{"line":6,"column":22,"index":90}}, + "start":245,"end":263,"loc":{"start":{"line":12,"column":4,"index":245},"end":{"line":12,"column":22,"index":263}}, "key": { "type": "Identifier", - "start":72,"end":73,"loc":{"start":{"line":6,"column":4,"index":72},"end":{"line":6,"column":5,"index":73},"identifierName":"f"}, + "start":245,"end":246,"loc":{"start":{"line":12,"column":4,"index":245},"end":{"line":12,"column":5,"index":246},"identifierName":"f"}, "name": "f" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start":73,"end":89,"loc":{"start":{"line":6,"column":5,"index":73},"end":{"line":6,"column":21,"index":89}}, + "start":246,"end":262,"loc":{"start":{"line":12,"column":5,"index":246},"end":{"line":12,"column":21,"index":262}}, "typeAnnotation": { "type": "TSFunctionType", - "start":75,"end":89,"loc":{"start":{"line":6,"column":7,"index":75},"end":{"line":6,"column":21,"index":89}}, + "start":248,"end":262,"loc":{"start":{"line":12,"column":7,"index":248},"end":{"line":12,"column":21,"index":262}}, "parameters": [ { "type": "Identifier", - "start":76,"end":80,"loc":{"start":{"line":6,"column":8,"index":76},"end":{"line":6,"column":12,"index":80},"identifierName":"x"}, + "start":249,"end":253,"loc":{"start":{"line":12,"column":8,"index":249},"end":{"line":12,"column":12,"index":253},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start":77,"end":80,"loc":{"start":{"line":6,"column":9,"index":77},"end":{"line":6,"column":12,"index":80}}, + "start":250,"end":253,"loc":{"start":{"line":12,"column":9,"index":250},"end":{"line":12,"column":12,"index":253}}, "typeAnnotation": { "type": "TSTypeReference", - "start":79,"end":80,"loc":{"start":{"line":6,"column":11,"index":79},"end":{"line":6,"column":12,"index":80}}, + "start":252,"end":253,"loc":{"start":{"line":12,"column":11,"index":252},"end":{"line":12,"column":12,"index":253}}, "typeName": { "type": "Identifier", - "start":79,"end":80,"loc":{"start":{"line":6,"column":11,"index":79},"end":{"line":6,"column":12,"index":80},"identifierName":"T"}, + "start":252,"end":253,"loc":{"start":{"line":12,"column":11,"index":252},"end":{"line":12,"column":12,"index":253},"identifierName":"T"}, "name": "T" } } @@ -118,33 +254,174 @@ ], "typeAnnotation": { "type": "TSTypeAnnotation", - "start":82,"end":89,"loc":{"start":{"line":6,"column":14,"index":82},"end":{"line":6,"column":21,"index":89}}, + "start":255,"end":262,"loc":{"start":{"line":12,"column":14,"index":255},"end":{"line":12,"column":21,"index":262}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start":85,"end":89,"loc":{"start":{"line":6,"column":17,"index":85},"end":{"line":6,"column":21,"index":89}} + "start":258,"end":262,"loc":{"start":{"line":12,"column":17,"index":258},"end":{"line":12,"column":21,"index":262}} } } } } } ] - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":202,"end":210,"loc":{"start":{"line":9,"column":34,"index":202},"end":{"line":9,"column":42,"index":210}} + } + ] + }, + { + "type": "VariableDeclaration", + "start":267,"end":323,"loc":{"start":{"line":15,"column":0,"index":267},"end":{"line":15,"column":56,"index":323}}, + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "start":279,"end":322,"loc":{"start":{"line":15,"column":12,"index":279},"end":{"line":15,"column":55,"index":322}}, + "id": { + "type": "Identifier", + "start":279,"end":322,"loc":{"start":{"line":15,"column":12,"index":279},"end":{"line":15,"column":55,"index":322},"identifierName":"super_contravariant"}, + "name": "super_contravariant", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":298,"end":322,"loc":{"start":{"line":15,"column":31,"index":298},"end":{"line":15,"column":55,"index":322}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":300,"end":322,"loc":{"start":{"line":15,"column":33,"index":300},"end":{"line":15,"column":55,"index":322}}, + "typeName": { + "type": "Identifier", + "start":300,"end":313,"loc":{"start":{"line":15,"column":33,"index":300},"end":{"line":15,"column":46,"index":313},"identifierName":"Contravariant"}, + "name": "Contravariant" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":313,"end":322,"loc":{"start":{"line":15,"column":46,"index":313},"end":{"line":15,"column":55,"index":322}}, + "params": [ + { + "type": "TSUnknownKeyword", + "start":314,"end":321,"loc":{"start":{"line":15,"column":47,"index":314},"end":{"line":15,"column":54,"index":321}} + } + ] + } + } + } + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "VariableDeclaration", + "start":324,"end":377,"loc":{"start":{"line":16,"column":0,"index":324},"end":{"line":16,"column":53,"index":377}}, + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "start":336,"end":376,"loc":{"start":{"line":16,"column":12,"index":336},"end":{"line":16,"column":52,"index":376}}, + "id": { + "type": "Identifier", + "start":336,"end":376,"loc":{"start":{"line":16,"column":12,"index":336},"end":{"line":16,"column":52,"index":376},"identifierName":"sub_contravariant"}, + "name": "sub_contravariant", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":353,"end":376,"loc":{"start":{"line":16,"column":29,"index":353},"end":{"line":16,"column":52,"index":376}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":355,"end":376,"loc":{"start":{"line":16,"column":31,"index":355},"end":{"line":16,"column":52,"index":376}}, + "typeName": { + "type": "Identifier", + "start":355,"end":368,"loc":{"start":{"line":16,"column":31,"index":355},"end":{"line":16,"column":44,"index":368},"identifierName":"Contravariant"}, + "name": "Contravariant" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":368,"end":376,"loc":{"start":{"line":16,"column":44,"index":368},"end":{"line":16,"column":52,"index":376}}, + "params": [ + { + "type": "TSStringKeyword", + "start":369,"end":375,"loc":{"start":{"line":16,"column":45,"index":369},"end":{"line":16,"column":51,"index":375}} + } + ] + } + } + } + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "ExpressionStatement", + "start":379,"end":419,"loc":{"start":{"line":18,"column":0,"index":379},"end":{"line":18,"column":40,"index":419}}, + "expression": { + "type": "AssignmentExpression", + "start":379,"end":418,"loc":{"start":{"line":18,"column":0,"index":379},"end":{"line":18,"column":39,"index":418}}, + "operator": "=", + "left": { + "type": "Identifier", + "start":379,"end":398,"loc":{"start":{"line":18,"column":0,"index":379},"end":{"line":18,"column":19,"index":398},"identifierName":"super_contravariant"}, + "name": "super_contravariant" + }, + "right": { + "type": "Identifier", + "start":401,"end":418,"loc":{"start":{"line":18,"column":22,"index":401},"end":{"line":18,"column":39,"index":418},"identifierName":"sub_contravariant"}, + "name": "sub_contravariant" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":421,"end":429,"loc":{"start":{"line":18,"column":42,"index":421},"end":{"line":18,"column":50,"index":429}} + } + ] + }, + { + "type": "ExpressionStatement", + "start":430,"end":470,"loc":{"start":{"line":19,"column":0,"index":430},"end":{"line":19,"column":40,"index":470}}, + "expression": { + "type": "AssignmentExpression", + "start":430,"end":469,"loc":{"start":{"line":19,"column":0,"index":430},"end":{"line":19,"column":39,"index":469}}, + "operator": "=", + "left": { + "type": "Identifier", + "start":430,"end":447,"loc":{"start":{"line":19,"column":0,"index":430},"end":{"line":19,"column":17,"index":447},"identifierName":"sub_contravariant"}, + "name": "sub_contravariant" + }, + "right": { + "type": "Identifier", + "start":450,"end":469,"loc":{"start":{"line":19,"column":20,"index":450},"end":{"line":19,"column":39,"index":469},"identifierName":"super_contravariant"}, + "name": "super_contravariant" + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":421,"end":429,"loc":{"start":{"line":18,"column":42,"index":421},"end":{"line":18,"column":50,"index":429}} + } + ] }, { "type": "TSTypeAliasDeclaration", - "start":94,"end":144,"loc":{"start":{"line":9,"column":0,"index":94},"end":{"line":11,"column":1,"index":144}}, + "start":472,"end":522,"loc":{"start":{"line":21,"column":0,"index":472},"end":{"line":23,"column":1,"index":522}}, "id": { "type": "Identifier", - "start":99,"end":108,"loc":{"start":{"line":9,"column":5,"index":99},"end":{"line":9,"column":14,"index":108},"identifierName":"Invariant"}, + "start":477,"end":486,"loc":{"start":{"line":21,"column":5,"index":477},"end":{"line":21,"column":14,"index":486},"identifierName":"Invariant"}, "name": "Invariant" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":108,"end":118,"loc":{"start":{"line":9,"column":14,"index":108},"end":{"line":9,"column":24,"index":118}}, + "start":486,"end":496,"loc":{"start":{"line":21,"column":14,"index":486},"end":{"line":21,"column":24,"index":496}}, "params": [ { "type": "TSTypeParameter", - "start":109,"end":117,"loc":{"start":{"line":9,"column":15,"index":109},"end":{"line":9,"column":23,"index":117}}, + "start":487,"end":495,"loc":{"start":{"line":21,"column":15,"index":487},"end":{"line":21,"column":23,"index":495}}, "in": true, "out": true, "name": "T" @@ -153,37 +430,37 @@ }, "typeAnnotation": { "type": "TSTypeLiteral", - "start":121,"end":144,"loc":{"start":{"line":9,"column":27,"index":121},"end":{"line":11,"column":1,"index":144}}, + "start":499,"end":522,"loc":{"start":{"line":21,"column":27,"index":499},"end":{"line":23,"column":1,"index":522}}, "members": [ { "type": "TSPropertySignature", - "start":127,"end":142,"loc":{"start":{"line":10,"column":4,"index":127},"end":{"line":10,"column":19,"index":142}}, + "start":505,"end":520,"loc":{"start":{"line":22,"column":4,"index":505},"end":{"line":22,"column":19,"index":520}}, "key": { "type": "Identifier", - "start":127,"end":128,"loc":{"start":{"line":10,"column":4,"index":127},"end":{"line":10,"column":5,"index":128},"identifierName":"f"}, + "start":505,"end":506,"loc":{"start":{"line":22,"column":4,"index":505},"end":{"line":22,"column":5,"index":506},"identifierName":"f"}, "name": "f" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start":128,"end":141,"loc":{"start":{"line":10,"column":5,"index":128},"end":{"line":10,"column":18,"index":141}}, + "start":506,"end":519,"loc":{"start":{"line":22,"column":5,"index":506},"end":{"line":22,"column":18,"index":519}}, "typeAnnotation": { "type": "TSFunctionType", - "start":130,"end":141,"loc":{"start":{"line":10,"column":7,"index":130},"end":{"line":10,"column":18,"index":141}}, + "start":508,"end":519,"loc":{"start":{"line":22,"column":7,"index":508},"end":{"line":22,"column":18,"index":519}}, "parameters": [ { "type": "Identifier", - "start":131,"end":135,"loc":{"start":{"line":10,"column":8,"index":131},"end":{"line":10,"column":12,"index":135},"identifierName":"x"}, + "start":509,"end":513,"loc":{"start":{"line":22,"column":8,"index":509},"end":{"line":22,"column":12,"index":513},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start":132,"end":135,"loc":{"start":{"line":10,"column":9,"index":132},"end":{"line":10,"column":12,"index":135}}, + "start":510,"end":513,"loc":{"start":{"line":22,"column":9,"index":510},"end":{"line":22,"column":12,"index":513}}, "typeAnnotation": { "type": "TSTypeReference", - "start":134,"end":135,"loc":{"start":{"line":10,"column":11,"index":134},"end":{"line":10,"column":12,"index":135}}, + "start":512,"end":513,"loc":{"start":{"line":22,"column":11,"index":512},"end":{"line":22,"column":12,"index":513}}, "typeName": { "type": "Identifier", - "start":134,"end":135,"loc":{"start":{"line":10,"column":11,"index":134},"end":{"line":10,"column":12,"index":135},"identifierName":"T"}, + "start":512,"end":513,"loc":{"start":{"line":22,"column":11,"index":512},"end":{"line":22,"column":12,"index":513},"identifierName":"T"}, "name": "T" } } @@ -192,13 +469,13 @@ ], "typeAnnotation": { "type": "TSTypeAnnotation", - "start":137,"end":141,"loc":{"start":{"line":10,"column":14,"index":137},"end":{"line":10,"column":18,"index":141}}, + "start":515,"end":519,"loc":{"start":{"line":22,"column":14,"index":515},"end":{"line":22,"column":18,"index":519}}, "typeAnnotation": { "type": "TSTypeReference", - "start":140,"end":141,"loc":{"start":{"line":10,"column":17,"index":140},"end":{"line":10,"column":18,"index":141}}, + "start":518,"end":519,"loc":{"start":{"line":22,"column":17,"index":518},"end":{"line":22,"column":18,"index":519}}, "typeName": { "type": "Identifier", - "start":140,"end":141,"loc":{"start":{"line":10,"column":17,"index":140},"end":{"line":10,"column":18,"index":141},"identifierName":"T"}, + "start":518,"end":519,"loc":{"start":{"line":22,"column":17,"index":518},"end":{"line":22,"column":18,"index":519},"identifierName":"T"}, "name": "T" } } @@ -208,8 +485,3465 @@ } ] } + }, + { + "type": "VariableDeclaration", + "start":524,"end":572,"loc":{"start":{"line":25,"column":0,"index":524},"end":{"line":25,"column":48,"index":572}}, + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "start":536,"end":571,"loc":{"start":{"line":25,"column":12,"index":536},"end":{"line":25,"column":47,"index":571}}, + "id": { + "type": "Identifier", + "start":536,"end":571,"loc":{"start":{"line":25,"column":12,"index":536},"end":{"line":25,"column":47,"index":571},"identifierName":"super_invariant"}, + "name": "super_invariant", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":551,"end":571,"loc":{"start":{"line":25,"column":27,"index":551},"end":{"line":25,"column":47,"index":571}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":553,"end":571,"loc":{"start":{"line":25,"column":29,"index":553},"end":{"line":25,"column":47,"index":571}}, + "typeName": { + "type": "Identifier", + "start":553,"end":562,"loc":{"start":{"line":25,"column":29,"index":553},"end":{"line":25,"column":38,"index":562},"identifierName":"Invariant"}, + "name": "Invariant" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":562,"end":571,"loc":{"start":{"line":25,"column":38,"index":562},"end":{"line":25,"column":47,"index":571}}, + "params": [ + { + "type": "TSUnknownKeyword", + "start":563,"end":570,"loc":{"start":{"line":25,"column":39,"index":563},"end":{"line":25,"column":46,"index":570}} + } + ] + } + } + } + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "VariableDeclaration", + "start":573,"end":618,"loc":{"start":{"line":26,"column":0,"index":573},"end":{"line":26,"column":45,"index":618}}, + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "start":585,"end":617,"loc":{"start":{"line":26,"column":12,"index":585},"end":{"line":26,"column":44,"index":617}}, + "id": { + "type": "Identifier", + "start":585,"end":617,"loc":{"start":{"line":26,"column":12,"index":585},"end":{"line":26,"column":44,"index":617},"identifierName":"sub_invariant"}, + "name": "sub_invariant", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":598,"end":617,"loc":{"start":{"line":26,"column":25,"index":598},"end":{"line":26,"column":44,"index":617}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":600,"end":617,"loc":{"start":{"line":26,"column":27,"index":600},"end":{"line":26,"column":44,"index":617}}, + "typeName": { + "type": "Identifier", + "start":600,"end":609,"loc":{"start":{"line":26,"column":27,"index":600},"end":{"line":26,"column":36,"index":609},"identifierName":"Invariant"}, + "name": "Invariant" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":609,"end":617,"loc":{"start":{"line":26,"column":36,"index":609},"end":{"line":26,"column":44,"index":617}}, + "params": [ + { + "type": "TSStringKeyword", + "start":610,"end":616,"loc":{"start":{"line":26,"column":37,"index":610},"end":{"line":26,"column":43,"index":616}} + } + ] + } + } + } + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "ExpressionStatement", + "start":620,"end":652,"loc":{"start":{"line":28,"column":0,"index":620},"end":{"line":28,"column":32,"index":652}}, + "expression": { + "type": "AssignmentExpression", + "start":620,"end":651,"loc":{"start":{"line":28,"column":0,"index":620},"end":{"line":28,"column":31,"index":651}}, + "operator": "=", + "left": { + "type": "Identifier", + "start":620,"end":635,"loc":{"start":{"line":28,"column":0,"index":620},"end":{"line":28,"column":15,"index":635},"identifierName":"super_invariant"}, + "name": "super_invariant" + }, + "right": { + "type": "Identifier", + "start":638,"end":651,"loc":{"start":{"line":28,"column":18,"index":638},"end":{"line":28,"column":31,"index":651},"identifierName":"sub_invariant"}, + "name": "sub_invariant" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":654,"end":662,"loc":{"start":{"line":28,"column":34,"index":654},"end":{"line":28,"column":42,"index":662}} + } + ] + }, + { + "type": "ExpressionStatement", + "start":663,"end":695,"loc":{"start":{"line":29,"column":0,"index":663},"end":{"line":29,"column":32,"index":695}}, + "expression": { + "type": "AssignmentExpression", + "start":663,"end":694,"loc":{"start":{"line":29,"column":0,"index":663},"end":{"line":29,"column":31,"index":694}}, + "operator": "=", + "left": { + "type": "Identifier", + "start":663,"end":676,"loc":{"start":{"line":29,"column":0,"index":663},"end":{"line":29,"column":13,"index":676},"identifierName":"sub_invariant"}, + "name": "sub_invariant" + }, + "right": { + "type": "Identifier", + "start":679,"end":694,"loc":{"start":{"line":29,"column":16,"index":679},"end":{"line":29,"column":31,"index":694},"identifierName":"super_invariant"}, + "name": "super_invariant" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":697,"end":705,"loc":{"start":{"line":29,"column":34,"index":697},"end":{"line":29,"column":42,"index":705}} + }, + { + "type": "CommentLine", + "value": " Variance of various type constructors", + "start":707,"end":747,"loc":{"start":{"line":31,"column":0,"index":707},"end":{"line":31,"column":40,"index":747}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":654,"end":662,"loc":{"start":{"line":28,"column":34,"index":654},"end":{"line":28,"column":42,"index":662}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":749,"end":769,"loc":{"start":{"line":33,"column":0,"index":749},"end":{"line":33,"column":20,"index":769}}, + "id": { + "type": "Identifier", + "start":754,"end":757,"loc":{"start":{"line":33,"column":5,"index":754},"end":{"line":33,"column":8,"index":757},"identifierName":"T10"}, + "name": "T10" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":757,"end":764,"loc":{"start":{"line":33,"column":8,"index":757},"end":{"line":33,"column":15,"index":764}}, + "params": [ + { + "type": "TSTypeParameter", + "start":758,"end":763,"loc":{"start":{"line":33,"column":9,"index":758},"end":{"line":33,"column":14,"index":763}}, + "out": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeReference", + "start":767,"end":768,"loc":{"start":{"line":33,"column":18,"index":767},"end":{"line":33,"column":19,"index":768}}, + "typeName": { + "type": "Identifier", + "start":767,"end":768,"loc":{"start":{"line":33,"column":18,"index":767},"end":{"line":33,"column":19,"index":768},"identifierName":"T"}, + "name": "T" + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":697,"end":705,"loc":{"start":{"line":29,"column":34,"index":697},"end":{"line":29,"column":42,"index":705}} + }, + { + "type": "CommentLine", + "value": " Variance of various type constructors", + "start":707,"end":747,"loc":{"start":{"line":31,"column":0,"index":707},"end":{"line":31,"column":40,"index":747}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":770,"end":795,"loc":{"start":{"line":34,"column":0,"index":770},"end":{"line":34,"column":25,"index":795}}, + "id": { + "type": "Identifier", + "start":775,"end":778,"loc":{"start":{"line":34,"column":5,"index":775},"end":{"line":34,"column":8,"index":778},"identifierName":"T11"}, + "name": "T11" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":778,"end":784,"loc":{"start":{"line":34,"column":8,"index":778},"end":{"line":34,"column":14,"index":784}}, + "params": [ + { + "type": "TSTypeParameter", + "start":779,"end":783,"loc":{"start":{"line":34,"column":9,"index":779},"end":{"line":34,"column":13,"index":783}}, + "in": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeOperator", + "start":787,"end":794,"loc":{"start":{"line":34,"column":17,"index":787},"end":{"line":34,"column":24,"index":794}}, + "operator": "keyof", + "typeAnnotation": { + "type": "TSTypeReference", + "start":793,"end":794,"loc":{"start":{"line":34,"column":23,"index":793},"end":{"line":34,"column":24,"index":794}}, + "typeName": { + "type": "Identifier", + "start":793,"end":794,"loc":{"start":{"line":34,"column":23,"index":793},"end":{"line":34,"column":24,"index":794},"identifierName":"T"}, + "name": "T" + } + } + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":796,"end":842,"loc":{"start":{"line":35,"column":0,"index":796},"end":{"line":35,"column":46,"index":842}}, + "id": { + "type": "Identifier", + "start":801,"end":804,"loc":{"start":{"line":35,"column":5,"index":801},"end":{"line":35,"column":8,"index":804},"identifierName":"T12"}, + "name": "T12" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":804,"end":834,"loc":{"start":{"line":35,"column":8,"index":804},"end":{"line":35,"column":38,"index":834}}, + "params": [ + { + "type": "TSTypeParameter", + "start":805,"end":810,"loc":{"start":{"line":35,"column":9,"index":805},"end":{"line":35,"column":14,"index":810}}, + "out": true, + "name": "T" + }, + { + "type": "TSTypeParameter", + "start":812,"end":833,"loc":{"start":{"line":35,"column":16,"index":812},"end":{"line":35,"column":37,"index":833}}, + "out": true, + "name": "K", + "constraint": { + "type": "TSTypeOperator", + "start":826,"end":833,"loc":{"start":{"line":35,"column":30,"index":826},"end":{"line":35,"column":37,"index":833}}, + "operator": "keyof", + "typeAnnotation": { + "type": "TSTypeReference", + "start":832,"end":833,"loc":{"start":{"line":35,"column":36,"index":832},"end":{"line":35,"column":37,"index":833}}, + "typeName": { + "type": "Identifier", + "start":832,"end":833,"loc":{"start":{"line":35,"column":36,"index":832},"end":{"line":35,"column":37,"index":833},"identifierName":"T"}, + "name": "T" + } + } + } + } + ] + }, + "typeAnnotation": { + "type": "TSIndexedAccessType", + "start":837,"end":841,"loc":{"start":{"line":35,"column":41,"index":837},"end":{"line":35,"column":45,"index":841}}, + "objectType": { + "type": "TSTypeReference", + "start":837,"end":838,"loc":{"start":{"line":35,"column":41,"index":837},"end":{"line":35,"column":42,"index":838}}, + "typeName": { + "type": "Identifier", + "start":837,"end":838,"loc":{"start":{"line":35,"column":41,"index":837},"end":{"line":35,"column":42,"index":838},"identifierName":"T"}, + "name": "T" + } + }, + "indexType": { + "type": "TSTypeReference", + "start":839,"end":840,"loc":{"start":{"line":35,"column":43,"index":839},"end":{"line":35,"column":44,"index":840}}, + "typeName": { + "type": "Identifier", + "start":839,"end":840,"loc":{"start":{"line":35,"column":43,"index":839},"end":{"line":35,"column":44,"index":840},"identifierName":"K"}, + "name": "K" + } + } + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":843,"end":875,"loc":{"start":{"line":36,"column":0,"index":843},"end":{"line":36,"column":32,"index":875}}, + "id": { + "type": "Identifier", + "start":848,"end":851,"loc":{"start":{"line":36,"column":5,"index":848},"end":{"line":36,"column":8,"index":851},"identifierName":"T13"}, + "name": "T13" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":851,"end":861,"loc":{"start":{"line":36,"column":8,"index":851},"end":{"line":36,"column":18,"index":861}}, + "params": [ + { + "type": "TSTypeParameter", + "start":852,"end":860,"loc":{"start":{"line":36,"column":9,"index":852},"end":{"line":36,"column":17,"index":860}}, + "in": true, + "out": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSIndexedAccessType", + "start":864,"end":874,"loc":{"start":{"line":36,"column":21,"index":864},"end":{"line":36,"column":31,"index":874}}, + "objectType": { + "type": "TSTypeReference", + "start":864,"end":865,"loc":{"start":{"line":36,"column":21,"index":864},"end":{"line":36,"column":22,"index":865}}, + "typeName": { + "type": "Identifier", + "start":864,"end":865,"loc":{"start":{"line":36,"column":21,"index":864},"end":{"line":36,"column":22,"index":865},"identifierName":"T"}, + "name": "T" + } + }, + "indexType": { + "type": "TSTypeOperator", + "start":866,"end":873,"loc":{"start":{"line":36,"column":23,"index":866},"end":{"line":36,"column":30,"index":873}}, + "operator": "keyof", + "typeAnnotation": { + "type": "TSTypeReference", + "start":872,"end":873,"loc":{"start":{"line":36,"column":29,"index":872},"end":{"line":36,"column":30,"index":873}}, + "typeName": { + "type": "Identifier", + "start":872,"end":873,"loc":{"start":{"line":36,"column":29,"index":872},"end":{"line":36,"column":30,"index":873},"identifierName":"T"}, + "name": "T" + } + } + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Variance annotation errors", + "start":877,"end":906,"loc":{"start":{"line":38,"column":0,"index":877},"end":{"line":38,"column":29,"index":906}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":908,"end":955,"loc":{"start":{"line":40,"column":0,"index":908},"end":{"line":42,"column":1,"index":955}}, + "id": { + "type": "Identifier", + "start":913,"end":923,"loc":{"start":{"line":40,"column":5,"index":913},"end":{"line":40,"column":15,"index":923},"identifierName":"Covariant1"}, + "name": "Covariant1" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":923,"end":929,"loc":{"start":{"line":40,"column":15,"index":923},"end":{"line":40,"column":21,"index":929}}, + "params": [ + { + "type": "TSTypeParameter", + "start":924,"end":928,"loc":{"start":{"line":40,"column":16,"index":924},"end":{"line":40,"column":20,"index":928}}, + "in": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":932,"end":955,"loc":{"start":{"line":40,"column":24,"index":932},"end":{"line":42,"column":1,"index":955}}, + "members": [ + { + "type": "TSPropertySignature", + "start":948,"end":953,"loc":{"start":{"line":41,"column":4,"index":948},"end":{"line":41,"column":9,"index":953}}, + "key": { + "type": "Identifier", + "start":948,"end":949,"loc":{"start":{"line":41,"column":4,"index":948},"end":{"line":41,"column":5,"index":949},"identifierName":"x"}, + "name": "x" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":949,"end":952,"loc":{"start":{"line":41,"column":5,"index":949},"end":{"line":41,"column":8,"index":952}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":951,"end":952,"loc":{"start":{"line":41,"column":7,"index":951},"end":{"line":41,"column":8,"index":952}}, + "typeName": { + "type": "Identifier", + "start":951,"end":952,"loc":{"start":{"line":41,"column":7,"index":951},"end":{"line":41,"column":8,"index":952},"identifierName":"T"}, + "name": "T" + } + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":935,"end":943,"loc":{"start":{"line":40,"column":27,"index":935},"end":{"line":40,"column":35,"index":943}} + } + ] + } + ] + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Variance annotation errors", + "start":877,"end":906,"loc":{"start":{"line":38,"column":0,"index":877},"end":{"line":38,"column":29,"index":906}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":957,"end":994,"loc":{"start":{"line":44,"column":0,"index":957},"end":{"line":44,"column":37,"index":994}}, + "id": { + "type": "Identifier", + "start":962,"end":976,"loc":{"start":{"line":44,"column":5,"index":962},"end":{"line":44,"column":19,"index":976},"identifierName":"Contravariant1"}, + "name": "Contravariant1" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":976,"end":983,"loc":{"start":{"line":44,"column":19,"index":976},"end":{"line":44,"column":26,"index":983}}, + "params": [ + { + "type": "TSTypeParameter", + "start":977,"end":982,"loc":{"start":{"line":44,"column":20,"index":977},"end":{"line":44,"column":25,"index":982}}, + "out": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeOperator", + "start":986,"end":993,"loc":{"start":{"line":44,"column":29,"index":986},"end":{"line":44,"column":36,"index":993}}, + "operator": "keyof", + "typeAnnotation": { + "type": "TSTypeReference", + "start":992,"end":993,"loc":{"start":{"line":44,"column":35,"index":992},"end":{"line":44,"column":36,"index":993}}, + "typeName": { + "type": "Identifier", + "start":992,"end":993,"loc":{"start":{"line":44,"column":35,"index":992},"end":{"line":44,"column":36,"index":993},"identifierName":"T"}, + "name": "T" + } + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":996,"end":1004,"loc":{"start":{"line":44,"column":39,"index":996},"end":{"line":44,"column":47,"index":1004}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":1006,"end":1071,"loc":{"start":{"line":46,"column":0,"index":1006},"end":{"line":48,"column":1,"index":1071}}, + "id": { + "type": "Identifier", + "start":1011,"end":1025,"loc":{"start":{"line":46,"column":5,"index":1011},"end":{"line":46,"column":19,"index":1025},"identifierName":"Contravariant2"}, + "name": "Contravariant2" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1025,"end":1032,"loc":{"start":{"line":46,"column":19,"index":1025},"end":{"line":46,"column":26,"index":1032}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1026,"end":1031,"loc":{"start":{"line":46,"column":20,"index":1026},"end":{"line":46,"column":25,"index":1031}}, + "out": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":1035,"end":1071,"loc":{"start":{"line":46,"column":29,"index":1035},"end":{"line":48,"column":1,"index":1071}}, + "members": [ + { + "type": "TSPropertySignature", + "start":1051,"end":1069,"loc":{"start":{"line":47,"column":4,"index":1051},"end":{"line":47,"column":22,"index":1069}}, + "key": { + "type": "Identifier", + "start":1051,"end":1052,"loc":{"start":{"line":47,"column":4,"index":1051},"end":{"line":47,"column":5,"index":1052},"identifierName":"f"}, + "name": "f" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1052,"end":1068,"loc":{"start":{"line":47,"column":5,"index":1052},"end":{"line":47,"column":21,"index":1068}}, + "typeAnnotation": { + "type": "TSFunctionType", + "start":1054,"end":1068,"loc":{"start":{"line":47,"column":7,"index":1054},"end":{"line":47,"column":21,"index":1068}}, + "parameters": [ + { + "type": "Identifier", + "start":1055,"end":1059,"loc":{"start":{"line":47,"column":8,"index":1055},"end":{"line":47,"column":12,"index":1059},"identifierName":"x"}, + "name": "x", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1056,"end":1059,"loc":{"start":{"line":47,"column":9,"index":1056},"end":{"line":47,"column":12,"index":1059}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1058,"end":1059,"loc":{"start":{"line":47,"column":11,"index":1058},"end":{"line":47,"column":12,"index":1059}}, + "typeName": { + "type": "Identifier", + "start":1058,"end":1059,"loc":{"start":{"line":47,"column":11,"index":1058},"end":{"line":47,"column":12,"index":1059},"identifierName":"T"}, + "name": "T" + } + } + } + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1061,"end":1068,"loc":{"start":{"line":47,"column":14,"index":1061},"end":{"line":47,"column":21,"index":1068}}, + "typeAnnotation": { + "type": "TSVoidKeyword", + "start":1064,"end":1068,"loc":{"start":{"line":47,"column":17,"index":1064},"end":{"line":47,"column":21,"index":1068}} + } + } + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1038,"end":1046,"loc":{"start":{"line":46,"column":32,"index":1038},"end":{"line":46,"column":40,"index":1046}} + } + ] + } + ] + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":996,"end":1004,"loc":{"start":{"line":44,"column":39,"index":996},"end":{"line":44,"column":47,"index":1004}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":1073,"end":1130,"loc":{"start":{"line":50,"column":0,"index":1073},"end":{"line":52,"column":1,"index":1130}}, + "id": { + "type": "Identifier", + "start":1078,"end":1088,"loc":{"start":{"line":50,"column":5,"index":1078},"end":{"line":50,"column":15,"index":1088},"identifierName":"Invariant1"}, + "name": "Invariant1" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1088,"end":1094,"loc":{"start":{"line":50,"column":15,"index":1088},"end":{"line":50,"column":21,"index":1094}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1089,"end":1093,"loc":{"start":{"line":50,"column":16,"index":1089},"end":{"line":50,"column":20,"index":1093}}, + "in": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":1097,"end":1130,"loc":{"start":{"line":50,"column":24,"index":1097},"end":{"line":52,"column":1,"index":1130}}, + "members": [ + { + "type": "TSPropertySignature", + "start":1113,"end":1128,"loc":{"start":{"line":51,"column":4,"index":1113},"end":{"line":51,"column":19,"index":1128}}, + "key": { + "type": "Identifier", + "start":1113,"end":1114,"loc":{"start":{"line":51,"column":4,"index":1113},"end":{"line":51,"column":5,"index":1114},"identifierName":"f"}, + "name": "f" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1114,"end":1127,"loc":{"start":{"line":51,"column":5,"index":1114},"end":{"line":51,"column":18,"index":1127}}, + "typeAnnotation": { + "type": "TSFunctionType", + "start":1116,"end":1127,"loc":{"start":{"line":51,"column":7,"index":1116},"end":{"line":51,"column":18,"index":1127}}, + "parameters": [ + { + "type": "Identifier", + "start":1117,"end":1121,"loc":{"start":{"line":51,"column":8,"index":1117},"end":{"line":51,"column":12,"index":1121},"identifierName":"x"}, + "name": "x", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1118,"end":1121,"loc":{"start":{"line":51,"column":9,"index":1118},"end":{"line":51,"column":12,"index":1121}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1120,"end":1121,"loc":{"start":{"line":51,"column":11,"index":1120},"end":{"line":51,"column":12,"index":1121}}, + "typeName": { + "type": "Identifier", + "start":1120,"end":1121,"loc":{"start":{"line":51,"column":11,"index":1120},"end":{"line":51,"column":12,"index":1121},"identifierName":"T"}, + "name": "T" + } + } + } + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1123,"end":1127,"loc":{"start":{"line":51,"column":14,"index":1123},"end":{"line":51,"column":18,"index":1127}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1126,"end":1127,"loc":{"start":{"line":51,"column":17,"index":1126},"end":{"line":51,"column":18,"index":1127}}, + "typeName": { + "type": "Identifier", + "start":1126,"end":1127,"loc":{"start":{"line":51,"column":17,"index":1126},"end":{"line":51,"column":18,"index":1127},"identifierName":"T"}, + "name": "T" + } + } + } + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1100,"end":1108,"loc":{"start":{"line":50,"column":27,"index":1100},"end":{"line":50,"column":35,"index":1108}} + } + ] + } + ] + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":1132,"end":1190,"loc":{"start":{"line":54,"column":0,"index":1132},"end":{"line":56,"column":1,"index":1190}}, + "id": { + "type": "Identifier", + "start":1137,"end":1147,"loc":{"start":{"line":54,"column":5,"index":1137},"end":{"line":54,"column":15,"index":1147},"identifierName":"Invariant2"}, + "name": "Invariant2" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1147,"end":1154,"loc":{"start":{"line":54,"column":15,"index":1147},"end":{"line":54,"column":22,"index":1154}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1148,"end":1153,"loc":{"start":{"line":54,"column":16,"index":1148},"end":{"line":54,"column":21,"index":1153}}, + "out": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":1157,"end":1190,"loc":{"start":{"line":54,"column":25,"index":1157},"end":{"line":56,"column":1,"index":1190}}, + "members": [ + { + "type": "TSPropertySignature", + "start":1173,"end":1188,"loc":{"start":{"line":55,"column":4,"index":1173},"end":{"line":55,"column":19,"index":1188}}, + "key": { + "type": "Identifier", + "start":1173,"end":1174,"loc":{"start":{"line":55,"column":4,"index":1173},"end":{"line":55,"column":5,"index":1174},"identifierName":"f"}, + "name": "f" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1174,"end":1187,"loc":{"start":{"line":55,"column":5,"index":1174},"end":{"line":55,"column":18,"index":1187}}, + "typeAnnotation": { + "type": "TSFunctionType", + "start":1176,"end":1187,"loc":{"start":{"line":55,"column":7,"index":1176},"end":{"line":55,"column":18,"index":1187}}, + "parameters": [ + { + "type": "Identifier", + "start":1177,"end":1181,"loc":{"start":{"line":55,"column":8,"index":1177},"end":{"line":55,"column":12,"index":1181},"identifierName":"x"}, + "name": "x", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1178,"end":1181,"loc":{"start":{"line":55,"column":9,"index":1178},"end":{"line":55,"column":12,"index":1181}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1180,"end":1181,"loc":{"start":{"line":55,"column":11,"index":1180},"end":{"line":55,"column":12,"index":1181}}, + "typeName": { + "type": "Identifier", + "start":1180,"end":1181,"loc":{"start":{"line":55,"column":11,"index":1180},"end":{"line":55,"column":12,"index":1181},"identifierName":"T"}, + "name": "T" + } + } + } + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1183,"end":1187,"loc":{"start":{"line":55,"column":14,"index":1183},"end":{"line":55,"column":18,"index":1187}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1186,"end":1187,"loc":{"start":{"line":55,"column":17,"index":1186},"end":{"line":55,"column":18,"index":1187}}, + "typeName": { + "type": "Identifier", + "start":1186,"end":1187,"loc":{"start":{"line":55,"column":17,"index":1186},"end":{"line":55,"column":18,"index":1187},"identifierName":"T"}, + "name": "T" + } + } + } + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1160,"end":1168,"loc":{"start":{"line":54,"column":28,"index":1160},"end":{"line":54,"column":36,"index":1168}} + } + ] + } + ] + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Variance in circular types", + "start":1192,"end":1221,"loc":{"start":{"line":58,"column":0,"index":1192},"end":{"line":58,"column":29,"index":1221}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":1223,"end":1282,"loc":{"start":{"line":60,"column":0,"index":1223},"end":{"line":63,"column":1,"index":1282}}, + "id": { + "type": "Identifier", + "start":1228,"end":1232,"loc":{"start":{"line":60,"column":5,"index":1228},"end":{"line":60,"column":9,"index":1232},"identifierName":"Foo1"}, + "name": "Foo1" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1232,"end":1238,"loc":{"start":{"line":60,"column":9,"index":1232},"end":{"line":60,"column":15,"index":1238}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1233,"end":1237,"loc":{"start":{"line":60,"column":10,"index":1233},"end":{"line":60,"column":14,"index":1237}}, + "in": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":1241,"end":1282,"loc":{"start":{"line":60,"column":18,"index":1241},"end":{"line":63,"column":1,"index":1282}}, + "members": [ + { + "type": "TSPropertySignature", + "start":1257,"end":1262,"loc":{"start":{"line":61,"column":4,"index":1257},"end":{"line":61,"column":9,"index":1262}}, + "key": { + "type": "Identifier", + "start":1257,"end":1258,"loc":{"start":{"line":61,"column":4,"index":1257},"end":{"line":61,"column":5,"index":1258},"identifierName":"x"}, + "name": "x" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1258,"end":1261,"loc":{"start":{"line":61,"column":5,"index":1258},"end":{"line":61,"column":8,"index":1261}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1260,"end":1261,"loc":{"start":{"line":61,"column":7,"index":1260},"end":{"line":61,"column":8,"index":1261}}, + "typeName": { + "type": "Identifier", + "start":1260,"end":1261,"loc":{"start":{"line":61,"column":7,"index":1260},"end":{"line":61,"column":8,"index":1261},"identifierName":"T"}, + "name": "T" + } + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1244,"end":1252,"loc":{"start":{"line":60,"column":21,"index":1244},"end":{"line":60,"column":29,"index":1252}} + } + ] + }, + { + "type": "TSPropertySignature", + "start":1267,"end":1280,"loc":{"start":{"line":62,"column":4,"index":1267},"end":{"line":62,"column":17,"index":1280}}, + "key": { + "type": "Identifier", + "start":1267,"end":1268,"loc":{"start":{"line":62,"column":4,"index":1267},"end":{"line":62,"column":5,"index":1268},"identifierName":"f"}, + "name": "f" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1268,"end":1279,"loc":{"start":{"line":62,"column":5,"index":1268},"end":{"line":62,"column":16,"index":1279}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1270,"end":1279,"loc":{"start":{"line":62,"column":7,"index":1270},"end":{"line":62,"column":16,"index":1279}}, + "typeName": { + "type": "Identifier", + "start":1270,"end":1276,"loc":{"start":{"line":62,"column":7,"index":1270},"end":{"line":62,"column":13,"index":1276},"identifierName":"FooFn1"}, + "name": "FooFn1" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":1276,"end":1279,"loc":{"start":{"line":62,"column":13,"index":1276},"end":{"line":62,"column":16,"index":1279}}, + "params": [ + { + "type": "TSTypeReference", + "start":1277,"end":1278,"loc":{"start":{"line":62,"column":14,"index":1277},"end":{"line":62,"column":15,"index":1278}}, + "typeName": { + "type": "Identifier", + "start":1277,"end":1278,"loc":{"start":{"line":62,"column":14,"index":1277},"end":{"line":62,"column":15,"index":1278},"identifierName":"T"}, + "name": "T" + } + } + ] + } + } + } + } + ] + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Variance in circular types", + "start":1192,"end":1221,"loc":{"start":{"line":58,"column":0,"index":1192},"end":{"line":58,"column":29,"index":1221}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":1284,"end":1326,"loc":{"start":{"line":65,"column":0,"index":1284},"end":{"line":65,"column":42,"index":1326}}, + "id": { + "type": "Identifier", + "start":1289,"end":1295,"loc":{"start":{"line":65,"column":5,"index":1289},"end":{"line":65,"column":11,"index":1295},"identifierName":"FooFn1"}, + "name": "FooFn1" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1295,"end":1298,"loc":{"start":{"line":65,"column":11,"index":1295},"end":{"line":65,"column":14,"index":1298}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1296,"end":1297,"loc":{"start":{"line":65,"column":12,"index":1296},"end":{"line":65,"column":13,"index":1297}}, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSFunctionType", + "start":1301,"end":1325,"loc":{"start":{"line":65,"column":17,"index":1301},"end":{"line":65,"column":41,"index":1325}}, + "parameters": [ + { + "type": "Identifier", + "start":1302,"end":1316,"loc":{"start":{"line":65,"column":18,"index":1302},"end":{"line":65,"column":32,"index":1316},"identifierName":"foo"}, + "name": "foo", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1305,"end":1316,"loc":{"start":{"line":65,"column":21,"index":1305},"end":{"line":65,"column":32,"index":1316}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1307,"end":1316,"loc":{"start":{"line":65,"column":23,"index":1307},"end":{"line":65,"column":32,"index":1316}}, + "typeName": { + "type": "Identifier", + "start":1307,"end":1311,"loc":{"start":{"line":65,"column":23,"index":1307},"end":{"line":65,"column":27,"index":1311},"identifierName":"Bar1"}, + "name": "Bar1" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":1311,"end":1316,"loc":{"start":{"line":65,"column":27,"index":1311},"end":{"line":65,"column":32,"index":1316}}, + "params": [ + { + "type": "TSArrayType", + "start":1312,"end":1315,"loc":{"start":{"line":65,"column":28,"index":1312},"end":{"line":65,"column":31,"index":1315}}, + "elementType": { + "type": "TSTypeReference", + "start":1312,"end":1313,"loc":{"start":{"line":65,"column":28,"index":1312},"end":{"line":65,"column":29,"index":1313}}, + "typeName": { + "type": "Identifier", + "start":1312,"end":1313,"loc":{"start":{"line":65,"column":28,"index":1312},"end":{"line":65,"column":29,"index":1313},"identifierName":"T"}, + "name": "T" + } + } + } + ] + } + } + } + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1318,"end":1325,"loc":{"start":{"line":65,"column":34,"index":1318},"end":{"line":65,"column":41,"index":1325}}, + "typeAnnotation": { + "type": "TSVoidKeyword", + "start":1321,"end":1325,"loc":{"start":{"line":65,"column":37,"index":1321},"end":{"line":65,"column":41,"index":1325}} + } + } + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":1328,"end":1368,"loc":{"start":{"line":67,"column":0,"index":1328},"end":{"line":69,"column":1,"index":1368}}, + "id": { + "type": "Identifier", + "start":1333,"end":1337,"loc":{"start":{"line":67,"column":5,"index":1333},"end":{"line":67,"column":9,"index":1337},"identifierName":"Bar1"}, + "name": "Bar1" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1337,"end":1340,"loc":{"start":{"line":67,"column":9,"index":1337},"end":{"line":67,"column":12,"index":1340}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1338,"end":1339,"loc":{"start":{"line":67,"column":10,"index":1338},"end":{"line":67,"column":11,"index":1339}}, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":1343,"end":1368,"loc":{"start":{"line":67,"column":15,"index":1343},"end":{"line":69,"column":1,"index":1368}}, + "members": [ + { + "type": "TSPropertySignature", + "start":1349,"end":1366,"loc":{"start":{"line":68,"column":4,"index":1349},"end":{"line":68,"column":21,"index":1366}}, + "key": { + "type": "Identifier", + "start":1349,"end":1354,"loc":{"start":{"line":68,"column":4,"index":1349},"end":{"line":68,"column":9,"index":1354},"identifierName":"value"}, + "name": "value" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1354,"end":1365,"loc":{"start":{"line":68,"column":9,"index":1354},"end":{"line":68,"column":20,"index":1365}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1356,"end":1365,"loc":{"start":{"line":68,"column":11,"index":1356},"end":{"line":68,"column":20,"index":1365}}, + "typeName": { + "type": "Identifier", + "start":1356,"end":1360,"loc":{"start":{"line":68,"column":11,"index":1356},"end":{"line":68,"column":15,"index":1360},"identifierName":"Foo1"}, + "name": "Foo1" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":1360,"end":1365,"loc":{"start":{"line":68,"column":15,"index":1360},"end":{"line":68,"column":20,"index":1365}}, + "params": [ + { + "type": "TSArrayType", + "start":1361,"end":1364,"loc":{"start":{"line":68,"column":16,"index":1361},"end":{"line":68,"column":19,"index":1364}}, + "elementType": { + "type": "TSTypeReference", + "start":1361,"end":1362,"loc":{"start":{"line":68,"column":16,"index":1361},"end":{"line":68,"column":17,"index":1362}}, + "typeName": { + "type": "Identifier", + "start":1361,"end":1362,"loc":{"start":{"line":68,"column":16,"index":1361},"end":{"line":68,"column":17,"index":1362},"identifierName":"T"}, + "name": "T" + } + } + } + ] + } + } + } + } + ] + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":1370,"end":1430,"loc":{"start":{"line":71,"column":0,"index":1370},"end":{"line":74,"column":1,"index":1430}}, + "id": { + "type": "Identifier", + "start":1375,"end":1379,"loc":{"start":{"line":71,"column":5,"index":1375},"end":{"line":71,"column":9,"index":1379},"identifierName":"Foo2"}, + "name": "Foo2" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1379,"end":1386,"loc":{"start":{"line":71,"column":9,"index":1379},"end":{"line":71,"column":16,"index":1386}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1380,"end":1385,"loc":{"start":{"line":71,"column":10,"index":1380},"end":{"line":71,"column":15,"index":1385}}, + "out": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":1389,"end":1430,"loc":{"start":{"line":71,"column":19,"index":1389},"end":{"line":74,"column":1,"index":1430}}, + "members": [ + { + "type": "TSPropertySignature", + "start":1405,"end":1410,"loc":{"start":{"line":72,"column":4,"index":1405},"end":{"line":72,"column":9,"index":1410}}, + "key": { + "type": "Identifier", + "start":1405,"end":1406,"loc":{"start":{"line":72,"column":4,"index":1405},"end":{"line":72,"column":5,"index":1406},"identifierName":"x"}, + "name": "x" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1406,"end":1409,"loc":{"start":{"line":72,"column":5,"index":1406},"end":{"line":72,"column":8,"index":1409}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1408,"end":1409,"loc":{"start":{"line":72,"column":7,"index":1408},"end":{"line":72,"column":8,"index":1409}}, + "typeName": { + "type": "Identifier", + "start":1408,"end":1409,"loc":{"start":{"line":72,"column":7,"index":1408},"end":{"line":72,"column":8,"index":1409},"identifierName":"T"}, + "name": "T" + } + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1392,"end":1400,"loc":{"start":{"line":71,"column":22,"index":1392},"end":{"line":71,"column":30,"index":1400}} + } + ] + }, + { + "type": "TSPropertySignature", + "start":1415,"end":1428,"loc":{"start":{"line":73,"column":4,"index":1415},"end":{"line":73,"column":17,"index":1428}}, + "key": { + "type": "Identifier", + "start":1415,"end":1416,"loc":{"start":{"line":73,"column":4,"index":1415},"end":{"line":73,"column":5,"index":1416},"identifierName":"f"}, + "name": "f" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1416,"end":1427,"loc":{"start":{"line":73,"column":5,"index":1416},"end":{"line":73,"column":16,"index":1427}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1418,"end":1427,"loc":{"start":{"line":73,"column":7,"index":1418},"end":{"line":73,"column":16,"index":1427}}, + "typeName": { + "type": "Identifier", + "start":1418,"end":1424,"loc":{"start":{"line":73,"column":7,"index":1418},"end":{"line":73,"column":13,"index":1424},"identifierName":"FooFn2"}, + "name": "FooFn2" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":1424,"end":1427,"loc":{"start":{"line":73,"column":13,"index":1424},"end":{"line":73,"column":16,"index":1427}}, + "params": [ + { + "type": "TSTypeReference", + "start":1425,"end":1426,"loc":{"start":{"line":73,"column":14,"index":1425},"end":{"line":73,"column":15,"index":1426}}, + "typeName": { + "type": "Identifier", + "start":1425,"end":1426,"loc":{"start":{"line":73,"column":14,"index":1425},"end":{"line":73,"column":15,"index":1426},"identifierName":"T"}, + "name": "T" + } + } + ] + } + } + } + } + ] + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":1432,"end":1474,"loc":{"start":{"line":76,"column":0,"index":1432},"end":{"line":76,"column":42,"index":1474}}, + "id": { + "type": "Identifier", + "start":1437,"end":1443,"loc":{"start":{"line":76,"column":5,"index":1437},"end":{"line":76,"column":11,"index":1443},"identifierName":"FooFn2"}, + "name": "FooFn2" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1443,"end":1446,"loc":{"start":{"line":76,"column":11,"index":1443},"end":{"line":76,"column":14,"index":1446}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1444,"end":1445,"loc":{"start":{"line":76,"column":12,"index":1444},"end":{"line":76,"column":13,"index":1445}}, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSFunctionType", + "start":1449,"end":1473,"loc":{"start":{"line":76,"column":17,"index":1449},"end":{"line":76,"column":41,"index":1473}}, + "parameters": [ + { + "type": "Identifier", + "start":1450,"end":1464,"loc":{"start":{"line":76,"column":18,"index":1450},"end":{"line":76,"column":32,"index":1464},"identifierName":"foo"}, + "name": "foo", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1453,"end":1464,"loc":{"start":{"line":76,"column":21,"index":1453},"end":{"line":76,"column":32,"index":1464}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1455,"end":1464,"loc":{"start":{"line":76,"column":23,"index":1455},"end":{"line":76,"column":32,"index":1464}}, + "typeName": { + "type": "Identifier", + "start":1455,"end":1459,"loc":{"start":{"line":76,"column":23,"index":1455},"end":{"line":76,"column":27,"index":1459},"identifierName":"Bar2"}, + "name": "Bar2" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":1459,"end":1464,"loc":{"start":{"line":76,"column":27,"index":1459},"end":{"line":76,"column":32,"index":1464}}, + "params": [ + { + "type": "TSArrayType", + "start":1460,"end":1463,"loc":{"start":{"line":76,"column":28,"index":1460},"end":{"line":76,"column":31,"index":1463}}, + "elementType": { + "type": "TSTypeReference", + "start":1460,"end":1461,"loc":{"start":{"line":76,"column":28,"index":1460},"end":{"line":76,"column":29,"index":1461}}, + "typeName": { + "type": "Identifier", + "start":1460,"end":1461,"loc":{"start":{"line":76,"column":28,"index":1460},"end":{"line":76,"column":29,"index":1461},"identifierName":"T"}, + "name": "T" + } + } + } + ] + } + } + } + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1466,"end":1473,"loc":{"start":{"line":76,"column":34,"index":1466},"end":{"line":76,"column":41,"index":1473}}, + "typeAnnotation": { + "type": "TSVoidKeyword", + "start":1469,"end":1473,"loc":{"start":{"line":76,"column":37,"index":1469},"end":{"line":76,"column":41,"index":1473}} + } + } + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":1476,"end":1516,"loc":{"start":{"line":78,"column":0,"index":1476},"end":{"line":80,"column":1,"index":1516}}, + "id": { + "type": "Identifier", + "start":1481,"end":1485,"loc":{"start":{"line":78,"column":5,"index":1481},"end":{"line":78,"column":9,"index":1485},"identifierName":"Bar2"}, + "name": "Bar2" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1485,"end":1488,"loc":{"start":{"line":78,"column":9,"index":1485},"end":{"line":78,"column":12,"index":1488}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1486,"end":1487,"loc":{"start":{"line":78,"column":10,"index":1486},"end":{"line":78,"column":11,"index":1487}}, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":1491,"end":1516,"loc":{"start":{"line":78,"column":15,"index":1491},"end":{"line":80,"column":1,"index":1516}}, + "members": [ + { + "type": "TSPropertySignature", + "start":1497,"end":1514,"loc":{"start":{"line":79,"column":4,"index":1497},"end":{"line":79,"column":21,"index":1514}}, + "key": { + "type": "Identifier", + "start":1497,"end":1502,"loc":{"start":{"line":79,"column":4,"index":1497},"end":{"line":79,"column":9,"index":1502},"identifierName":"value"}, + "name": "value" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1502,"end":1513,"loc":{"start":{"line":79,"column":9,"index":1502},"end":{"line":79,"column":20,"index":1513}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1504,"end":1513,"loc":{"start":{"line":79,"column":11,"index":1504},"end":{"line":79,"column":20,"index":1513}}, + "typeName": { + "type": "Identifier", + "start":1504,"end":1508,"loc":{"start":{"line":79,"column":11,"index":1504},"end":{"line":79,"column":15,"index":1508},"identifierName":"Foo2"}, + "name": "Foo2" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":1508,"end":1513,"loc":{"start":{"line":79,"column":15,"index":1508},"end":{"line":79,"column":20,"index":1513}}, + "params": [ + { + "type": "TSArrayType", + "start":1509,"end":1512,"loc":{"start":{"line":79,"column":16,"index":1509},"end":{"line":79,"column":19,"index":1512}}, + "elementType": { + "type": "TSTypeReference", + "start":1509,"end":1510,"loc":{"start":{"line":79,"column":16,"index":1509},"end":{"line":79,"column":17,"index":1510}}, + "typeName": { + "type": "Identifier", + "start":1509,"end":1510,"loc":{"start":{"line":79,"column":16,"index":1509},"end":{"line":79,"column":17,"index":1510},"identifierName":"T"}, + "name": "T" + } + } + } + ] + } + } + } + } + ] + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":1518,"end":1571,"loc":{"start":{"line":82,"column":0,"index":1518},"end":{"line":85,"column":1,"index":1571}}, + "id": { + "type": "Identifier", + "start":1523,"end":1527,"loc":{"start":{"line":82,"column":5,"index":1523},"end":{"line":82,"column":9,"index":1527},"identifierName":"Foo3"}, + "name": "Foo3" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1527,"end":1537,"loc":{"start":{"line":82,"column":9,"index":1527},"end":{"line":82,"column":19,"index":1537}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1528,"end":1536,"loc":{"start":{"line":82,"column":10,"index":1528},"end":{"line":82,"column":18,"index":1536}}, + "in": true, + "out": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":1540,"end":1571,"loc":{"start":{"line":82,"column":22,"index":1540},"end":{"line":85,"column":1,"index":1571}}, + "members": [ + { + "type": "TSPropertySignature", + "start":1546,"end":1551,"loc":{"start":{"line":83,"column":4,"index":1546},"end":{"line":83,"column":9,"index":1551}}, + "key": { + "type": "Identifier", + "start":1546,"end":1547,"loc":{"start":{"line":83,"column":4,"index":1546},"end":{"line":83,"column":5,"index":1547},"identifierName":"x"}, + "name": "x" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1547,"end":1550,"loc":{"start":{"line":83,"column":5,"index":1547},"end":{"line":83,"column":8,"index":1550}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1549,"end":1550,"loc":{"start":{"line":83,"column":7,"index":1549},"end":{"line":83,"column":8,"index":1550}}, + "typeName": { + "type": "Identifier", + "start":1549,"end":1550,"loc":{"start":{"line":83,"column":7,"index":1549},"end":{"line":83,"column":8,"index":1550},"identifierName":"T"}, + "name": "T" + } + } + } + }, + { + "type": "TSPropertySignature", + "start":1556,"end":1569,"loc":{"start":{"line":84,"column":4,"index":1556},"end":{"line":84,"column":17,"index":1569}}, + "key": { + "type": "Identifier", + "start":1556,"end":1557,"loc":{"start":{"line":84,"column":4,"index":1556},"end":{"line":84,"column":5,"index":1557},"identifierName":"f"}, + "name": "f" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1557,"end":1568,"loc":{"start":{"line":84,"column":5,"index":1557},"end":{"line":84,"column":16,"index":1568}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1559,"end":1568,"loc":{"start":{"line":84,"column":7,"index":1559},"end":{"line":84,"column":16,"index":1568}}, + "typeName": { + "type": "Identifier", + "start":1559,"end":1565,"loc":{"start":{"line":84,"column":7,"index":1559},"end":{"line":84,"column":13,"index":1565},"identifierName":"FooFn3"}, + "name": "FooFn3" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":1565,"end":1568,"loc":{"start":{"line":84,"column":13,"index":1565},"end":{"line":84,"column":16,"index":1568}}, + "params": [ + { + "type": "TSTypeReference", + "start":1566,"end":1567,"loc":{"start":{"line":84,"column":14,"index":1566},"end":{"line":84,"column":15,"index":1567}}, + "typeName": { + "type": "Identifier", + "start":1566,"end":1567,"loc":{"start":{"line":84,"column":14,"index":1566},"end":{"line":84,"column":15,"index":1567},"identifierName":"T"}, + "name": "T" + } + } + ] + } + } + } + } + ] + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":1573,"end":1615,"loc":{"start":{"line":87,"column":0,"index":1573},"end":{"line":87,"column":42,"index":1615}}, + "id": { + "type": "Identifier", + "start":1578,"end":1584,"loc":{"start":{"line":87,"column":5,"index":1578},"end":{"line":87,"column":11,"index":1584},"identifierName":"FooFn3"}, + "name": "FooFn3" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1584,"end":1587,"loc":{"start":{"line":87,"column":11,"index":1584},"end":{"line":87,"column":14,"index":1587}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1585,"end":1586,"loc":{"start":{"line":87,"column":12,"index":1585},"end":{"line":87,"column":13,"index":1586}}, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSFunctionType", + "start":1590,"end":1614,"loc":{"start":{"line":87,"column":17,"index":1590},"end":{"line":87,"column":41,"index":1614}}, + "parameters": [ + { + "type": "Identifier", + "start":1591,"end":1605,"loc":{"start":{"line":87,"column":18,"index":1591},"end":{"line":87,"column":32,"index":1605},"identifierName":"foo"}, + "name": "foo", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1594,"end":1605,"loc":{"start":{"line":87,"column":21,"index":1594},"end":{"line":87,"column":32,"index":1605}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1596,"end":1605,"loc":{"start":{"line":87,"column":23,"index":1596},"end":{"line":87,"column":32,"index":1605}}, + "typeName": { + "type": "Identifier", + "start":1596,"end":1600,"loc":{"start":{"line":87,"column":23,"index":1596},"end":{"line":87,"column":27,"index":1600},"identifierName":"Bar3"}, + "name": "Bar3" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":1600,"end":1605,"loc":{"start":{"line":87,"column":27,"index":1600},"end":{"line":87,"column":32,"index":1605}}, + "params": [ + { + "type": "TSArrayType", + "start":1601,"end":1604,"loc":{"start":{"line":87,"column":28,"index":1601},"end":{"line":87,"column":31,"index":1604}}, + "elementType": { + "type": "TSTypeReference", + "start":1601,"end":1602,"loc":{"start":{"line":87,"column":28,"index":1601},"end":{"line":87,"column":29,"index":1602}}, + "typeName": { + "type": "Identifier", + "start":1601,"end":1602,"loc":{"start":{"line":87,"column":28,"index":1601},"end":{"line":87,"column":29,"index":1602},"identifierName":"T"}, + "name": "T" + } + } + } + ] + } + } + } + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1607,"end":1614,"loc":{"start":{"line":87,"column":34,"index":1607},"end":{"line":87,"column":41,"index":1614}}, + "typeAnnotation": { + "type": "TSVoidKeyword", + "start":1610,"end":1614,"loc":{"start":{"line":87,"column":37,"index":1610},"end":{"line":87,"column":41,"index":1614}} + } + } + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":1617,"end":1657,"loc":{"start":{"line":89,"column":0,"index":1617},"end":{"line":91,"column":1,"index":1657}}, + "id": { + "type": "Identifier", + "start":1622,"end":1626,"loc":{"start":{"line":89,"column":5,"index":1622},"end":{"line":89,"column":9,"index":1626},"identifierName":"Bar3"}, + "name": "Bar3" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1626,"end":1629,"loc":{"start":{"line":89,"column":9,"index":1626},"end":{"line":89,"column":12,"index":1629}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1627,"end":1628,"loc":{"start":{"line":89,"column":10,"index":1627},"end":{"line":89,"column":11,"index":1628}}, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":1632,"end":1657,"loc":{"start":{"line":89,"column":15,"index":1632},"end":{"line":91,"column":1,"index":1657}}, + "members": [ + { + "type": "TSPropertySignature", + "start":1638,"end":1655,"loc":{"start":{"line":90,"column":4,"index":1638},"end":{"line":90,"column":21,"index":1655}}, + "key": { + "type": "Identifier", + "start":1638,"end":1643,"loc":{"start":{"line":90,"column":4,"index":1638},"end":{"line":90,"column":9,"index":1643},"identifierName":"value"}, + "name": "value" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1643,"end":1654,"loc":{"start":{"line":90,"column":9,"index":1643},"end":{"line":90,"column":20,"index":1654}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1645,"end":1654,"loc":{"start":{"line":90,"column":11,"index":1645},"end":{"line":90,"column":20,"index":1654}}, + "typeName": { + "type": "Identifier", + "start":1645,"end":1649,"loc":{"start":{"line":90,"column":11,"index":1645},"end":{"line":90,"column":15,"index":1649},"identifierName":"Foo3"}, + "name": "Foo3" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":1649,"end":1654,"loc":{"start":{"line":90,"column":15,"index":1649},"end":{"line":90,"column":20,"index":1654}}, + "params": [ + { + "type": "TSArrayType", + "start":1650,"end":1653,"loc":{"start":{"line":90,"column":16,"index":1650},"end":{"line":90,"column":19,"index":1653}}, + "elementType": { + "type": "TSTypeReference", + "start":1650,"end":1651,"loc":{"start":{"line":90,"column":16,"index":1650},"end":{"line":90,"column":17,"index":1651}}, + "typeName": { + "type": "Identifier", + "start":1650,"end":1651,"loc":{"start":{"line":90,"column":16,"index":1650},"end":{"line":90,"column":17,"index":1651},"identifierName":"T"}, + "name": "T" + } + } + } + ] + } + } + } + } + ] + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Wrong modifier usage", + "start":1659,"end":1682,"loc":{"start":{"line":93,"column":0,"index":1659},"end":{"line":93,"column":23,"index":1682}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":1684,"end":1707,"loc":{"start":{"line":95,"column":0,"index":1684},"end":{"line":95,"column":23,"index":1707}}, + "id": { + "type": "Identifier", + "start":1689,"end":1692,"loc":{"start":{"line":95,"column":5,"index":1689},"end":{"line":95,"column":8,"index":1692},"identifierName":"T20"}, + "name": "T20" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1692,"end":1702,"loc":{"start":{"line":95,"column":8,"index":1692},"end":{"line":95,"column":18,"index":1702}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1693,"end":1701,"loc":{"start":{"line":95,"column":9,"index":1693},"end":{"line":95,"column":17,"index":1701}}, + "accessibility": "public", + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1705,"end":1706,"loc":{"start":{"line":95,"column":21,"index":1705},"end":{"line":95,"column":22,"index":1706}}, + "typeName": { + "type": "Identifier", + "start":1705,"end":1706,"loc":{"start":{"line":95,"column":21,"index":1705},"end":{"line":95,"column":22,"index":1706},"identifierName":"T"}, + "name": "T" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1709,"end":1717,"loc":{"start":{"line":95,"column":25,"index":1709},"end":{"line":95,"column":33,"index":1717}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Wrong modifier usage", + "start":1659,"end":1682,"loc":{"start":{"line":93,"column":0,"index":1659},"end":{"line":93,"column":23,"index":1682}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":1718,"end":1744,"loc":{"start":{"line":96,"column":0,"index":1718},"end":{"line":96,"column":26,"index":1744}}, + "id": { + "type": "Identifier", + "start":1723,"end":1726,"loc":{"start":{"line":96,"column":5,"index":1723},"end":{"line":96,"column":8,"index":1726},"identifierName":"T21"}, + "name": "T21" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1726,"end":1739,"loc":{"start":{"line":96,"column":8,"index":1726},"end":{"line":96,"column":21,"index":1739}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1727,"end":1738,"loc":{"start":{"line":96,"column":9,"index":1727},"end":{"line":96,"column":20,"index":1738}}, + "in": true, + "out": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1742,"end":1743,"loc":{"start":{"line":96,"column":24,"index":1742},"end":{"line":96,"column":25,"index":1743}}, + "typeName": { + "type": "Identifier", + "start":1742,"end":1743,"loc":{"start":{"line":96,"column":24,"index":1742},"end":{"line":96,"column":25,"index":1743},"identifierName":"T"}, + "name": "T" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1746,"end":1754,"loc":{"start":{"line":96,"column":28,"index":1746},"end":{"line":96,"column":36,"index":1754}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1709,"end":1717,"loc":{"start":{"line":95,"column":25,"index":1709},"end":{"line":95,"column":33,"index":1717}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":1755,"end":1782,"loc":{"start":{"line":97,"column":0,"index":1755},"end":{"line":97,"column":27,"index":1782}}, + "id": { + "type": "Identifier", + "start":1760,"end":1763,"loc":{"start":{"line":97,"column":5,"index":1760},"end":{"line":97,"column":8,"index":1763},"identifierName":"T22"}, + "name": "T22" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1763,"end":1777,"loc":{"start":{"line":97,"column":8,"index":1763},"end":{"line":97,"column":22,"index":1777}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1764,"end":1776,"loc":{"start":{"line":97,"column":9,"index":1764},"end":{"line":97,"column":21,"index":1776}}, + "in": true, + "out": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1780,"end":1781,"loc":{"start":{"line":97,"column":25,"index":1780},"end":{"line":97,"column":26,"index":1781}}, + "typeName": { + "type": "Identifier", + "start":1780,"end":1781,"loc":{"start":{"line":97,"column":25,"index":1780},"end":{"line":97,"column":26,"index":1781},"identifierName":"T"}, + "name": "T" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1784,"end":1792,"loc":{"start":{"line":97,"column":29,"index":1784},"end":{"line":97,"column":37,"index":1792}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1746,"end":1754,"loc":{"start":{"line":96,"column":28,"index":1746},"end":{"line":96,"column":36,"index":1754}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":1793,"end":1816,"loc":{"start":{"line":98,"column":0,"index":1793},"end":{"line":98,"column":23,"index":1816}}, + "id": { + "type": "Identifier", + "start":1798,"end":1801,"loc":{"start":{"line":98,"column":5,"index":1798},"end":{"line":98,"column":8,"index":1801},"identifierName":"T23"}, + "name": "T23" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1801,"end":1811,"loc":{"start":{"line":98,"column":8,"index":1801},"end":{"line":98,"column":18,"index":1811}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1802,"end":1810,"loc":{"start":{"line":98,"column":9,"index":1802},"end":{"line":98,"column":17,"index":1810}}, + "out": true, + "in": true, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1814,"end":1815,"loc":{"start":{"line":98,"column":21,"index":1814},"end":{"line":98,"column":22,"index":1815}}, + "typeName": { + "type": "Identifier", + "start":1814,"end":1815,"loc":{"start":{"line":98,"column":21,"index":1814},"end":{"line":98,"column":22,"index":1815},"identifierName":"T"}, + "name": "T" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1818,"end":1826,"loc":{"start":{"line":98,"column":25,"index":1818},"end":{"line":98,"column":33,"index":1826}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1784,"end":1792,"loc":{"start":{"line":97,"column":29,"index":1784},"end":{"line":97,"column":37,"index":1792}} + } + ] + }, + { + "type": "TSDeclareFunction", + "start":1828,"end":1866,"loc":{"start":{"line":100,"column":0,"index":1828},"end":{"line":100,"column":38,"index":1866}}, + "declare": true, + "id": { + "type": "Identifier", + "start":1845,"end":1847,"loc":{"start":{"line":100,"column":17,"index":1845},"end":{"line":100,"column":19,"index":1847},"identifierName":"f1"}, + "name": "f1" + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1847,"end":1853,"loc":{"start":{"line":100,"column":19,"index":1847},"end":{"line":100,"column":25,"index":1853}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1848,"end":1852,"loc":{"start":{"line":100,"column":20,"index":1848},"end":{"line":100,"column":24,"index":1852}}, + "in": true, + "name": "T" + } + ] + }, + "params": [ + { + "type": "Identifier", + "start":1854,"end":1858,"loc":{"start":{"line":100,"column":26,"index":1854},"end":{"line":100,"column":30,"index":1858},"identifierName":"x"}, + "name": "x", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1855,"end":1858,"loc":{"start":{"line":100,"column":27,"index":1855},"end":{"line":100,"column":30,"index":1858}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1857,"end":1858,"loc":{"start":{"line":100,"column":29,"index":1857},"end":{"line":100,"column":30,"index":1858}}, + "typeName": { + "type": "Identifier", + "start":1857,"end":1858,"loc":{"start":{"line":100,"column":29,"index":1857},"end":{"line":100,"column":30,"index":1858},"identifierName":"T"}, + "name": "T" + } + } + } + } + ], + "returnType": { + "type": "TSTypeAnnotation", + "start":1859,"end":1865,"loc":{"start":{"line":100,"column":31,"index":1859},"end":{"line":100,"column":37,"index":1865}}, + "typeAnnotation": { + "type": "TSVoidKeyword", + "start":1861,"end":1865,"loc":{"start":{"line":100,"column":33,"index":1861},"end":{"line":100,"column":37,"index":1865}} + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1868,"end":1876,"loc":{"start":{"line":100,"column":40,"index":1868},"end":{"line":100,"column":48,"index":1876}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1818,"end":1826,"loc":{"start":{"line":98,"column":25,"index":1818},"end":{"line":98,"column":33,"index":1826}} + } + ] + }, + { + "type": "TSDeclareFunction", + "start":1877,"end":1909,"loc":{"start":{"line":101,"column":0,"index":1877},"end":{"line":101,"column":32,"index":1909}}, + "declare": true, + "id": { + "type": "Identifier", + "start":1894,"end":1896,"loc":{"start":{"line":101,"column":17,"index":1894},"end":{"line":101,"column":19,"index":1896},"identifierName":"f2"}, + "name": "f2" + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1896,"end":1903,"loc":{"start":{"line":101,"column":19,"index":1896},"end":{"line":101,"column":26,"index":1903}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1897,"end":1902,"loc":{"start":{"line":101,"column":20,"index":1897},"end":{"line":101,"column":25,"index":1902}}, + "out": true, + "name": "T" + } + ] + }, + "params": [], + "returnType": { + "type": "TSTypeAnnotation", + "start":1905,"end":1908,"loc":{"start":{"line":101,"column":28,"index":1905},"end":{"line":101,"column":31,"index":1908}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1907,"end":1908,"loc":{"start":{"line":101,"column":30,"index":1907},"end":{"line":101,"column":31,"index":1908}}, + "typeName": { + "type": "Identifier", + "start":1907,"end":1908,"loc":{"start":{"line":101,"column":30,"index":1907},"end":{"line":101,"column":31,"index":1908},"identifierName":"T"}, + "name": "T" + } + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1911,"end":1919,"loc":{"start":{"line":101,"column":34,"index":1911},"end":{"line":101,"column":42,"index":1919}} + }, + { + "type": "CommentLine", + "value": " FIXME: this should be recoverable error", + "start":1921,"end":1963,"loc":{"start":{"line":103,"column":0,"index":1921},"end":{"line":103,"column":42,"index":1963}} + }, + { + "type": "CommentLine", + "value": " class C {", + "start":1964,"end":1976,"loc":{"start":{"line":104,"column":0,"index":1964},"end":{"line":104,"column":12,"index":1976}} + }, + { + "type": "CommentLine", + "value": " in a = 0; // Error", + "start":1977,"end":2003,"loc":{"start":{"line":105,"column":0,"index":1977},"end":{"line":105,"column":26,"index":2003}} + }, + { + "type": "CommentLine", + "value": " out b = 0; // Error", + "start":2004,"end":2031,"loc":{"start":{"line":106,"column":0,"index":2004},"end":{"line":106,"column":27,"index":2031}} + }, + { + "type": "CommentLine", + "value": " }", + "start":2032,"end":2036,"loc":{"start":{"line":107,"column":0,"index":2032},"end":{"line":107,"column":4,"index":2036}} + }, + { + "type": "CommentLine", + "value": " Interface merging", + "start":2038,"end":2058,"loc":{"start":{"line":109,"column":0,"index":2038},"end":{"line":109,"column":20,"index":2058}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1868,"end":1876,"loc":{"start":{"line":100,"column":40,"index":1868},"end":{"line":100,"column":48,"index":1876}} + } + ] + }, + { + "type": "TSInterfaceDeclaration", + "start":2060,"end":2083,"loc":{"start":{"line":111,"column":0,"index":2060},"end":{"line":111,"column":23,"index":2083}}, + "id": { + "type": "Identifier", + "start":2070,"end":2073,"loc":{"start":{"line":111,"column":10,"index":2070},"end":{"line":111,"column":13,"index":2073},"identifierName":"Baz"}, + "name": "Baz" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":2073,"end":2080,"loc":{"start":{"line":111,"column":13,"index":2073},"end":{"line":111,"column":20,"index":2080}}, + "params": [ + { + "type": "TSTypeParameter", + "start":2074,"end":2079,"loc":{"start":{"line":111,"column":14,"index":2074},"end":{"line":111,"column":19,"index":2079}}, + "out": true, + "name": "T" + } + ] + }, + "body": { + "type": "TSInterfaceBody", + "start":2081,"end":2083,"loc":{"start":{"line":111,"column":21,"index":2081},"end":{"line":111,"column":23,"index":2083}}, + "body": [] + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1911,"end":1919,"loc":{"start":{"line":101,"column":34,"index":1911},"end":{"line":101,"column":42,"index":1919}} + }, + { + "type": "CommentLine", + "value": " FIXME: this should be recoverable error", + "start":1921,"end":1963,"loc":{"start":{"line":103,"column":0,"index":1921},"end":{"line":103,"column":42,"index":1963}} + }, + { + "type": "CommentLine", + "value": " class C {", + "start":1964,"end":1976,"loc":{"start":{"line":104,"column":0,"index":1964},"end":{"line":104,"column":12,"index":1976}} + }, + { + "type": "CommentLine", + "value": " in a = 0; // Error", + "start":1977,"end":2003,"loc":{"start":{"line":105,"column":0,"index":1977},"end":{"line":105,"column":26,"index":2003}} + }, + { + "type": "CommentLine", + "value": " out b = 0; // Error", + "start":2004,"end":2031,"loc":{"start":{"line":106,"column":0,"index":2004},"end":{"line":106,"column":27,"index":2031}} + }, + { + "type": "CommentLine", + "value": " }", + "start":2032,"end":2036,"loc":{"start":{"line":107,"column":0,"index":2032},"end":{"line":107,"column":4,"index":2036}} + }, + { + "type": "CommentLine", + "value": " Interface merging", + "start":2038,"end":2058,"loc":{"start":{"line":109,"column":0,"index":2038},"end":{"line":109,"column":20,"index":2058}} + } + ] + }, + { + "type": "TSInterfaceDeclaration", + "start":2084,"end":2106,"loc":{"start":{"line":112,"column":0,"index":2084},"end":{"line":112,"column":22,"index":2106}}, + "id": { + "type": "Identifier", + "start":2094,"end":2097,"loc":{"start":{"line":112,"column":10,"index":2094},"end":{"line":112,"column":13,"index":2097},"identifierName":"Baz"}, + "name": "Baz" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":2097,"end":2103,"loc":{"start":{"line":112,"column":13,"index":2097},"end":{"line":112,"column":19,"index":2103}}, + "params": [ + { + "type": "TSTypeParameter", + "start":2098,"end":2102,"loc":{"start":{"line":112,"column":14,"index":2098},"end":{"line":112,"column":18,"index":2102}}, + "in": true, + "name": "T" + } + ] + }, + "body": { + "type": "TSInterfaceBody", + "start":2104,"end":2106,"loc":{"start":{"line":112,"column":20,"index":2104},"end":{"line":112,"column":22,"index":2106}}, + "body": [] + } + }, + { + "type": "VariableDeclaration", + "start":2108,"end":2139,"loc":{"start":{"line":114,"column":0,"index":2108},"end":{"line":114,"column":31,"index":2139}}, + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "start":2120,"end":2138,"loc":{"start":{"line":114,"column":12,"index":2120},"end":{"line":114,"column":30,"index":2138}}, + "id": { + "type": "Identifier", + "start":2120,"end":2138,"loc":{"start":{"line":114,"column":12,"index":2120},"end":{"line":114,"column":30,"index":2138},"identifierName":"baz1"}, + "name": "baz1", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2124,"end":2138,"loc":{"start":{"line":114,"column":16,"index":2124},"end":{"line":114,"column":30,"index":2138}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2126,"end":2138,"loc":{"start":{"line":114,"column":18,"index":2126},"end":{"line":114,"column":30,"index":2138}}, + "typeName": { + "type": "Identifier", + "start":2126,"end":2129,"loc":{"start":{"line":114,"column":18,"index":2126},"end":{"line":114,"column":21,"index":2129},"identifierName":"Baz"}, + "name": "Baz" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2129,"end":2138,"loc":{"start":{"line":114,"column":21,"index":2129},"end":{"line":114,"column":30,"index":2138}}, + "params": [ + { + "type": "TSUnknownKeyword", + "start":2130,"end":2137,"loc":{"start":{"line":114,"column":22,"index":2130},"end":{"line":114,"column":29,"index":2137}} + } + ] + } + } + } + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "VariableDeclaration", + "start":2140,"end":2170,"loc":{"start":{"line":115,"column":0,"index":2140},"end":{"line":115,"column":30,"index":2170}}, + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "start":2152,"end":2169,"loc":{"start":{"line":115,"column":12,"index":2152},"end":{"line":115,"column":29,"index":2169}}, + "id": { + "type": "Identifier", + "start":2152,"end":2169,"loc":{"start":{"line":115,"column":12,"index":2152},"end":{"line":115,"column":29,"index":2169},"identifierName":"baz2"}, + "name": "baz2", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2156,"end":2169,"loc":{"start":{"line":115,"column":16,"index":2156},"end":{"line":115,"column":29,"index":2169}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2158,"end":2169,"loc":{"start":{"line":115,"column":18,"index":2158},"end":{"line":115,"column":29,"index":2169}}, + "typeName": { + "type": "Identifier", + "start":2158,"end":2161,"loc":{"start":{"line":115,"column":18,"index":2158},"end":{"line":115,"column":21,"index":2161},"identifierName":"Baz"}, + "name": "Baz" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2161,"end":2169,"loc":{"start":{"line":115,"column":21,"index":2161},"end":{"line":115,"column":29,"index":2169}}, + "params": [ + { + "type": "TSStringKeyword", + "start":2162,"end":2168,"loc":{"start":{"line":115,"column":22,"index":2162},"end":{"line":115,"column":28,"index":2168}} + } + ] + } + } + } + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "ExpressionStatement", + "start":2172,"end":2184,"loc":{"start":{"line":117,"column":0,"index":2172},"end":{"line":117,"column":12,"index":2184}}, + "expression": { + "type": "AssignmentExpression", + "start":2172,"end":2183,"loc":{"start":{"line":117,"column":0,"index":2172},"end":{"line":117,"column":11,"index":2183}}, + "operator": "=", + "left": { + "type": "Identifier", + "start":2172,"end":2176,"loc":{"start":{"line":117,"column":0,"index":2172},"end":{"line":117,"column":4,"index":2176},"identifierName":"baz1"}, + "name": "baz1" + }, + "right": { + "type": "Identifier", + "start":2179,"end":2183,"loc":{"start":{"line":117,"column":7,"index":2179},"end":{"line":117,"column":11,"index":2183},"identifierName":"baz2"}, + "name": "baz2" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":2186,"end":2194,"loc":{"start":{"line":117,"column":14,"index":2186},"end":{"line":117,"column":22,"index":2194}} + } + ] + }, + { + "type": "ExpressionStatement", + "start":2195,"end":2207,"loc":{"start":{"line":118,"column":0,"index":2195},"end":{"line":118,"column":12,"index":2207}}, + "expression": { + "type": "AssignmentExpression", + "start":2195,"end":2206,"loc":{"start":{"line":118,"column":0,"index":2195},"end":{"line":118,"column":11,"index":2206}}, + "operator": "=", + "left": { + "type": "Identifier", + "start":2195,"end":2199,"loc":{"start":{"line":118,"column":0,"index":2195},"end":{"line":118,"column":4,"index":2199},"identifierName":"baz2"}, + "name": "baz2" + }, + "right": { + "type": "Identifier", + "start":2202,"end":2206,"loc":{"start":{"line":118,"column":7,"index":2202},"end":{"line":118,"column":11,"index":2206},"identifierName":"baz1"}, + "name": "baz1" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":2209,"end":2217,"loc":{"start":{"line":118,"column":14,"index":2209},"end":{"line":118,"column":22,"index":2217}} + }, + { + "type": "CommentLine", + "value": " Repro from #44572", + "start":2219,"end":2239,"loc":{"start":{"line":120,"column":0,"index":2219},"end":{"line":120,"column":20,"index":2239}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":2186,"end":2194,"loc":{"start":{"line":117,"column":14,"index":2186},"end":{"line":117,"column":22,"index":2194}} + } + ] + }, + { + "type": "TSInterfaceDeclaration", + "start":2241,"end":2326,"loc":{"start":{"line":122,"column":0,"index":2241},"end":{"line":125,"column":1,"index":2326}}, + "id": { + "type": "Identifier", + "start":2251,"end":2257,"loc":{"start":{"line":122,"column":10,"index":2251},"end":{"line":122,"column":16,"index":2257},"identifierName":"Parent"}, + "name": "Parent" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":2257,"end":2264,"loc":{"start":{"line":122,"column":16,"index":2257},"end":{"line":122,"column":23,"index":2264}}, + "params": [ + { + "type": "TSTypeParameter", + "start":2258,"end":2263,"loc":{"start":{"line":122,"column":17,"index":2258},"end":{"line":122,"column":22,"index":2263}}, + "out": true, + "name": "A" + } + ] + }, + "body": { + "type": "TSInterfaceBody", + "start":2265,"end":2326,"loc":{"start":{"line":122,"column":24,"index":2265},"end":{"line":125,"column":1,"index":2326}}, + "body": [ + { + "type": "TSPropertySignature", + "start":2271,"end":2294,"loc":{"start":{"line":123,"column":4,"index":2271},"end":{"line":123,"column":27,"index":2294}}, + "key": { + "type": "Identifier", + "start":2271,"end":2276,"loc":{"start":{"line":123,"column":4,"index":2271},"end":{"line":123,"column":9,"index":2276},"identifierName":"child"}, + "name": "child" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2276,"end":2293,"loc":{"start":{"line":123,"column":9,"index":2276},"end":{"line":123,"column":26,"index":2293}}, + "typeAnnotation": { + "type": "TSUnionType", + "start":2278,"end":2293,"loc":{"start":{"line":123,"column":11,"index":2278},"end":{"line":123,"column":26,"index":2293}}, + "types": [ + { + "type": "TSTypeReference", + "start":2278,"end":2286,"loc":{"start":{"line":123,"column":11,"index":2278},"end":{"line":123,"column":19,"index":2286}}, + "typeName": { + "type": "Identifier", + "start":2278,"end":2283,"loc":{"start":{"line":123,"column":11,"index":2278},"end":{"line":123,"column":16,"index":2283},"identifierName":"Child"}, + "name": "Child" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2283,"end":2286,"loc":{"start":{"line":123,"column":16,"index":2283},"end":{"line":123,"column":19,"index":2286}}, + "params": [ + { + "type": "TSTypeReference", + "start":2284,"end":2285,"loc":{"start":{"line":123,"column":17,"index":2284},"end":{"line":123,"column":18,"index":2285}}, + "typeName": { + "type": "Identifier", + "start":2284,"end":2285,"loc":{"start":{"line":123,"column":17,"index":2284},"end":{"line":123,"column":18,"index":2285},"identifierName":"A"}, + "name": "A" + } + } + ] + } + }, + { + "type": "TSNullKeyword", + "start":2289,"end":2293,"loc":{"start":{"line":123,"column":22,"index":2289},"end":{"line":123,"column":26,"index":2293}} + } + ] + } + } + }, + { + "type": "TSPropertySignature", + "start":2299,"end":2324,"loc":{"start":{"line":124,"column":4,"index":2299},"end":{"line":124,"column":29,"index":2324}}, + "key": { + "type": "Identifier", + "start":2299,"end":2305,"loc":{"start":{"line":124,"column":4,"index":2299},"end":{"line":124,"column":10,"index":2305},"identifierName":"parent"}, + "name": "parent" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2305,"end":2323,"loc":{"start":{"line":124,"column":10,"index":2305},"end":{"line":124,"column":28,"index":2323}}, + "typeAnnotation": { + "type": "TSUnionType", + "start":2307,"end":2323,"loc":{"start":{"line":124,"column":12,"index":2307},"end":{"line":124,"column":28,"index":2323}}, + "types": [ + { + "type": "TSTypeReference", + "start":2307,"end":2316,"loc":{"start":{"line":124,"column":12,"index":2307},"end":{"line":124,"column":21,"index":2316}}, + "typeName": { + "type": "Identifier", + "start":2307,"end":2313,"loc":{"start":{"line":124,"column":12,"index":2307},"end":{"line":124,"column":18,"index":2313},"identifierName":"Parent"}, + "name": "Parent" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2313,"end":2316,"loc":{"start":{"line":124,"column":18,"index":2313},"end":{"line":124,"column":21,"index":2316}}, + "params": [ + { + "type": "TSTypeReference", + "start":2314,"end":2315,"loc":{"start":{"line":124,"column":19,"index":2314},"end":{"line":124,"column":20,"index":2315}}, + "typeName": { + "type": "Identifier", + "start":2314,"end":2315,"loc":{"start":{"line":124,"column":19,"index":2314},"end":{"line":124,"column":20,"index":2315},"identifierName":"A"}, + "name": "A" + } + } + ] + } + }, + { + "type": "TSNullKeyword", + "start":2319,"end":2323,"loc":{"start":{"line":124,"column":24,"index":2319},"end":{"line":124,"column":28,"index":2323}} + } + ] + } + } + } + ] + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":2209,"end":2217,"loc":{"start":{"line":118,"column":14,"index":2209},"end":{"line":118,"column":22,"index":2217}} + }, + { + "type": "CommentLine", + "value": " Repro from #44572", + "start":2219,"end":2239,"loc":{"start":{"line":120,"column":0,"index":2219},"end":{"line":120,"column":20,"index":2239}} + } + ] + }, + { + "type": "TSInterfaceDeclaration", + "start":2328,"end":2419,"loc":{"start":{"line":127,"column":0,"index":2328},"end":{"line":130,"column":1,"index":2419}}, + "id": { + "type": "Identifier", + "start":2338,"end":2343,"loc":{"start":{"line":127,"column":10,"index":2338},"end":{"line":127,"column":15,"index":2343},"identifierName":"Child"}, + "name": "Child" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":2343,"end":2359,"loc":{"start":{"line":127,"column":15,"index":2343},"end":{"line":127,"column":31,"index":2359}}, + "params": [ + { + "type": "TSTypeParameter", + "start":2344,"end":2345,"loc":{"start":{"line":127,"column":16,"index":2344},"end":{"line":127,"column":17,"index":2345}}, + "name": "A" + }, + { + "type": "TSTypeParameter", + "start":2347,"end":2358,"loc":{"start":{"line":127,"column":19,"index":2347},"end":{"line":127,"column":30,"index":2358}}, + "name": "B", + "default": { + "type": "TSUnknownKeyword", + "start":2351,"end":2358,"loc":{"start":{"line":127,"column":23,"index":2351},"end":{"line":127,"column":30,"index":2358}} + } + } + ] + }, + "extends": [ + { + "type": "TSExpressionWithTypeArguments", + "start":2368,"end":2377,"loc":{"start":{"line":127,"column":40,"index":2368},"end":{"line":127,"column":49,"index":2377}}, + "expression": { + "type": "Identifier", + "start":2368,"end":2374,"loc":{"start":{"line":127,"column":40,"index":2368},"end":{"line":127,"column":46,"index":2374},"identifierName":"Parent"}, + "name": "Parent" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2374,"end":2377,"loc":{"start":{"line":127,"column":46,"index":2374},"end":{"line":127,"column":49,"index":2377}}, + "params": [ + { + "type": "TSTypeReference", + "start":2375,"end":2376,"loc":{"start":{"line":127,"column":47,"index":2375},"end":{"line":127,"column":48,"index":2376}}, + "typeName": { + "type": "Identifier", + "start":2375,"end":2376,"loc":{"start":{"line":127,"column":47,"index":2375},"end":{"line":127,"column":48,"index":2376},"identifierName":"A"}, + "name": "A" + } + } + ] + } + } + ], + "body": { + "type": "TSInterfaceBody", + "start":2378,"end":2419,"loc":{"start":{"line":127,"column":50,"index":2378},"end":{"line":130,"column":1,"index":2419}}, + "body": [ + { + "type": "TSPropertySignature", + "start":2384,"end":2398,"loc":{"start":{"line":128,"column":4,"index":2384},"end":{"line":128,"column":18,"index":2398}}, + "readonly": true, + "key": { + "type": "Identifier", + "start":2393,"end":2394,"loc":{"start":{"line":128,"column":13,"index":2393},"end":{"line":128,"column":14,"index":2394},"identifierName":"a"}, + "name": "a" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2394,"end":2397,"loc":{"start":{"line":128,"column":14,"index":2394},"end":{"line":128,"column":17,"index":2397}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2396,"end":2397,"loc":{"start":{"line":128,"column":16,"index":2396},"end":{"line":128,"column":17,"index":2397}}, + "typeName": { + "type": "Identifier", + "start":2396,"end":2397,"loc":{"start":{"line":128,"column":16,"index":2396},"end":{"line":128,"column":17,"index":2397},"identifierName":"A"}, + "name": "A" + } + } + } + }, + { + "type": "TSPropertySignature", + "start":2403,"end":2417,"loc":{"start":{"line":129,"column":4,"index":2403},"end":{"line":129,"column":18,"index":2417}}, + "readonly": true, + "key": { + "type": "Identifier", + "start":2412,"end":2413,"loc":{"start":{"line":129,"column":13,"index":2412},"end":{"line":129,"column":14,"index":2413},"identifierName":"b"}, + "name": "b" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2413,"end":2416,"loc":{"start":{"line":129,"column":14,"index":2413},"end":{"line":129,"column":17,"index":2416}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2415,"end":2416,"loc":{"start":{"line":129,"column":16,"index":2415},"end":{"line":129,"column":17,"index":2416}}, + "typeName": { + "type": "Identifier", + "start":2415,"end":2416,"loc":{"start":{"line":129,"column":16,"index":2415},"end":{"line":129,"column":17,"index":2416},"identifierName":"B"}, + "name": "B" + } + } + } + } + ] + } + }, + { + "type": "FunctionDeclaration", + "start":2421,"end":2489,"loc":{"start":{"line":132,"column":0,"index":2421},"end":{"line":134,"column":1,"index":2489}}, + "id": { + "type": "Identifier", + "start":2430,"end":2432,"loc":{"start":{"line":132,"column":9,"index":2430},"end":{"line":132,"column":11,"index":2432},"identifierName":"fn"}, + "name": "fn" + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":2432,"end":2435,"loc":{"start":{"line":132,"column":11,"index":2432},"end":{"line":132,"column":14,"index":2435}}, + "params": [ + { + "type": "TSTypeParameter", + "start":2433,"end":2434,"loc":{"start":{"line":132,"column":12,"index":2433},"end":{"line":132,"column":13,"index":2434}}, + "name": "A" + } + ] + }, + "params": [ + { + "type": "Identifier", + "start":2436,"end":2449,"loc":{"start":{"line":132,"column":15,"index":2436},"end":{"line":132,"column":28,"index":2449},"identifierName":"inp"}, + "name": "inp", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2439,"end":2449,"loc":{"start":{"line":132,"column":18,"index":2439},"end":{"line":132,"column":28,"index":2449}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2441,"end":2449,"loc":{"start":{"line":132,"column":20,"index":2441},"end":{"line":132,"column":28,"index":2449}}, + "typeName": { + "type": "Identifier", + "start":2441,"end":2446,"loc":{"start":{"line":132,"column":20,"index":2441},"end":{"line":132,"column":25,"index":2446},"identifierName":"Child"}, + "name": "Child" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2446,"end":2449,"loc":{"start":{"line":132,"column":25,"index":2446},"end":{"line":132,"column":28,"index":2449}}, + "params": [ + { + "type": "TSTypeReference", + "start":2447,"end":2448,"loc":{"start":{"line":132,"column":26,"index":2447},"end":{"line":132,"column":27,"index":2448}}, + "typeName": { + "type": "Identifier", + "start":2447,"end":2448,"loc":{"start":{"line":132,"column":26,"index":2447},"end":{"line":132,"column":27,"index":2448},"identifierName":"A"}, + "name": "A" + } + } + ] + } + } + } + } + ], + "body": { + "type": "BlockStatement", + "start":2451,"end":2489,"loc":{"start":{"line":132,"column":30,"index":2451},"end":{"line":134,"column":1,"index":2489}}, + "body": [ + { + "type": "VariableDeclaration", + "start":2457,"end":2487,"loc":{"start":{"line":133,"column":4,"index":2457},"end":{"line":133,"column":34,"index":2487}}, + "declarations": [ + { + "type": "VariableDeclarator", + "start":2463,"end":2486,"loc":{"start":{"line":133,"column":10,"index":2463},"end":{"line":133,"column":33,"index":2486}}, + "id": { + "type": "Identifier", + "start":2463,"end":2480,"loc":{"start":{"line":133,"column":10,"index":2463},"end":{"line":133,"column":27,"index":2480},"identifierName":"a"}, + "name": "a", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2464,"end":2480,"loc":{"start":{"line":133,"column":11,"index":2464},"end":{"line":133,"column":27,"index":2480}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2466,"end":2480,"loc":{"start":{"line":133,"column":13,"index":2466},"end":{"line":133,"column":27,"index":2480}}, + "typeName": { + "type": "Identifier", + "start":2466,"end":2471,"loc":{"start":{"line":133,"column":13,"index":2466},"end":{"line":133,"column":18,"index":2471},"identifierName":"Child"}, + "name": "Child" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2471,"end":2480,"loc":{"start":{"line":133,"column":18,"index":2471},"end":{"line":133,"column":27,"index":2480}}, + "params": [ + { + "type": "TSUnknownKeyword", + "start":2472,"end":2479,"loc":{"start":{"line":133,"column":19,"index":2472},"end":{"line":133,"column":26,"index":2479}} + } + ] + } + } + } + }, + "init": { + "type": "Identifier", + "start":2483,"end":2486,"loc":{"start":{"line":133,"column":30,"index":2483},"end":{"line":133,"column":33,"index":2486},"identifierName":"inp"}, + "name": "inp" + } + } + ], + "kind": "const" + } + ], + "directives": [] + } + }, + { + "type": "VariableDeclaration", + "start":2491,"end":2586,"loc":{"start":{"line":136,"column":0,"index":2491},"end":{"line":136,"column":95,"index":2586}}, + "declarations": [ + { + "type": "VariableDeclarator", + "start":2497,"end":2585,"loc":{"start":{"line":136,"column":6,"index":2497},"end":{"line":136,"column":94,"index":2585}}, + "id": { + "type": "Identifier", + "start":2497,"end":2516,"loc":{"start":{"line":136,"column":6,"index":2497},"end":{"line":136,"column":25,"index":2516},"identifierName":"pu"}, + "name": "pu", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2499,"end":2516,"loc":{"start":{"line":136,"column":8,"index":2499},"end":{"line":136,"column":25,"index":2516}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2501,"end":2516,"loc":{"start":{"line":136,"column":10,"index":2501},"end":{"line":136,"column":25,"index":2516}}, + "typeName": { + "type": "Identifier", + "start":2501,"end":2507,"loc":{"start":{"line":136,"column":10,"index":2501},"end":{"line":136,"column":16,"index":2507},"identifierName":"Parent"}, + "name": "Parent" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2507,"end":2516,"loc":{"start":{"line":136,"column":16,"index":2507},"end":{"line":136,"column":25,"index":2516}}, + "params": [ + { + "type": "TSUnknownKeyword", + "start":2508,"end":2515,"loc":{"start":{"line":136,"column":17,"index":2508},"end":{"line":136,"column":24,"index":2515}} + } + ] + } + } + } + }, + "init": { + "type": "ObjectExpression", + "start":2519,"end":2585,"loc":{"start":{"line":136,"column":28,"index":2519},"end":{"line":136,"column":94,"index":2585}}, + "properties": [ + { + "type": "ObjectProperty", + "start":2521,"end":2569,"loc":{"start":{"line":136,"column":30,"index":2521},"end":{"line":136,"column":78,"index":2569}}, + "method": false, + "key": { + "type": "Identifier", + "start":2521,"end":2526,"loc":{"start":{"line":136,"column":30,"index":2521},"end":{"line":136,"column":35,"index":2526},"identifierName":"child"}, + "name": "child" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "ObjectExpression", + "start":2528,"end":2569,"loc":{"start":{"line":136,"column":37,"index":2528},"end":{"line":136,"column":78,"index":2569}}, + "properties": [ + { + "type": "ObjectProperty", + "start":2530,"end":2534,"loc":{"start":{"line":136,"column":39,"index":2530},"end":{"line":136,"column":43,"index":2534}}, + "method": false, + "key": { + "type": "Identifier", + "start":2530,"end":2531,"loc":{"start":{"line":136,"column":39,"index":2530},"end":{"line":136,"column":40,"index":2531},"identifierName":"a"}, + "name": "a" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NumericLiteral", + "start":2533,"end":2534,"loc":{"start":{"line":136,"column":42,"index":2533},"end":{"line":136,"column":43,"index":2534}}, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + { + "type": "ObjectProperty", + "start":2536,"end":2540,"loc":{"start":{"line":136,"column":45,"index":2536},"end":{"line":136,"column":49,"index":2540}}, + "method": false, + "key": { + "type": "Identifier", + "start":2536,"end":2537,"loc":{"start":{"line":136,"column":45,"index":2536},"end":{"line":136,"column":46,"index":2537},"identifierName":"b"}, + "name": "b" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NumericLiteral", + "start":2539,"end":2540,"loc":{"start":{"line":136,"column":48,"index":2539},"end":{"line":136,"column":49,"index":2540}}, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + { + "type": "ObjectProperty", + "start":2542,"end":2553,"loc":{"start":{"line":136,"column":51,"index":2542},"end":{"line":136,"column":62,"index":2553}}, + "method": false, + "key": { + "type": "Identifier", + "start":2542,"end":2547,"loc":{"start":{"line":136,"column":51,"index":2542},"end":{"line":136,"column":56,"index":2547},"identifierName":"child"}, + "name": "child" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NullLiteral", + "start":2549,"end":2553,"loc":{"start":{"line":136,"column":58,"index":2549},"end":{"line":136,"column":62,"index":2553}} + } + }, + { + "type": "ObjectProperty", + "start":2555,"end":2567,"loc":{"start":{"line":136,"column":64,"index":2555},"end":{"line":136,"column":76,"index":2567}}, + "method": false, + "key": { + "type": "Identifier", + "start":2555,"end":2561,"loc":{"start":{"line":136,"column":64,"index":2555},"end":{"line":136,"column":70,"index":2561},"identifierName":"parent"}, + "name": "parent" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NullLiteral", + "start":2563,"end":2567,"loc":{"start":{"line":136,"column":72,"index":2563},"end":{"line":136,"column":76,"index":2567}} + } + } + ] + } + }, + { + "type": "ObjectProperty", + "start":2571,"end":2583,"loc":{"start":{"line":136,"column":80,"index":2571},"end":{"line":136,"column":92,"index":2583}}, + "method": false, + "key": { + "type": "Identifier", + "start":2571,"end":2577,"loc":{"start":{"line":136,"column":80,"index":2571},"end":{"line":136,"column":86,"index":2577},"identifierName":"parent"}, + "name": "parent" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NullLiteral", + "start":2579,"end":2583,"loc":{"start":{"line":136,"column":88,"index":2579},"end":{"line":136,"column":92,"index":2583}} + } + } + ] + } + } + ], + "kind": "const" + }, + { + "type": "VariableDeclaration", + "start":2587,"end":2624,"loc":{"start":{"line":137,"column":0,"index":2587},"end":{"line":137,"column":37,"index":2624}}, + "declarations": [ + { + "type": "VariableDeclarator", + "start":2593,"end":2623,"loc":{"start":{"line":137,"column":6,"index":2593},"end":{"line":137,"column":36,"index":2623}}, + "id": { + "type": "Identifier", + "start":2593,"end":2618,"loc":{"start":{"line":137,"column":6,"index":2593},"end":{"line":137,"column":31,"index":2618},"identifierName":"notString"}, + "name": "notString", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2602,"end":2618,"loc":{"start":{"line":137,"column":15,"index":2602},"end":{"line":137,"column":31,"index":2618}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2604,"end":2618,"loc":{"start":{"line":137,"column":17,"index":2604},"end":{"line":137,"column":31,"index":2618}}, + "typeName": { + "type": "Identifier", + "start":2604,"end":2610,"loc":{"start":{"line":137,"column":17,"index":2604},"end":{"line":137,"column":23,"index":2610},"identifierName":"Parent"}, + "name": "Parent" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2610,"end":2618,"loc":{"start":{"line":137,"column":23,"index":2610},"end":{"line":137,"column":31,"index":2618}}, + "params": [ + { + "type": "TSStringKeyword", + "start":2611,"end":2617,"loc":{"start":{"line":137,"column":24,"index":2611},"end":{"line":137,"column":30,"index":2617}} + } + ] + } + } + } + }, + "init": { + "type": "Identifier", + "start":2621,"end":2623,"loc":{"start":{"line":137,"column":34,"index":2621},"end":{"line":137,"column":36,"index":2623},"identifierName":"pu"}, + "name": "pu" + } + } + ], + "kind": "const", + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":2626,"end":2634,"loc":{"start":{"line":137,"column":39,"index":2626},"end":{"line":137,"column":47,"index":2634}} + }, + { + "type": "CommentLine", + "value": " Repro from comment in #44572", + "start":2636,"end":2667,"loc":{"start":{"line":139,"column":0,"index":2636},"end":{"line":139,"column":31,"index":2667}} + } + ] + }, + { + "type": "ClassDeclaration", + "start":2669,"end":2845,"loc":{"start":{"line":141,"column":0,"index":2669},"end":{"line":145,"column":1,"index":2845}}, + "declare": true, + "id": { + "type": "Identifier", + "start":2683,"end":2692,"loc":{"start":{"line":141,"column":14,"index":2683},"end":{"line":141,"column":23,"index":2692},"identifierName":"StateNode"}, + "name": "StateNode" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":2692,"end":2742,"loc":{"start":{"line":141,"column":23,"index":2692},"end":{"line":141,"column":73,"index":2742}}, + "params": [ + { + "type": "TSTypeParameter", + "start":2693,"end":2701,"loc":{"start":{"line":141,"column":24,"index":2693},"end":{"line":141,"column":32,"index":2701}}, + "name": "TContext" + }, + { + "type": "TSTypeParameter", + "start":2703,"end":2741,"loc":{"start":{"line":141,"column":34,"index":2703},"end":{"line":141,"column":72,"index":2741}}, + "in": true, + "out": true, + "name": "TEvent", + "constraint": { + "type": "TSTypeLiteral", + "start":2725,"end":2741,"loc":{"start":{"line":141,"column":56,"index":2725},"end":{"line":141,"column":72,"index":2741}}, + "members": [ + { + "type": "TSPropertySignature", + "start":2727,"end":2739,"loc":{"start":{"line":141,"column":58,"index":2727},"end":{"line":141,"column":70,"index":2739}}, + "key": { + "type": "Identifier", + "start":2727,"end":2731,"loc":{"start":{"line":141,"column":58,"index":2727},"end":{"line":141,"column":62,"index":2731},"identifierName":"type"}, + "name": "type" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2731,"end":2739,"loc":{"start":{"line":141,"column":62,"index":2731},"end":{"line":141,"column":70,"index":2739}}, + "typeAnnotation": { + "type": "TSStringKeyword", + "start":2733,"end":2739,"loc":{"start":{"line":141,"column":64,"index":2733},"end":{"line":141,"column":70,"index":2739}} + } + } + } + ] + } + } + ] + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start":2743,"end":2845,"loc":{"start":{"line":141,"column":74,"index":2743},"end":{"line":145,"column":1,"index":2845}}, + "body": [ + { + "type": "ClassProperty", + "start":2749,"end":2770,"loc":{"start":{"line":142,"column":4,"index":2749},"end":{"line":142,"column":25,"index":2770}}, + "static": false, + "key": { + "type": "Identifier", + "start":2749,"end":2761,"loc":{"start":{"line":142,"column":4,"index":2749},"end":{"line":142,"column":16,"index":2761},"identifierName":"_storedEvent"}, + "name": "_storedEvent" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2761,"end":2769,"loc":{"start":{"line":142,"column":16,"index":2761},"end":{"line":142,"column":24,"index":2769}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2763,"end":2769,"loc":{"start":{"line":142,"column":18,"index":2763},"end":{"line":142,"column":24,"index":2769}}, + "typeName": { + "type": "Identifier", + "start":2763,"end":2769,"loc":{"start":{"line":142,"column":18,"index":2763},"end":{"line":142,"column":24,"index":2769},"identifierName":"TEvent"}, + "name": "TEvent" + } + } + }, + "value": null + }, + { + "type": "ClassProperty", + "start":2775,"end":2805,"loc":{"start":{"line":143,"column":4,"index":2775},"end":{"line":143,"column":34,"index":2805}}, + "static": false, + "key": { + "type": "Identifier", + "start":2775,"end":2782,"loc":{"start":{"line":143,"column":4,"index":2775},"end":{"line":143,"column":11,"index":2782},"identifierName":"_action"}, + "name": "_action" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2782,"end":2804,"loc":{"start":{"line":143,"column":11,"index":2782},"end":{"line":143,"column":33,"index":2804}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2784,"end":2804,"loc":{"start":{"line":143,"column":13,"index":2784},"end":{"line":143,"column":33,"index":2804}}, + "typeName": { + "type": "Identifier", + "start":2784,"end":2796,"loc":{"start":{"line":143,"column":13,"index":2784},"end":{"line":143,"column":25,"index":2796},"identifierName":"ActionObject"}, + "name": "ActionObject" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2796,"end":2804,"loc":{"start":{"line":143,"column":25,"index":2796},"end":{"line":143,"column":33,"index":2804}}, + "params": [ + { + "type": "TSTypeReference", + "start":2797,"end":2803,"loc":{"start":{"line":143,"column":26,"index":2797},"end":{"line":143,"column":32,"index":2803}}, + "typeName": { + "type": "Identifier", + "start":2797,"end":2803,"loc":{"start":{"line":143,"column":26,"index":2797},"end":{"line":143,"column":32,"index":2803},"identifierName":"TEvent"}, + "name": "TEvent" + } + } + ] + } + } + }, + "value": null + }, + { + "type": "ClassProperty", + "start":2810,"end":2843,"loc":{"start":{"line":144,"column":4,"index":2810},"end":{"line":144,"column":37,"index":2843}}, + "static": false, + "key": { + "type": "Identifier", + "start":2810,"end":2816,"loc":{"start":{"line":144,"column":4,"index":2810},"end":{"line":144,"column":10,"index":2816},"identifierName":"_state"}, + "name": "_state" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2816,"end":2842,"loc":{"start":{"line":144,"column":10,"index":2816},"end":{"line":144,"column":36,"index":2842}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2818,"end":2842,"loc":{"start":{"line":144,"column":12,"index":2818},"end":{"line":144,"column":36,"index":2842}}, + "typeName": { + "type": "Identifier", + "start":2818,"end":2827,"loc":{"start":{"line":144,"column":12,"index":2818},"end":{"line":144,"column":21,"index":2827},"identifierName":"StateNode"}, + "name": "StateNode" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2827,"end":2842,"loc":{"start":{"line":144,"column":21,"index":2827},"end":{"line":144,"column":36,"index":2842}}, + "params": [ + { + "type": "TSTypeReference", + "start":2828,"end":2836,"loc":{"start":{"line":144,"column":22,"index":2828},"end":{"line":144,"column":30,"index":2836}}, + "typeName": { + "type": "Identifier", + "start":2828,"end":2836,"loc":{"start":{"line":144,"column":22,"index":2828},"end":{"line":144,"column":30,"index":2836},"identifierName":"TContext"}, + "name": "TContext" + } + }, + { + "type": "TSAnyKeyword", + "start":2838,"end":2841,"loc":{"start":{"line":144,"column":32,"index":2838},"end":{"line":144,"column":35,"index":2841}} + } + ] + } + } + }, + "value": null + } + ] + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":2626,"end":2634,"loc":{"start":{"line":137,"column":39,"index":2626},"end":{"line":137,"column":47,"index":2634}} + }, + { + "type": "CommentLine", + "value": " Repro from comment in #44572", + "start":2636,"end":2667,"loc":{"start":{"line":139,"column":0,"index":2636},"end":{"line":139,"column":31,"index":2667}} + } + ] + }, + { + "type": "TSInterfaceDeclaration", + "start":2847,"end":2956,"loc":{"start":{"line":147,"column":0,"index":2847},"end":{"line":149,"column":1,"index":2956}}, + "id": { + "type": "Identifier", + "start":2857,"end":2869,"loc":{"start":{"line":147,"column":10,"index":2857},"end":{"line":147,"column":22,"index":2869},"identifierName":"ActionObject"}, + "name": "ActionObject" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":2869,"end":2902,"loc":{"start":{"line":147,"column":22,"index":2869},"end":{"line":147,"column":55,"index":2902}}, + "params": [ + { + "type": "TSTypeParameter", + "start":2870,"end":2901,"loc":{"start":{"line":147,"column":23,"index":2870},"end":{"line":147,"column":54,"index":2901}}, + "name": "TEvent", + "constraint": { + "type": "TSTypeLiteral", + "start":2885,"end":2901,"loc":{"start":{"line":147,"column":38,"index":2885},"end":{"line":147,"column":54,"index":2901}}, + "members": [ + { + "type": "TSPropertySignature", + "start":2887,"end":2899,"loc":{"start":{"line":147,"column":40,"index":2887},"end":{"line":147,"column":52,"index":2899}}, + "key": { + "type": "Identifier", + "start":2887,"end":2891,"loc":{"start":{"line":147,"column":40,"index":2887},"end":{"line":147,"column":44,"index":2891},"identifierName":"type"}, + "name": "type" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2891,"end":2899,"loc":{"start":{"line":147,"column":44,"index":2891},"end":{"line":147,"column":52,"index":2899}}, + "typeAnnotation": { + "type": "TSStringKeyword", + "start":2893,"end":2899,"loc":{"start":{"line":147,"column":46,"index":2893},"end":{"line":147,"column":52,"index":2899}} + } + } + } + ] + } + } + ] + }, + "body": { + "type": "TSInterfaceBody", + "start":2903,"end":2956,"loc":{"start":{"line":147,"column":56,"index":2903},"end":{"line":149,"column":1,"index":2956}}, + "body": [ + { + "type": "TSPropertySignature", + "start":2909,"end":2954,"loc":{"start":{"line":148,"column":4,"index":2909},"end":{"line":148,"column":49,"index":2954}}, + "key": { + "type": "Identifier", + "start":2909,"end":2913,"loc":{"start":{"line":148,"column":4,"index":2909},"end":{"line":148,"column":8,"index":2913},"identifierName":"exec"}, + "name": "exec" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2913,"end":2953,"loc":{"start":{"line":148,"column":8,"index":2913},"end":{"line":148,"column":48,"index":2953}}, + "typeAnnotation": { + "type": "TSFunctionType", + "start":2915,"end":2953,"loc":{"start":{"line":148,"column":10,"index":2915},"end":{"line":148,"column":48,"index":2953}}, + "parameters": [ + { + "type": "Identifier", + "start":2916,"end":2944,"loc":{"start":{"line":148,"column":11,"index":2916},"end":{"line":148,"column":39,"index":2944},"identifierName":"meta"}, + "name": "meta", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2920,"end":2944,"loc":{"start":{"line":148,"column":15,"index":2920},"end":{"line":148,"column":39,"index":2944}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2922,"end":2944,"loc":{"start":{"line":148,"column":17,"index":2922},"end":{"line":148,"column":39,"index":2944}}, + "typeName": { + "type": "Identifier", + "start":2922,"end":2931,"loc":{"start":{"line":148,"column":17,"index":2922},"end":{"line":148,"column":26,"index":2931},"identifierName":"StateNode"}, + "name": "StateNode" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2931,"end":2944,"loc":{"start":{"line":148,"column":26,"index":2931},"end":{"line":148,"column":39,"index":2944}}, + "params": [ + { + "type": "TSAnyKeyword", + "start":2932,"end":2935,"loc":{"start":{"line":148,"column":27,"index":2932},"end":{"line":148,"column":30,"index":2935}} + }, + { + "type": "TSTypeReference", + "start":2937,"end":2943,"loc":{"start":{"line":148,"column":32,"index":2937},"end":{"line":148,"column":38,"index":2943}}, + "typeName": { + "type": "Identifier", + "start":2937,"end":2943,"loc":{"start":{"line":148,"column":32,"index":2937},"end":{"line":148,"column":38,"index":2943},"identifierName":"TEvent"}, + "name": "TEvent" + } + } + ] + } + } + } + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2946,"end":2953,"loc":{"start":{"line":148,"column":41,"index":2946},"end":{"line":148,"column":48,"index":2953}}, + "typeAnnotation": { + "type": "TSVoidKeyword", + "start":2949,"end":2953,"loc":{"start":{"line":148,"column":44,"index":2949},"end":{"line":148,"column":48,"index":2953}} + } + } + } + } + } + ] + } + }, + { + "type": "TSDeclareFunction", + "start":2958,"end":3073,"loc":{"start":{"line":151,"column":0,"index":2958},"end":{"line":151,"column":115,"index":3073}}, + "declare": true, + "id": { + "type": "Identifier", + "start":2975,"end":2988,"loc":{"start":{"line":151,"column":17,"index":2975},"end":{"line":151,"column":30,"index":2988},"identifierName":"createMachine"}, + "name": "createMachine" + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":2988,"end":3021,"loc":{"start":{"line":151,"column":30,"index":2988},"end":{"line":151,"column":63,"index":3021}}, + "params": [ + { + "type": "TSTypeParameter", + "start":2989,"end":3020,"loc":{"start":{"line":151,"column":31,"index":2989},"end":{"line":151,"column":62,"index":3020}}, + "name": "TEvent", + "constraint": { + "type": "TSTypeLiteral", + "start":3004,"end":3020,"loc":{"start":{"line":151,"column":46,"index":3004},"end":{"line":151,"column":62,"index":3020}}, + "members": [ + { + "type": "TSPropertySignature", + "start":3006,"end":3018,"loc":{"start":{"line":151,"column":48,"index":3006},"end":{"line":151,"column":60,"index":3018}}, + "key": { + "type": "Identifier", + "start":3006,"end":3010,"loc":{"start":{"line":151,"column":48,"index":3006},"end":{"line":151,"column":52,"index":3010},"identifierName":"type"}, + "name": "type" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3010,"end":3018,"loc":{"start":{"line":151,"column":52,"index":3010},"end":{"line":151,"column":60,"index":3018}}, + "typeAnnotation": { + "type": "TSStringKeyword", + "start":3012,"end":3018,"loc":{"start":{"line":151,"column":54,"index":3012},"end":{"line":151,"column":60,"index":3018}} + } + } + } + ] + } + } + ] + }, + "params": [ + { + "type": "Identifier", + "start":3022,"end":3050,"loc":{"start":{"line":151,"column":64,"index":3022},"end":{"line":151,"column":92,"index":3050},"identifierName":"action"}, + "name": "action", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3028,"end":3050,"loc":{"start":{"line":151,"column":70,"index":3028},"end":{"line":151,"column":92,"index":3050}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":3030,"end":3050,"loc":{"start":{"line":151,"column":72,"index":3030},"end":{"line":151,"column":92,"index":3050}}, + "typeName": { + "type": "Identifier", + "start":3030,"end":3042,"loc":{"start":{"line":151,"column":72,"index":3030},"end":{"line":151,"column":84,"index":3042},"identifierName":"ActionObject"}, + "name": "ActionObject" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":3042,"end":3050,"loc":{"start":{"line":151,"column":84,"index":3042},"end":{"line":151,"column":92,"index":3050}}, + "params": [ + { + "type": "TSTypeReference", + "start":3043,"end":3049,"loc":{"start":{"line":151,"column":85,"index":3043},"end":{"line":151,"column":91,"index":3049}}, + "typeName": { + "type": "Identifier", + "start":3043,"end":3049,"loc":{"start":{"line":151,"column":85,"index":3043},"end":{"line":151,"column":91,"index":3049},"identifierName":"TEvent"}, + "name": "TEvent" + } + } + ] + } + } + } + } + ], + "returnType": { + "type": "TSTypeAnnotation", + "start":3051,"end":3072,"loc":{"start":{"line":151,"column":93,"index":3051},"end":{"line":151,"column":114,"index":3072}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":3053,"end":3072,"loc":{"start":{"line":151,"column":95,"index":3053},"end":{"line":151,"column":114,"index":3072}}, + "typeName": { + "type": "Identifier", + "start":3053,"end":3062,"loc":{"start":{"line":151,"column":95,"index":3053},"end":{"line":151,"column":104,"index":3062},"identifierName":"StateNode"}, + "name": "StateNode" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":3062,"end":3072,"loc":{"start":{"line":151,"column":104,"index":3062},"end":{"line":151,"column":114,"index":3072}}, + "params": [ + { + "type": "TSAnyKeyword", + "start":3063,"end":3066,"loc":{"start":{"line":151,"column":105,"index":3063},"end":{"line":151,"column":108,"index":3066}} + }, + { + "type": "TSAnyKeyword", + "start":3068,"end":3071,"loc":{"start":{"line":151,"column":110,"index":3068},"end":{"line":151,"column":113,"index":3071}} + } + ] + } + } + } + }, + { + "type": "TSDeclareFunction", + "start":3075,"end":3153,"loc":{"start":{"line":153,"column":0,"index":3075},"end":{"line":153,"column":78,"index":3153}}, + "declare": true, + "id": { + "type": "Identifier", + "start":3092,"end":3101,"loc":{"start":{"line":153,"column":17,"index":3092},"end":{"line":153,"column":26,"index":3101},"identifierName":"interpret"}, + "name": "interpret" + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":3101,"end":3111,"loc":{"start":{"line":153,"column":26,"index":3101},"end":{"line":153,"column":36,"index":3111}}, + "params": [ + { + "type": "TSTypeParameter", + "start":3102,"end":3110,"loc":{"start":{"line":153,"column":27,"index":3102},"end":{"line":153,"column":35,"index":3110}}, + "name": "TContext" + } + ] + }, + "params": [ + { + "type": "Identifier", + "start":3112,"end":3145,"loc":{"start":{"line":153,"column":37,"index":3112},"end":{"line":153,"column":70,"index":3145},"identifierName":"machine"}, + "name": "machine", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3119,"end":3145,"loc":{"start":{"line":153,"column":44,"index":3119},"end":{"line":153,"column":70,"index":3145}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":3121,"end":3145,"loc":{"start":{"line":153,"column":46,"index":3121},"end":{"line":153,"column":70,"index":3145}}, + "typeName": { + "type": "Identifier", + "start":3121,"end":3130,"loc":{"start":{"line":153,"column":46,"index":3121},"end":{"line":153,"column":55,"index":3130},"identifierName":"StateNode"}, + "name": "StateNode" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":3130,"end":3145,"loc":{"start":{"line":153,"column":55,"index":3130},"end":{"line":153,"column":70,"index":3145}}, + "params": [ + { + "type": "TSTypeReference", + "start":3131,"end":3139,"loc":{"start":{"line":153,"column":56,"index":3131},"end":{"line":153,"column":64,"index":3139}}, + "typeName": { + "type": "Identifier", + "start":3131,"end":3139,"loc":{"start":{"line":153,"column":56,"index":3131},"end":{"line":153,"column":64,"index":3139},"identifierName":"TContext"}, + "name": "TContext" + } + }, + { + "type": "TSAnyKeyword", + "start":3141,"end":3144,"loc":{"start":{"line":153,"column":66,"index":3141},"end":{"line":153,"column":69,"index":3144}} + } + ] + } + } + } + } + ], + "returnType": { + "type": "TSTypeAnnotation", + "start":3146,"end":3152,"loc":{"start":{"line":153,"column":71,"index":3146},"end":{"line":153,"column":77,"index":3152}}, + "typeAnnotation": { + "type": "TSVoidKeyword", + "start":3148,"end":3152,"loc":{"start":{"line":153,"column":73,"index":3148},"end":{"line":153,"column":77,"index":3152}} + } + } + }, + { + "type": "VariableDeclaration", + "start":3155,"end":3196,"loc":{"start":{"line":155,"column":0,"index":3155},"end":{"line":155,"column":41,"index":3196}}, + "declarations": [ + { + "type": "VariableDeclarator", + "start":3161,"end":3195,"loc":{"start":{"line":155,"column":6,"index":3161},"end":{"line":155,"column":40,"index":3195}}, + "id": { + "type": "Identifier", + "start":3161,"end":3168,"loc":{"start":{"line":155,"column":6,"index":3161},"end":{"line":155,"column":13,"index":3168},"identifierName":"machine"}, + "name": "machine" + }, + "init": { + "type": "CallExpression", + "start":3171,"end":3195,"loc":{"start":{"line":155,"column":16,"index":3171},"end":{"line":155,"column":40,"index":3195}}, + "callee": { + "type": "Identifier", + "start":3171,"end":3184,"loc":{"start":{"line":155,"column":16,"index":3171},"end":{"line":155,"column":29,"index":3184},"identifierName":"createMachine"}, + "name": "createMachine" + }, + "arguments": [ + { + "type": "TSAsExpression", + "start":3185,"end":3194,"loc":{"start":{"line":155,"column":30,"index":3185},"end":{"line":155,"column":39,"index":3194}}, + "expression": { + "type": "ObjectExpression", + "start":3185,"end":3187,"loc":{"start":{"line":155,"column":30,"index":3185},"end":{"line":155,"column":32,"index":3187}}, + "properties": [] + }, + "typeAnnotation": { + "type": "TSAnyKeyword", + "start":3191,"end":3194,"loc":{"start":{"line":155,"column":36,"index":3191},"end":{"line":155,"column":39,"index":3194}} + } + } + ] + } + } + ], + "kind": "const" + }, + { + "type": "ExpressionStatement", + "start":3198,"end":3217,"loc":{"start":{"line":157,"column":0,"index":3198},"end":{"line":157,"column":19,"index":3217}}, + "expression": { + "type": "CallExpression", + "start":3198,"end":3216,"loc":{"start":{"line":157,"column":0,"index":3198},"end":{"line":157,"column":18,"index":3216}}, + "callee": { + "type": "Identifier", + "start":3198,"end":3207,"loc":{"start":{"line":157,"column":0,"index":3198},"end":{"line":157,"column":9,"index":3207},"identifierName":"interpret"}, + "name": "interpret" + }, + "arguments": [ + { + "type": "Identifier", + "start":3208,"end":3215,"loc":{"start":{"line":157,"column":10,"index":3208},"end":{"line":157,"column":17,"index":3215},"identifierName":"machine"}, + "name": "machine" + } + ] + } + }, + { + "type": "VariableDeclaration", + "start":3219,"end":3283,"loc":{"start":{"line":159,"column":0,"index":3219},"end":{"line":159,"column":64,"index":3283}}, + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "start":3233,"end":3282,"loc":{"start":{"line":159,"column":14,"index":3233},"end":{"line":159,"column":63,"index":3282}}, + "id": { + "type": "Identifier", + "start":3233,"end":3282,"loc":{"start":{"line":159,"column":14,"index":3233},"end":{"line":159,"column":63,"index":3282},"identifierName":"qq"}, + "name": "qq", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3235,"end":3282,"loc":{"start":{"line":159,"column":16,"index":3235},"end":{"line":159,"column":63,"index":3282}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":3237,"end":3282,"loc":{"start":{"line":159,"column":18,"index":3237},"end":{"line":159,"column":63,"index":3282}}, + "typeName": { + "type": "Identifier", + "start":3237,"end":3249,"loc":{"start":{"line":159,"column":18,"index":3237},"end":{"line":159,"column":30,"index":3249},"identifierName":"ActionObject"}, + "name": "ActionObject" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":3249,"end":3282,"loc":{"start":{"line":159,"column":30,"index":3249},"end":{"line":159,"column":63,"index":3282}}, + "params": [ + { + "type": "TSTypeLiteral", + "start":3250,"end":3281,"loc":{"start":{"line":159,"column":31,"index":3250},"end":{"line":159,"column":62,"index":3281}}, + "members": [ + { + "type": "TSPropertySignature", + "start":3252,"end":3265,"loc":{"start":{"line":159,"column":33,"index":3252},"end":{"line":159,"column":46,"index":3265}}, + "key": { + "type": "Identifier", + "start":3252,"end":3256,"loc":{"start":{"line":159,"column":33,"index":3252},"end":{"line":159,"column":37,"index":3256},"identifierName":"type"}, + "name": "type" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3256,"end":3264,"loc":{"start":{"line":159,"column":37,"index":3256},"end":{"line":159,"column":45,"index":3264}}, + "typeAnnotation": { + "type": "TSLiteralType", + "start":3258,"end":3264,"loc":{"start":{"line":159,"column":39,"index":3258},"end":{"line":159,"column":45,"index":3264}}, + "literal": { + "type": "StringLiteral", + "start":3258,"end":3264,"loc":{"start":{"line":159,"column":39,"index":3258},"end":{"line":159,"column":45,"index":3264}}, + "extra": { + "rawValue": "PLAY", + "raw": "\"PLAY\"" + }, + "value": "PLAY" + } + } + } + }, + { + "type": "TSPropertySignature", + "start":3266,"end":3279,"loc":{"start":{"line":159,"column":47,"index":3266},"end":{"line":159,"column":60,"index":3279}}, + "key": { + "type": "Identifier", + "start":3266,"end":3271,"loc":{"start":{"line":159,"column":47,"index":3266},"end":{"line":159,"column":52,"index":3271},"identifierName":"value"}, + "name": "value" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3271,"end":3279,"loc":{"start":{"line":159,"column":52,"index":3271},"end":{"line":159,"column":60,"index":3279}}, + "typeAnnotation": { + "type": "TSNumberKeyword", + "start":3273,"end":3279,"loc":{"start":{"line":159,"column":54,"index":3273},"end":{"line":159,"column":60,"index":3279}} + } + } + } + ] + } + ] + } + } + } + }, + "init": null + } + ], + "kind": "const" + }, + { + "type": "ExpressionStatement", + "start":3285,"end":3356,"loc":{"start":{"line":161,"column":0,"index":3285},"end":{"line":161,"column":71,"index":3356}}, + "expression": { + "type": "CallExpression", + "start":3285,"end":3355,"loc":{"start":{"line":161,"column":0,"index":3285},"end":{"line":161,"column":70,"index":3355}}, + "callee": { + "type": "Identifier", + "start":3285,"end":3298,"loc":{"start":{"line":161,"column":0,"index":3285},"end":{"line":161,"column":13,"index":3298},"identifierName":"createMachine"}, + "name": "createMachine" + }, + "arguments": [ + { + "type": "Identifier", + "start":3352,"end":3354,"loc":{"start":{"line":161,"column":67,"index":3352},"end":{"line":161,"column":69,"index":3354},"identifierName":"qq"}, + "name": "qq" + } + ], + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":3298,"end":3351,"loc":{"start":{"line":161,"column":13,"index":3298},"end":{"line":161,"column":66,"index":3351}}, + "params": [ + { + "type": "TSUnionType", + "start":3299,"end":3350,"loc":{"start":{"line":161,"column":14,"index":3299},"end":{"line":161,"column":65,"index":3350}}, + "types": [ + { + "type": "TSTypeLiteral", + "start":3299,"end":3330,"loc":{"start":{"line":161,"column":14,"index":3299},"end":{"line":161,"column":45,"index":3330}}, + "members": [ + { + "type": "TSPropertySignature", + "start":3301,"end":3314,"loc":{"start":{"line":161,"column":16,"index":3301},"end":{"line":161,"column":29,"index":3314}}, + "key": { + "type": "Identifier", + "start":3301,"end":3305,"loc":{"start":{"line":161,"column":16,"index":3301},"end":{"line":161,"column":20,"index":3305},"identifierName":"type"}, + "name": "type" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3305,"end":3313,"loc":{"start":{"line":161,"column":20,"index":3305},"end":{"line":161,"column":28,"index":3313}}, + "typeAnnotation": { + "type": "TSLiteralType", + "start":3307,"end":3313,"loc":{"start":{"line":161,"column":22,"index":3307},"end":{"line":161,"column":28,"index":3313}}, + "literal": { + "type": "StringLiteral", + "start":3307,"end":3313,"loc":{"start":{"line":161,"column":22,"index":3307},"end":{"line":161,"column":28,"index":3313}}, + "extra": { + "rawValue": "PLAY", + "raw": "\"PLAY\"" + }, + "value": "PLAY" + } + } + } + }, + { + "type": "TSPropertySignature", + "start":3315,"end":3328,"loc":{"start":{"line":161,"column":30,"index":3315},"end":{"line":161,"column":43,"index":3328}}, + "key": { + "type": "Identifier", + "start":3315,"end":3320,"loc":{"start":{"line":161,"column":30,"index":3315},"end":{"line":161,"column":35,"index":3320},"identifierName":"value"}, + "name": "value" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3320,"end":3328,"loc":{"start":{"line":161,"column":35,"index":3320},"end":{"line":161,"column":43,"index":3328}}, + "typeAnnotation": { + "type": "TSNumberKeyword", + "start":3322,"end":3328,"loc":{"start":{"line":161,"column":37,"index":3322},"end":{"line":161,"column":43,"index":3328}} + } + } + } + ] + }, + { + "type": "TSTypeLiteral", + "start":3333,"end":3350,"loc":{"start":{"line":161,"column":48,"index":3333},"end":{"line":161,"column":65,"index":3350}}, + "members": [ + { + "type": "TSPropertySignature", + "start":3335,"end":3348,"loc":{"start":{"line":161,"column":50,"index":3335},"end":{"line":161,"column":63,"index":3348}}, + "key": { + "type": "Identifier", + "start":3335,"end":3339,"loc":{"start":{"line":161,"column":50,"index":3335},"end":{"line":161,"column":54,"index":3339},"identifierName":"type"}, + "name": "type" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3339,"end":3348,"loc":{"start":{"line":161,"column":54,"index":3339},"end":{"line":161,"column":63,"index":3348}}, + "typeAnnotation": { + "type": "TSLiteralType", + "start":3341,"end":3348,"loc":{"start":{"line":161,"column":56,"index":3341},"end":{"line":161,"column":63,"index":3348}}, + "literal": { + "type": "StringLiteral", + "start":3341,"end":3348,"loc":{"start":{"line":161,"column":56,"index":3341},"end":{"line":161,"column":63,"index":3348}}, + "extra": { + "rawValue": "RESET", + "raw": "\"RESET\"" + }, + "value": "RESET" + } + } + } + } + ] + } + ] + } + ] + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":3358,"end":3366,"loc":{"start":{"line":161,"column":73,"index":3358},"end":{"line":161,"column":81,"index":3366}} + } + ] } ], "directives": [] - } + }, + "comments": [ + { + "type": "CommentLine", + "value": " Error", + "start":202,"end":210,"loc":{"start":{"line":9,"column":34,"index":202},"end":{"line":9,"column":42,"index":210}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":421,"end":429,"loc":{"start":{"line":18,"column":42,"index":421},"end":{"line":18,"column":50,"index":429}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":654,"end":662,"loc":{"start":{"line":28,"column":34,"index":654},"end":{"line":28,"column":42,"index":662}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":697,"end":705,"loc":{"start":{"line":29,"column":34,"index":697},"end":{"line":29,"column":42,"index":705}} + }, + { + "type": "CommentLine", + "value": " Variance of various type constructors", + "start":707,"end":747,"loc":{"start":{"line":31,"column":0,"index":707},"end":{"line":31,"column":40,"index":747}} + }, + { + "type": "CommentLine", + "value": " Variance annotation errors", + "start":877,"end":906,"loc":{"start":{"line":38,"column":0,"index":877},"end":{"line":38,"column":29,"index":906}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":935,"end":943,"loc":{"start":{"line":40,"column":27,"index":935},"end":{"line":40,"column":35,"index":943}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":996,"end":1004,"loc":{"start":{"line":44,"column":39,"index":996},"end":{"line":44,"column":47,"index":1004}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1038,"end":1046,"loc":{"start":{"line":46,"column":32,"index":1038},"end":{"line":46,"column":40,"index":1046}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1100,"end":1108,"loc":{"start":{"line":50,"column":27,"index":1100},"end":{"line":50,"column":35,"index":1108}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1160,"end":1168,"loc":{"start":{"line":54,"column":28,"index":1160},"end":{"line":54,"column":36,"index":1168}} + }, + { + "type": "CommentLine", + "value": " Variance in circular types", + "start":1192,"end":1221,"loc":{"start":{"line":58,"column":0,"index":1192},"end":{"line":58,"column":29,"index":1221}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1244,"end":1252,"loc":{"start":{"line":60,"column":21,"index":1244},"end":{"line":60,"column":29,"index":1252}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1392,"end":1400,"loc":{"start":{"line":71,"column":22,"index":1392},"end":{"line":71,"column":30,"index":1400}} + }, + { + "type": "CommentLine", + "value": " Wrong modifier usage", + "start":1659,"end":1682,"loc":{"start":{"line":93,"column":0,"index":1659},"end":{"line":93,"column":23,"index":1682}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1709,"end":1717,"loc":{"start":{"line":95,"column":25,"index":1709},"end":{"line":95,"column":33,"index":1717}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1746,"end":1754,"loc":{"start":{"line":96,"column":28,"index":1746},"end":{"line":96,"column":36,"index":1754}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1784,"end":1792,"loc":{"start":{"line":97,"column":29,"index":1784},"end":{"line":97,"column":37,"index":1792}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1818,"end":1826,"loc":{"start":{"line":98,"column":25,"index":1818},"end":{"line":98,"column":33,"index":1826}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1868,"end":1876,"loc":{"start":{"line":100,"column":40,"index":1868},"end":{"line":100,"column":48,"index":1876}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1911,"end":1919,"loc":{"start":{"line":101,"column":34,"index":1911},"end":{"line":101,"column":42,"index":1919}} + }, + { + "type": "CommentLine", + "value": " FIXME: this should be recoverable error", + "start":1921,"end":1963,"loc":{"start":{"line":103,"column":0,"index":1921},"end":{"line":103,"column":42,"index":1963}} + }, + { + "type": "CommentLine", + "value": " class C {", + "start":1964,"end":1976,"loc":{"start":{"line":104,"column":0,"index":1964},"end":{"line":104,"column":12,"index":1976}} + }, + { + "type": "CommentLine", + "value": " in a = 0; // Error", + "start":1977,"end":2003,"loc":{"start":{"line":105,"column":0,"index":1977},"end":{"line":105,"column":26,"index":2003}} + }, + { + "type": "CommentLine", + "value": " out b = 0; // Error", + "start":2004,"end":2031,"loc":{"start":{"line":106,"column":0,"index":2004},"end":{"line":106,"column":27,"index":2031}} + }, + { + "type": "CommentLine", + "value": " }", + "start":2032,"end":2036,"loc":{"start":{"line":107,"column":0,"index":2032},"end":{"line":107,"column":4,"index":2036}} + }, + { + "type": "CommentLine", + "value": " Interface merging", + "start":2038,"end":2058,"loc":{"start":{"line":109,"column":0,"index":2038},"end":{"line":109,"column":20,"index":2058}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":2186,"end":2194,"loc":{"start":{"line":117,"column":14,"index":2186},"end":{"line":117,"column":22,"index":2194}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":2209,"end":2217,"loc":{"start":{"line":118,"column":14,"index":2209},"end":{"line":118,"column":22,"index":2217}} + }, + { + "type": "CommentLine", + "value": " Repro from #44572", + "start":2219,"end":2239,"loc":{"start":{"line":120,"column":0,"index":2219},"end":{"line":120,"column":20,"index":2239}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":2626,"end":2634,"loc":{"start":{"line":137,"column":39,"index":2626},"end":{"line":137,"column":47,"index":2634}} + }, + { + "type": "CommentLine", + "value": " Repro from comment in #44572", + "start":2636,"end":2667,"loc":{"start":{"line":139,"column":0,"index":2636},"end":{"line":139,"column":31,"index":2667}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":3358,"end":3366,"loc":{"start":{"line":161,"column":73,"index":3358},"end":{"line":161,"column":81,"index":3366}} + } + ] } diff --git a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-error/input.ts b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-error/input.ts deleted file mode 100644 index 53a49071e800..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-error/input.ts +++ /dev/null @@ -1,4 +0,0 @@ -type T20 = T; // Error -type T21 = T; // Error -type T22 = T; // Error -type T23 = T; // Error \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-error/options.json b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-error/options.json deleted file mode 100644 index cbf6d1595427..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-error/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "BABEL_8_BREAKING": true -} diff --git a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-error/output.json b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-error/output.json deleted file mode 100644 index ea0f512c6f32..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-error/output.json +++ /dev/null @@ -1,230 +0,0 @@ -{ - "type": "File", - "start":0,"end":142,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":4,"column":33,"index":142}}, - "errors": [ - "SyntaxError: 'public' modifier cannot appear on a type parameter. (1:9)", - "SyntaxError: Duplicate modifier: 'in'. (2:16)", - "SyntaxError: 'in' modifier must precede 'out' modifier. (2:16)", - "SyntaxError: Duplicate modifier: 'out'. (3:16)", - "SyntaxError: 'in' modifier must precede 'out' modifier. (4:13)" - ], - "program": { - "type": "Program", - "start":0,"end":142,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":4,"column":33,"index":142}}, - "sourceType": "module", - "interpreter": null, - "body": [ - { - "type": "TSTypeAliasDeclaration", - "start":0,"end":23,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":23,"index":23}}, - "id": { - "type": "Identifier", - "start":5,"end":8,"loc":{"start":{"line":1,"column":5,"index":5},"end":{"line":1,"column":8,"index":8},"identifierName":"T20"}, - "name": "T20" - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "start":8,"end":18,"loc":{"start":{"line":1,"column":8,"index":8},"end":{"line":1,"column":18,"index":18}}, - "params": [ - { - "type": "TSTypeParameter", - "start":9,"end":17,"loc":{"start":{"line":1,"column":9,"index":9},"end":{"line":1,"column":17,"index":17}}, - "accessibility": "public", - "name": { - "type": "Identifier", - "start":16,"end":17,"loc":{"start":{"line":1,"column":16,"index":16},"end":{"line":1,"column":17,"index":17},"identifierName":"T"}, - "name": "T" - } - } - ] - }, - "typeAnnotation": { - "type": "TSTypeReference", - "start":21,"end":22,"loc":{"start":{"line":1,"column":21,"index":21},"end":{"line":1,"column":22,"index":22}}, - "typeName": { - "type": "Identifier", - "start":21,"end":22,"loc":{"start":{"line":1,"column":21,"index":21},"end":{"line":1,"column":22,"index":22},"identifierName":"T"}, - "name": "T" - } - }, - "trailingComments": [ - { - "type": "CommentLine", - "value": " Error", - "start":25,"end":33,"loc":{"start":{"line":1,"column":25,"index":25},"end":{"line":1,"column":33,"index":33}} - } - ] - }, - { - "type": "TSTypeAliasDeclaration", - "start":34,"end":60,"loc":{"start":{"line":2,"column":0,"index":34},"end":{"line":2,"column":26,"index":60}}, - "id": { - "type": "Identifier", - "start":39,"end":42,"loc":{"start":{"line":2,"column":5,"index":39},"end":{"line":2,"column":8,"index":42},"identifierName":"T21"}, - "name": "T21" - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "start":42,"end":55,"loc":{"start":{"line":2,"column":8,"index":42},"end":{"line":2,"column":21,"index":55}}, - "params": [ - { - "type": "TSTypeParameter", - "start":43,"end":54,"loc":{"start":{"line":2,"column":9,"index":43},"end":{"line":2,"column":20,"index":54}}, - "in": true, - "out": true, - "name": { - "type": "Identifier", - "start":53,"end":54,"loc":{"start":{"line":2,"column":19,"index":53},"end":{"line":2,"column":20,"index":54},"identifierName":"T"}, - "name": "T" - } - } - ] - }, - "typeAnnotation": { - "type": "TSTypeReference", - "start":58,"end":59,"loc":{"start":{"line":2,"column":24,"index":58},"end":{"line":2,"column":25,"index":59}}, - "typeName": { - "type": "Identifier", - "start":58,"end":59,"loc":{"start":{"line":2,"column":24,"index":58},"end":{"line":2,"column":25,"index":59},"identifierName":"T"}, - "name": "T" - } - }, - "trailingComments": [ - { - "type": "CommentLine", - "value": " Error", - "start":62,"end":70,"loc":{"start":{"line":2,"column":28,"index":62},"end":{"line":2,"column":36,"index":70}} - } - ], - "leadingComments": [ - { - "type": "CommentLine", - "value": " Error", - "start":25,"end":33,"loc":{"start":{"line":1,"column":25,"index":25},"end":{"line":1,"column":33,"index":33}} - } - ] - }, - { - "type": "TSTypeAliasDeclaration", - "start":71,"end":98,"loc":{"start":{"line":3,"column":0,"index":71},"end":{"line":3,"column":27,"index":98}}, - "id": { - "type": "Identifier", - "start":76,"end":79,"loc":{"start":{"line":3,"column":5,"index":76},"end":{"line":3,"column":8,"index":79},"identifierName":"T22"}, - "name": "T22" - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "start":79,"end":93,"loc":{"start":{"line":3,"column":8,"index":79},"end":{"line":3,"column":22,"index":93}}, - "params": [ - { - "type": "TSTypeParameter", - "start":80,"end":92,"loc":{"start":{"line":3,"column":9,"index":80},"end":{"line":3,"column":21,"index":92}}, - "in": true, - "out": true, - "name": { - "type": "Identifier", - "start":91,"end":92,"loc":{"start":{"line":3,"column":20,"index":91},"end":{"line":3,"column":21,"index":92},"identifierName":"T"}, - "name": "T" - } - } - ] - }, - "typeAnnotation": { - "type": "TSTypeReference", - "start":96,"end":97,"loc":{"start":{"line":3,"column":25,"index":96},"end":{"line":3,"column":26,"index":97}}, - "typeName": { - "type": "Identifier", - "start":96,"end":97,"loc":{"start":{"line":3,"column":25,"index":96},"end":{"line":3,"column":26,"index":97},"identifierName":"T"}, - "name": "T" - } - }, - "trailingComments": [ - { - "type": "CommentLine", - "value": " Error", - "start":100,"end":108,"loc":{"start":{"line":3,"column":29,"index":100},"end":{"line":3,"column":37,"index":108}} - } - ], - "leadingComments": [ - { - "type": "CommentLine", - "value": " Error", - "start":62,"end":70,"loc":{"start":{"line":2,"column":28,"index":62},"end":{"line":2,"column":36,"index":70}} - } - ] - }, - { - "type": "TSTypeAliasDeclaration", - "start":109,"end":132,"loc":{"start":{"line":4,"column":0,"index":109},"end":{"line":4,"column":23,"index":132}}, - "id": { - "type": "Identifier", - "start":114,"end":117,"loc":{"start":{"line":4,"column":5,"index":114},"end":{"line":4,"column":8,"index":117},"identifierName":"T23"}, - "name": "T23" - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "start":117,"end":127,"loc":{"start":{"line":4,"column":8,"index":117},"end":{"line":4,"column":18,"index":127}}, - "params": [ - { - "type": "TSTypeParameter", - "start":118,"end":126,"loc":{"start":{"line":4,"column":9,"index":118},"end":{"line":4,"column":17,"index":126}}, - "out": true, - "in": true, - "name": { - "type": "Identifier", - "start":125,"end":126,"loc":{"start":{"line":4,"column":16,"index":125},"end":{"line":4,"column":17,"index":126},"identifierName":"T"}, - "name": "T" - } - } - ] - }, - "typeAnnotation": { - "type": "TSTypeReference", - "start":130,"end":131,"loc":{"start":{"line":4,"column":21,"index":130},"end":{"line":4,"column":22,"index":131}}, - "typeName": { - "type": "Identifier", - "start":130,"end":131,"loc":{"start":{"line":4,"column":21,"index":130},"end":{"line":4,"column":22,"index":131},"identifierName":"T"}, - "name": "T" - } - }, - "trailingComments": [ - { - "type": "CommentLine", - "value": " Error", - "start":134,"end":142,"loc":{"start":{"line":4,"column":25,"index":134},"end":{"line":4,"column":33,"index":142}} - } - ], - "leadingComments": [ - { - "type": "CommentLine", - "value": " Error", - "start":100,"end":108,"loc":{"start":{"line":3,"column":29,"index":100},"end":{"line":3,"column":37,"index":108}} - } - ] - } - ], - "directives": [] - }, - "comments": [ - { - "type": "CommentLine", - "value": " Error", - "start":25,"end":33,"loc":{"start":{"line":1,"column":25,"index":25},"end":{"line":1,"column":33,"index":33}} - }, - { - "type": "CommentLine", - "value": " Error", - "start":62,"end":70,"loc":{"start":{"line":2,"column":28,"index":62},"end":{"line":2,"column":36,"index":70}} - }, - { - "type": "CommentLine", - "value": " Error", - "start":100,"end":108,"loc":{"start":{"line":3,"column":29,"index":100},"end":{"line":3,"column":37,"index":108}} - }, - { - "type": "CommentLine", - "value": " Error", - "start":134,"end":142,"loc":{"start":{"line":4,"column":25,"index":134},"end":{"line":4,"column":33,"index":142}} - } - ] -} diff --git a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-error/input.tsx b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-error/input.tsx deleted file mode 100644 index 245cd63d5396..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-error/input.tsx +++ /dev/null @@ -1,5 +0,0 @@ -// valid JSX -() => {}; - -// SyntaxError: Single type parameter T should have a trailing comma. -() => {}; diff --git a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-error/output.json b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-error/output.json deleted file mode 100644 index 281caed37781..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-error/output.json +++ /dev/null @@ -1,137 +0,0 @@ -{ - "type": "File", - "start":0,"end":120,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":5,"column":15,"index":120}}, - "errors": [ - "SyntaxError: Single type parameter T should have a trailing comma. Example usage: . (5:6)" - ], - "program": { - "type": "Program", - "start":0,"end":120,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":5,"column":15,"index":120}}, - "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}} - } - } - ] - }, - "trailingComments": [ - { - "type": "CommentLine", - "value": " SyntaxError: Single type parameter T should have a trailing comma.", - "start":35,"end":104,"loc":{"start":{"line":4,"column":0,"index":35},"end":{"line":4,"column":69,"index":104}} - } - ], - "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": "ExpressionStatement", - "start":105,"end":120,"loc":{"start":{"line":5,"column":0,"index":105},"end":{"line":5,"column":15,"index":120}}, - "expression": { - "type": "ArrowFunctionExpression", - "start":105,"end":119,"loc":{"start":{"line":5,"column":0,"index":105},"end":{"line":5,"column":14,"index":119}}, - "id": null, - "generator": false, - "async": false, - "params": [], - "body": { - "type": "BlockStatement", - "start":117,"end":119,"loc":{"start":{"line":5,"column":12,"index":117},"end":{"line":5,"column":14,"index":119}}, - "body": [], - "directives": [] - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "start":105,"end":111,"loc":{"start":{"line":5,"column":0,"index":105},"end":{"line":5,"column":6,"index":111}}, - "params": [ - { - "type": "TSTypeParameter", - "start":106,"end":110,"loc":{"start":{"line":5,"column":1,"index":106},"end":{"line":5,"column":5,"index":110}}, - "in": true, - "name": "T" - } - ] - } - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " SyntaxError: Single type parameter T should have a trailing comma.", - "start":35,"end":104,"loc":{"start":{"line":4,"column":0,"index":35},"end":{"line":4,"column":69,"index":104}} - } - ] - } - ], - "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": " SyntaxError: Single type parameter T should have a trailing comma.", - "start":35,"end":104,"loc":{"start":{"line":4,"column":0,"index":35},"end":{"line":4,"column":69,"index":104}} - } - ] -} diff --git a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx/input.tsx b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx/input.tsx new file mode 100644 index 000000000000..b58a9a150b2c --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx/input.tsx @@ -0,0 +1,164 @@ +// 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 + +// FIXME: this should be recoverable 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-error/options.json b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx-error/options.json rename to packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx/options.json 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 new file mode 100644 index 000000000000..21458586c9d8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx/output.json @@ -0,0 +1,4019 @@ +{ + "type": "File", + "start":0,"end":3401,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":164,"column":81,"index":3401}}, + "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)" + ], + "program": { + "type": "Program", + "start":0,"end":3401,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":164,"column":81,"index":3401}}, + "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}} + }, + { + "type": "CommentLine", + "value": " FIXME: this should be recoverable error", + "start":1956,"end":1998,"loc":{"start":{"line":106,"column":0,"index":1956},"end":{"line":106,"column":42,"index":1998}} + }, + { + "type": "CommentLine", + "value": " class C {", + "start":1999,"end":2011,"loc":{"start":{"line":107,"column":0,"index":1999},"end":{"line":107,"column":12,"index":2011}} + }, + { + "type": "CommentLine", + "value": " in a = 0; // Error", + "start":2012,"end":2038,"loc":{"start":{"line":108,"column":0,"index":2012},"end":{"line":108,"column":26,"index":2038}} + }, + { + "type": "CommentLine", + "value": " out b = 0; // Error", + "start":2039,"end":2066,"loc":{"start":{"line":109,"column":0,"index":2039},"end":{"line":109,"column":27,"index":2066}} + }, + { + "type": "CommentLine", + "value": " }", + "start":2067,"end":2071,"loc":{"start":{"line":110,"column":0,"index":2067},"end":{"line":110,"column":4,"index":2071}} + }, + { + "type": "CommentLine", + "value": " Interface merging", + "start":2073,"end":2093,"loc":{"start":{"line":112,"column":0,"index":2073},"end":{"line":112,"column":20,"index":2093}} + } + ], + "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": "TSInterfaceDeclaration", + "start":2095,"end":2118,"loc":{"start":{"line":114,"column":0,"index":2095},"end":{"line":114,"column":23,"index":2118}}, + "id": { + "type": "Identifier", + "start":2105,"end":2108,"loc":{"start":{"line":114,"column":10,"index":2105},"end":{"line":114,"column":13,"index":2108},"identifierName":"Baz"}, + "name": "Baz" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":2108,"end":2115,"loc":{"start":{"line":114,"column":13,"index":2108},"end":{"line":114,"column":20,"index":2115}}, + "params": [ + { + "type": "TSTypeParameter", + "start":2109,"end":2114,"loc":{"start":{"line":114,"column":14,"index":2109},"end":{"line":114,"column":19,"index":2114}}, + "out": true, + "name": "T" + } + ] + }, + "body": { + "type": "TSInterfaceBody", + "start":2116,"end":2118,"loc":{"start":{"line":114,"column":21,"index":2116},"end":{"line":114,"column":23,"index":2118}}, + "body": [] + }, + "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": "CommentLine", + "value": " FIXME: this should be recoverable error", + "start":1956,"end":1998,"loc":{"start":{"line":106,"column":0,"index":1956},"end":{"line":106,"column":42,"index":1998}} + }, + { + "type": "CommentLine", + "value": " class C {", + "start":1999,"end":2011,"loc":{"start":{"line":107,"column":0,"index":1999},"end":{"line":107,"column":12,"index":2011}} + }, + { + "type": "CommentLine", + "value": " in a = 0; // Error", + "start":2012,"end":2038,"loc":{"start":{"line":108,"column":0,"index":2012},"end":{"line":108,"column":26,"index":2038}} + }, + { + "type": "CommentLine", + "value": " out b = 0; // Error", + "start":2039,"end":2066,"loc":{"start":{"line":109,"column":0,"index":2039},"end":{"line":109,"column":27,"index":2066}} + }, + { + "type": "CommentLine", + "value": " }", + "start":2067,"end":2071,"loc":{"start":{"line":110,"column":0,"index":2067},"end":{"line":110,"column":4,"index":2071}} + }, + { + "type": "CommentLine", + "value": " Interface merging", + "start":2073,"end":2093,"loc":{"start":{"line":112,"column":0,"index":2073},"end":{"line":112,"column":20,"index":2093}} + } + ] + }, + { + "type": "TSInterfaceDeclaration", + "start":2119,"end":2141,"loc":{"start":{"line":115,"column":0,"index":2119},"end":{"line":115,"column":22,"index":2141}}, + "id": { + "type": "Identifier", + "start":2129,"end":2132,"loc":{"start":{"line":115,"column":10,"index":2129},"end":{"line":115,"column":13,"index":2132},"identifierName":"Baz"}, + "name": "Baz" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":2132,"end":2138,"loc":{"start":{"line":115,"column":13,"index":2132},"end":{"line":115,"column":19,"index":2138}}, + "params": [ + { + "type": "TSTypeParameter", + "start":2133,"end":2137,"loc":{"start":{"line":115,"column":14,"index":2133},"end":{"line":115,"column":18,"index":2137}}, + "in": true, + "name": "T" + } + ] + }, + "body": { + "type": "TSInterfaceBody", + "start":2139,"end":2141,"loc":{"start":{"line":115,"column":20,"index":2139},"end":{"line":115,"column":22,"index":2141}}, + "body": [] + } + }, + { + "type": "VariableDeclaration", + "start":2143,"end":2174,"loc":{"start":{"line":117,"column":0,"index":2143},"end":{"line":117,"column":31,"index":2174}}, + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "start":2155,"end":2173,"loc":{"start":{"line":117,"column":12,"index":2155},"end":{"line":117,"column":30,"index":2173}}, + "id": { + "type": "Identifier", + "start":2155,"end":2173,"loc":{"start":{"line":117,"column":12,"index":2155},"end":{"line":117,"column":30,"index":2173},"identifierName":"baz1"}, + "name": "baz1", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2159,"end":2173,"loc":{"start":{"line":117,"column":16,"index":2159},"end":{"line":117,"column":30,"index":2173}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2161,"end":2173,"loc":{"start":{"line":117,"column":18,"index":2161},"end":{"line":117,"column":30,"index":2173}}, + "typeName": { + "type": "Identifier", + "start":2161,"end":2164,"loc":{"start":{"line":117,"column":18,"index":2161},"end":{"line":117,"column":21,"index":2164},"identifierName":"Baz"}, + "name": "Baz" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2164,"end":2173,"loc":{"start":{"line":117,"column":21,"index":2164},"end":{"line":117,"column":30,"index":2173}}, + "params": [ + { + "type": "TSUnknownKeyword", + "start":2165,"end":2172,"loc":{"start":{"line":117,"column":22,"index":2165},"end":{"line":117,"column":29,"index":2172}} + } + ] + } + } + } + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "VariableDeclaration", + "start":2175,"end":2205,"loc":{"start":{"line":118,"column":0,"index":2175},"end":{"line":118,"column":30,"index":2205}}, + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "start":2187,"end":2204,"loc":{"start":{"line":118,"column":12,"index":2187},"end":{"line":118,"column":29,"index":2204}}, + "id": { + "type": "Identifier", + "start":2187,"end":2204,"loc":{"start":{"line":118,"column":12,"index":2187},"end":{"line":118,"column":29,"index":2204},"identifierName":"baz2"}, + "name": "baz2", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2191,"end":2204,"loc":{"start":{"line":118,"column":16,"index":2191},"end":{"line":118,"column":29,"index":2204}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2193,"end":2204,"loc":{"start":{"line":118,"column":18,"index":2193},"end":{"line":118,"column":29,"index":2204}}, + "typeName": { + "type": "Identifier", + "start":2193,"end":2196,"loc":{"start":{"line":118,"column":18,"index":2193},"end":{"line":118,"column":21,"index":2196},"identifierName":"Baz"}, + "name": "Baz" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2196,"end":2204,"loc":{"start":{"line":118,"column":21,"index":2196},"end":{"line":118,"column":29,"index":2204}}, + "params": [ + { + "type": "TSStringKeyword", + "start":2197,"end":2203,"loc":{"start":{"line":118,"column":22,"index":2197},"end":{"line":118,"column":28,"index":2203}} + } + ] + } + } + } + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "ExpressionStatement", + "start":2207,"end":2219,"loc":{"start":{"line":120,"column":0,"index":2207},"end":{"line":120,"column":12,"index":2219}}, + "expression": { + "type": "AssignmentExpression", + "start":2207,"end":2218,"loc":{"start":{"line":120,"column":0,"index":2207},"end":{"line":120,"column":11,"index":2218}}, + "operator": "=", + "left": { + "type": "Identifier", + "start":2207,"end":2211,"loc":{"start":{"line":120,"column":0,"index":2207},"end":{"line":120,"column":4,"index":2211},"identifierName":"baz1"}, + "name": "baz1" + }, + "right": { + "type": "Identifier", + "start":2214,"end":2218,"loc":{"start":{"line":120,"column":7,"index":2214},"end":{"line":120,"column":11,"index":2218},"identifierName":"baz2"}, + "name": "baz2" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":2221,"end":2229,"loc":{"start":{"line":120,"column":14,"index":2221},"end":{"line":120,"column":22,"index":2229}} + } + ] + }, + { + "type": "ExpressionStatement", + "start":2230,"end":2242,"loc":{"start":{"line":121,"column":0,"index":2230},"end":{"line":121,"column":12,"index":2242}}, + "expression": { + "type": "AssignmentExpression", + "start":2230,"end":2241,"loc":{"start":{"line":121,"column":0,"index":2230},"end":{"line":121,"column":11,"index":2241}}, + "operator": "=", + "left": { + "type": "Identifier", + "start":2230,"end":2234,"loc":{"start":{"line":121,"column":0,"index":2230},"end":{"line":121,"column":4,"index":2234},"identifierName":"baz2"}, + "name": "baz2" + }, + "right": { + "type": "Identifier", + "start":2237,"end":2241,"loc":{"start":{"line":121,"column":7,"index":2237},"end":{"line":121,"column":11,"index":2241},"identifierName":"baz1"}, + "name": "baz1" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":2244,"end":2252,"loc":{"start":{"line":121,"column":14,"index":2244},"end":{"line":121,"column":22,"index":2252}} + }, + { + "type": "CommentLine", + "value": " Repro from #44572", + "start":2254,"end":2274,"loc":{"start":{"line":123,"column":0,"index":2254},"end":{"line":123,"column":20,"index":2274}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":2221,"end":2229,"loc":{"start":{"line":120,"column":14,"index":2221},"end":{"line":120,"column":22,"index":2229}} + } + ] + }, + { + "type": "TSInterfaceDeclaration", + "start":2276,"end":2361,"loc":{"start":{"line":125,"column":0,"index":2276},"end":{"line":128,"column":1,"index":2361}}, + "id": { + "type": "Identifier", + "start":2286,"end":2292,"loc":{"start":{"line":125,"column":10,"index":2286},"end":{"line":125,"column":16,"index":2292},"identifierName":"Parent"}, + "name": "Parent" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":2292,"end":2299,"loc":{"start":{"line":125,"column":16,"index":2292},"end":{"line":125,"column":23,"index":2299}}, + "params": [ + { + "type": "TSTypeParameter", + "start":2293,"end":2298,"loc":{"start":{"line":125,"column":17,"index":2293},"end":{"line":125,"column":22,"index":2298}}, + "out": true, + "name": "A" + } + ] + }, + "body": { + "type": "TSInterfaceBody", + "start":2300,"end":2361,"loc":{"start":{"line":125,"column":24,"index":2300},"end":{"line":128,"column":1,"index":2361}}, + "body": [ + { + "type": "TSPropertySignature", + "start":2306,"end":2329,"loc":{"start":{"line":126,"column":4,"index":2306},"end":{"line":126,"column":27,"index":2329}}, + "key": { + "type": "Identifier", + "start":2306,"end":2311,"loc":{"start":{"line":126,"column":4,"index":2306},"end":{"line":126,"column":9,"index":2311},"identifierName":"child"}, + "name": "child" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2311,"end":2328,"loc":{"start":{"line":126,"column":9,"index":2311},"end":{"line":126,"column":26,"index":2328}}, + "typeAnnotation": { + "type": "TSUnionType", + "start":2313,"end":2328,"loc":{"start":{"line":126,"column":11,"index":2313},"end":{"line":126,"column":26,"index":2328}}, + "types": [ + { + "type": "TSTypeReference", + "start":2313,"end":2321,"loc":{"start":{"line":126,"column":11,"index":2313},"end":{"line":126,"column":19,"index":2321}}, + "typeName": { + "type": "Identifier", + "start":2313,"end":2318,"loc":{"start":{"line":126,"column":11,"index":2313},"end":{"line":126,"column":16,"index":2318},"identifierName":"Child"}, + "name": "Child" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2318,"end":2321,"loc":{"start":{"line":126,"column":16,"index":2318},"end":{"line":126,"column":19,"index":2321}}, + "params": [ + { + "type": "TSTypeReference", + "start":2319,"end":2320,"loc":{"start":{"line":126,"column":17,"index":2319},"end":{"line":126,"column":18,"index":2320}}, + "typeName": { + "type": "Identifier", + "start":2319,"end":2320,"loc":{"start":{"line":126,"column":17,"index":2319},"end":{"line":126,"column":18,"index":2320},"identifierName":"A"}, + "name": "A" + } + } + ] + } + }, + { + "type": "TSNullKeyword", + "start":2324,"end":2328,"loc":{"start":{"line":126,"column":22,"index":2324},"end":{"line":126,"column":26,"index":2328}} + } + ] + } + } + }, + { + "type": "TSPropertySignature", + "start":2334,"end":2359,"loc":{"start":{"line":127,"column":4,"index":2334},"end":{"line":127,"column":29,"index":2359}}, + "key": { + "type": "Identifier", + "start":2334,"end":2340,"loc":{"start":{"line":127,"column":4,"index":2334},"end":{"line":127,"column":10,"index":2340},"identifierName":"parent"}, + "name": "parent" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2340,"end":2358,"loc":{"start":{"line":127,"column":10,"index":2340},"end":{"line":127,"column":28,"index":2358}}, + "typeAnnotation": { + "type": "TSUnionType", + "start":2342,"end":2358,"loc":{"start":{"line":127,"column":12,"index":2342},"end":{"line":127,"column":28,"index":2358}}, + "types": [ + { + "type": "TSTypeReference", + "start":2342,"end":2351,"loc":{"start":{"line":127,"column":12,"index":2342},"end":{"line":127,"column":21,"index":2351}}, + "typeName": { + "type": "Identifier", + "start":2342,"end":2348,"loc":{"start":{"line":127,"column":12,"index":2342},"end":{"line":127,"column":18,"index":2348},"identifierName":"Parent"}, + "name": "Parent" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2348,"end":2351,"loc":{"start":{"line":127,"column":18,"index":2348},"end":{"line":127,"column":21,"index":2351}}, + "params": [ + { + "type": "TSTypeReference", + "start":2349,"end":2350,"loc":{"start":{"line":127,"column":19,"index":2349},"end":{"line":127,"column":20,"index":2350}}, + "typeName": { + "type": "Identifier", + "start":2349,"end":2350,"loc":{"start":{"line":127,"column":19,"index":2349},"end":{"line":127,"column":20,"index":2350},"identifierName":"A"}, + "name": "A" + } + } + ] + } + }, + { + "type": "TSNullKeyword", + "start":2354,"end":2358,"loc":{"start":{"line":127,"column":24,"index":2354},"end":{"line":127,"column":28,"index":2358}} + } + ] + } + } + } + ] + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":2244,"end":2252,"loc":{"start":{"line":121,"column":14,"index":2244},"end":{"line":121,"column":22,"index":2252}} + }, + { + "type": "CommentLine", + "value": " Repro from #44572", + "start":2254,"end":2274,"loc":{"start":{"line":123,"column":0,"index":2254},"end":{"line":123,"column":20,"index":2274}} + } + ] + }, + { + "type": "TSInterfaceDeclaration", + "start":2363,"end":2454,"loc":{"start":{"line":130,"column":0,"index":2363},"end":{"line":133,"column":1,"index":2454}}, + "id": { + "type": "Identifier", + "start":2373,"end":2378,"loc":{"start":{"line":130,"column":10,"index":2373},"end":{"line":130,"column":15,"index":2378},"identifierName":"Child"}, + "name": "Child" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":2378,"end":2394,"loc":{"start":{"line":130,"column":15,"index":2378},"end":{"line":130,"column":31,"index":2394}}, + "params": [ + { + "type": "TSTypeParameter", + "start":2379,"end":2380,"loc":{"start":{"line":130,"column":16,"index":2379},"end":{"line":130,"column":17,"index":2380}}, + "name": "A" + }, + { + "type": "TSTypeParameter", + "start":2382,"end":2393,"loc":{"start":{"line":130,"column":19,"index":2382},"end":{"line":130,"column":30,"index":2393}}, + "name": "B", + "default": { + "type": "TSUnknownKeyword", + "start":2386,"end":2393,"loc":{"start":{"line":130,"column":23,"index":2386},"end":{"line":130,"column":30,"index":2393}} + } + } + ] + }, + "extends": [ + { + "type": "TSExpressionWithTypeArguments", + "start":2403,"end":2412,"loc":{"start":{"line":130,"column":40,"index":2403},"end":{"line":130,"column":49,"index":2412}}, + "expression": { + "type": "Identifier", + "start":2403,"end":2409,"loc":{"start":{"line":130,"column":40,"index":2403},"end":{"line":130,"column":46,"index":2409},"identifierName":"Parent"}, + "name": "Parent" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2409,"end":2412,"loc":{"start":{"line":130,"column":46,"index":2409},"end":{"line":130,"column":49,"index":2412}}, + "params": [ + { + "type": "TSTypeReference", + "start":2410,"end":2411,"loc":{"start":{"line":130,"column":47,"index":2410},"end":{"line":130,"column":48,"index":2411}}, + "typeName": { + "type": "Identifier", + "start":2410,"end":2411,"loc":{"start":{"line":130,"column":47,"index":2410},"end":{"line":130,"column":48,"index":2411},"identifierName":"A"}, + "name": "A" + } + } + ] + } + } + ], + "body": { + "type": "TSInterfaceBody", + "start":2413,"end":2454,"loc":{"start":{"line":130,"column":50,"index":2413},"end":{"line":133,"column":1,"index":2454}}, + "body": [ + { + "type": "TSPropertySignature", + "start":2419,"end":2433,"loc":{"start":{"line":131,"column":4,"index":2419},"end":{"line":131,"column":18,"index":2433}}, + "readonly": true, + "key": { + "type": "Identifier", + "start":2428,"end":2429,"loc":{"start":{"line":131,"column":13,"index":2428},"end":{"line":131,"column":14,"index":2429},"identifierName":"a"}, + "name": "a" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2429,"end":2432,"loc":{"start":{"line":131,"column":14,"index":2429},"end":{"line":131,"column":17,"index":2432}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2431,"end":2432,"loc":{"start":{"line":131,"column":16,"index":2431},"end":{"line":131,"column":17,"index":2432}}, + "typeName": { + "type": "Identifier", + "start":2431,"end":2432,"loc":{"start":{"line":131,"column":16,"index":2431},"end":{"line":131,"column":17,"index":2432},"identifierName":"A"}, + "name": "A" + } + } + } + }, + { + "type": "TSPropertySignature", + "start":2438,"end":2452,"loc":{"start":{"line":132,"column":4,"index":2438},"end":{"line":132,"column":18,"index":2452}}, + "readonly": true, + "key": { + "type": "Identifier", + "start":2447,"end":2448,"loc":{"start":{"line":132,"column":13,"index":2447},"end":{"line":132,"column":14,"index":2448},"identifierName":"b"}, + "name": "b" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2448,"end":2451,"loc":{"start":{"line":132,"column":14,"index":2448},"end":{"line":132,"column":17,"index":2451}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2450,"end":2451,"loc":{"start":{"line":132,"column":16,"index":2450},"end":{"line":132,"column":17,"index":2451}}, + "typeName": { + "type": "Identifier", + "start":2450,"end":2451,"loc":{"start":{"line":132,"column":16,"index":2450},"end":{"line":132,"column":17,"index":2451},"identifierName":"B"}, + "name": "B" + } + } + } + } + ] + } + }, + { + "type": "FunctionDeclaration", + "start":2456,"end":2524,"loc":{"start":{"line":135,"column":0,"index":2456},"end":{"line":137,"column":1,"index":2524}}, + "id": { + "type": "Identifier", + "start":2465,"end":2467,"loc":{"start":{"line":135,"column":9,"index":2465},"end":{"line":135,"column":11,"index":2467},"identifierName":"fn"}, + "name": "fn" + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":2467,"end":2470,"loc":{"start":{"line":135,"column":11,"index":2467},"end":{"line":135,"column":14,"index":2470}}, + "params": [ + { + "type": "TSTypeParameter", + "start":2468,"end":2469,"loc":{"start":{"line":135,"column":12,"index":2468},"end":{"line":135,"column":13,"index":2469}}, + "name": "A" + } + ] + }, + "params": [ + { + "type": "Identifier", + "start":2471,"end":2484,"loc":{"start":{"line":135,"column":15,"index":2471},"end":{"line":135,"column":28,"index":2484},"identifierName":"inp"}, + "name": "inp", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2474,"end":2484,"loc":{"start":{"line":135,"column":18,"index":2474},"end":{"line":135,"column":28,"index":2484}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2476,"end":2484,"loc":{"start":{"line":135,"column":20,"index":2476},"end":{"line":135,"column":28,"index":2484}}, + "typeName": { + "type": "Identifier", + "start":2476,"end":2481,"loc":{"start":{"line":135,"column":20,"index":2476},"end":{"line":135,"column":25,"index":2481},"identifierName":"Child"}, + "name": "Child" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2481,"end":2484,"loc":{"start":{"line":135,"column":25,"index":2481},"end":{"line":135,"column":28,"index":2484}}, + "params": [ + { + "type": "TSTypeReference", + "start":2482,"end":2483,"loc":{"start":{"line":135,"column":26,"index":2482},"end":{"line":135,"column":27,"index":2483}}, + "typeName": { + "type": "Identifier", + "start":2482,"end":2483,"loc":{"start":{"line":135,"column":26,"index":2482},"end":{"line":135,"column":27,"index":2483},"identifierName":"A"}, + "name": "A" + } + } + ] + } + } + } + } + ], + "body": { + "type": "BlockStatement", + "start":2486,"end":2524,"loc":{"start":{"line":135,"column":30,"index":2486},"end":{"line":137,"column":1,"index":2524}}, + "body": [ + { + "type": "VariableDeclaration", + "start":2492,"end":2522,"loc":{"start":{"line":136,"column":4,"index":2492},"end":{"line":136,"column":34,"index":2522}}, + "declarations": [ + { + "type": "VariableDeclarator", + "start":2498,"end":2521,"loc":{"start":{"line":136,"column":10,"index":2498},"end":{"line":136,"column":33,"index":2521}}, + "id": { + "type": "Identifier", + "start":2498,"end":2515,"loc":{"start":{"line":136,"column":10,"index":2498},"end":{"line":136,"column":27,"index":2515},"identifierName":"a"}, + "name": "a", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2499,"end":2515,"loc":{"start":{"line":136,"column":11,"index":2499},"end":{"line":136,"column":27,"index":2515}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2501,"end":2515,"loc":{"start":{"line":136,"column":13,"index":2501},"end":{"line":136,"column":27,"index":2515}}, + "typeName": { + "type": "Identifier", + "start":2501,"end":2506,"loc":{"start":{"line":136,"column":13,"index":2501},"end":{"line":136,"column":18,"index":2506},"identifierName":"Child"}, + "name": "Child" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2506,"end":2515,"loc":{"start":{"line":136,"column":18,"index":2506},"end":{"line":136,"column":27,"index":2515}}, + "params": [ + { + "type": "TSUnknownKeyword", + "start":2507,"end":2514,"loc":{"start":{"line":136,"column":19,"index":2507},"end":{"line":136,"column":26,"index":2514}} + } + ] + } + } + } + }, + "init": { + "type": "Identifier", + "start":2518,"end":2521,"loc":{"start":{"line":136,"column":30,"index":2518},"end":{"line":136,"column":33,"index":2521},"identifierName":"inp"}, + "name": "inp" + } + } + ], + "kind": "const" + } + ], + "directives": [] + } + }, + { + "type": "VariableDeclaration", + "start":2526,"end":2621,"loc":{"start":{"line":139,"column":0,"index":2526},"end":{"line":139,"column":95,"index":2621}}, + "declarations": [ + { + "type": "VariableDeclarator", + "start":2532,"end":2620,"loc":{"start":{"line":139,"column":6,"index":2532},"end":{"line":139,"column":94,"index":2620}}, + "id": { + "type": "Identifier", + "start":2532,"end":2551,"loc":{"start":{"line":139,"column":6,"index":2532},"end":{"line":139,"column":25,"index":2551},"identifierName":"pu"}, + "name": "pu", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2534,"end":2551,"loc":{"start":{"line":139,"column":8,"index":2534},"end":{"line":139,"column":25,"index":2551}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2536,"end":2551,"loc":{"start":{"line":139,"column":10,"index":2536},"end":{"line":139,"column":25,"index":2551}}, + "typeName": { + "type": "Identifier", + "start":2536,"end":2542,"loc":{"start":{"line":139,"column":10,"index":2536},"end":{"line":139,"column":16,"index":2542},"identifierName":"Parent"}, + "name": "Parent" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2542,"end":2551,"loc":{"start":{"line":139,"column":16,"index":2542},"end":{"line":139,"column":25,"index":2551}}, + "params": [ + { + "type": "TSUnknownKeyword", + "start":2543,"end":2550,"loc":{"start":{"line":139,"column":17,"index":2543},"end":{"line":139,"column":24,"index":2550}} + } + ] + } + } + } + }, + "init": { + "type": "ObjectExpression", + "start":2554,"end":2620,"loc":{"start":{"line":139,"column":28,"index":2554},"end":{"line":139,"column":94,"index":2620}}, + "properties": [ + { + "type": "ObjectProperty", + "start":2556,"end":2604,"loc":{"start":{"line":139,"column":30,"index":2556},"end":{"line":139,"column":78,"index":2604}}, + "method": false, + "key": { + "type": "Identifier", + "start":2556,"end":2561,"loc":{"start":{"line":139,"column":30,"index":2556},"end":{"line":139,"column":35,"index":2561},"identifierName":"child"}, + "name": "child" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "ObjectExpression", + "start":2563,"end":2604,"loc":{"start":{"line":139,"column":37,"index":2563},"end":{"line":139,"column":78,"index":2604}}, + "properties": [ + { + "type": "ObjectProperty", + "start":2565,"end":2569,"loc":{"start":{"line":139,"column":39,"index":2565},"end":{"line":139,"column":43,"index":2569}}, + "method": false, + "key": { + "type": "Identifier", + "start":2565,"end":2566,"loc":{"start":{"line":139,"column":39,"index":2565},"end":{"line":139,"column":40,"index":2566},"identifierName":"a"}, + "name": "a" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NumericLiteral", + "start":2568,"end":2569,"loc":{"start":{"line":139,"column":42,"index":2568},"end":{"line":139,"column":43,"index":2569}}, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + { + "type": "ObjectProperty", + "start":2571,"end":2575,"loc":{"start":{"line":139,"column":45,"index":2571},"end":{"line":139,"column":49,"index":2575}}, + "method": false, + "key": { + "type": "Identifier", + "start":2571,"end":2572,"loc":{"start":{"line":139,"column":45,"index":2571},"end":{"line":139,"column":46,"index":2572},"identifierName":"b"}, + "name": "b" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NumericLiteral", + "start":2574,"end":2575,"loc":{"start":{"line":139,"column":48,"index":2574},"end":{"line":139,"column":49,"index":2575}}, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + { + "type": "ObjectProperty", + "start":2577,"end":2588,"loc":{"start":{"line":139,"column":51,"index":2577},"end":{"line":139,"column":62,"index":2588}}, + "method": false, + "key": { + "type": "Identifier", + "start":2577,"end":2582,"loc":{"start":{"line":139,"column":51,"index":2577},"end":{"line":139,"column":56,"index":2582},"identifierName":"child"}, + "name": "child" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NullLiteral", + "start":2584,"end":2588,"loc":{"start":{"line":139,"column":58,"index":2584},"end":{"line":139,"column":62,"index":2588}} + } + }, + { + "type": "ObjectProperty", + "start":2590,"end":2602,"loc":{"start":{"line":139,"column":64,"index":2590},"end":{"line":139,"column":76,"index":2602}}, + "method": false, + "key": { + "type": "Identifier", + "start":2590,"end":2596,"loc":{"start":{"line":139,"column":64,"index":2590},"end":{"line":139,"column":70,"index":2596},"identifierName":"parent"}, + "name": "parent" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NullLiteral", + "start":2598,"end":2602,"loc":{"start":{"line":139,"column":72,"index":2598},"end":{"line":139,"column":76,"index":2602}} + } + } + ] + } + }, + { + "type": "ObjectProperty", + "start":2606,"end":2618,"loc":{"start":{"line":139,"column":80,"index":2606},"end":{"line":139,"column":92,"index":2618}}, + "method": false, + "key": { + "type": "Identifier", + "start":2606,"end":2612,"loc":{"start":{"line":139,"column":80,"index":2606},"end":{"line":139,"column":86,"index":2612},"identifierName":"parent"}, + "name": "parent" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NullLiteral", + "start":2614,"end":2618,"loc":{"start":{"line":139,"column":88,"index":2614},"end":{"line":139,"column":92,"index":2618}} + } + } + ] + } + } + ], + "kind": "const" + }, + { + "type": "VariableDeclaration", + "start":2622,"end":2659,"loc":{"start":{"line":140,"column":0,"index":2622},"end":{"line":140,"column":37,"index":2659}}, + "declarations": [ + { + "type": "VariableDeclarator", + "start":2628,"end":2658,"loc":{"start":{"line":140,"column":6,"index":2628},"end":{"line":140,"column":36,"index":2658}}, + "id": { + "type": "Identifier", + "start":2628,"end":2653,"loc":{"start":{"line":140,"column":6,"index":2628},"end":{"line":140,"column":31,"index":2653},"identifierName":"notString"}, + "name": "notString", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2637,"end":2653,"loc":{"start":{"line":140,"column":15,"index":2637},"end":{"line":140,"column":31,"index":2653}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2639,"end":2653,"loc":{"start":{"line":140,"column":17,"index":2639},"end":{"line":140,"column":31,"index":2653}}, + "typeName": { + "type": "Identifier", + "start":2639,"end":2645,"loc":{"start":{"line":140,"column":17,"index":2639},"end":{"line":140,"column":23,"index":2645},"identifierName":"Parent"}, + "name": "Parent" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2645,"end":2653,"loc":{"start":{"line":140,"column":23,"index":2645},"end":{"line":140,"column":31,"index":2653}}, + "params": [ + { + "type": "TSStringKeyword", + "start":2646,"end":2652,"loc":{"start":{"line":140,"column":24,"index":2646},"end":{"line":140,"column":30,"index":2652}} + } + ] + } + } + } + }, + "init": { + "type": "Identifier", + "start":2656,"end":2658,"loc":{"start":{"line":140,"column":34,"index":2656},"end":{"line":140,"column":36,"index":2658},"identifierName":"pu"}, + "name": "pu" + } + } + ], + "kind": "const", + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":2661,"end":2669,"loc":{"start":{"line":140,"column":39,"index":2661},"end":{"line":140,"column":47,"index":2669}} + }, + { + "type": "CommentLine", + "value": " Repro from comment in #44572", + "start":2671,"end":2702,"loc":{"start":{"line":142,"column":0,"index":2671},"end":{"line":142,"column":31,"index":2702}} + } + ] + }, + { + "type": "ClassDeclaration", + "start":2704,"end":2880,"loc":{"start":{"line":144,"column":0,"index":2704},"end":{"line":148,"column":1,"index":2880}}, + "declare": true, + "id": { + "type": "Identifier", + "start":2718,"end":2727,"loc":{"start":{"line":144,"column":14,"index":2718},"end":{"line":144,"column":23,"index":2727},"identifierName":"StateNode"}, + "name": "StateNode" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":2727,"end":2777,"loc":{"start":{"line":144,"column":23,"index":2727},"end":{"line":144,"column":73,"index":2777}}, + "params": [ + { + "type": "TSTypeParameter", + "start":2728,"end":2736,"loc":{"start":{"line":144,"column":24,"index":2728},"end":{"line":144,"column":32,"index":2736}}, + "name": "TContext" + }, + { + "type": "TSTypeParameter", + "start":2738,"end":2776,"loc":{"start":{"line":144,"column":34,"index":2738},"end":{"line":144,"column":72,"index":2776}}, + "in": true, + "out": true, + "name": "TEvent", + "constraint": { + "type": "TSTypeLiteral", + "start":2760,"end":2776,"loc":{"start":{"line":144,"column":56,"index":2760},"end":{"line":144,"column":72,"index":2776}}, + "members": [ + { + "type": "TSPropertySignature", + "start":2762,"end":2774,"loc":{"start":{"line":144,"column":58,"index":2762},"end":{"line":144,"column":70,"index":2774}}, + "key": { + "type": "Identifier", + "start":2762,"end":2766,"loc":{"start":{"line":144,"column":58,"index":2762},"end":{"line":144,"column":62,"index":2766},"identifierName":"type"}, + "name": "type" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2766,"end":2774,"loc":{"start":{"line":144,"column":62,"index":2766},"end":{"line":144,"column":70,"index":2774}}, + "typeAnnotation": { + "type": "TSStringKeyword", + "start":2768,"end":2774,"loc":{"start":{"line":144,"column":64,"index":2768},"end":{"line":144,"column":70,"index":2774}} + } + } + } + ] + } + } + ] + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start":2778,"end":2880,"loc":{"start":{"line":144,"column":74,"index":2778},"end":{"line":148,"column":1,"index":2880}}, + "body": [ + { + "type": "ClassProperty", + "start":2784,"end":2805,"loc":{"start":{"line":145,"column":4,"index":2784},"end":{"line":145,"column":25,"index":2805}}, + "static": false, + "key": { + "type": "Identifier", + "start":2784,"end":2796,"loc":{"start":{"line":145,"column":4,"index":2784},"end":{"line":145,"column":16,"index":2796},"identifierName":"_storedEvent"}, + "name": "_storedEvent" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2796,"end":2804,"loc":{"start":{"line":145,"column":16,"index":2796},"end":{"line":145,"column":24,"index":2804}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2798,"end":2804,"loc":{"start":{"line":145,"column":18,"index":2798},"end":{"line":145,"column":24,"index":2804}}, + "typeName": { + "type": "Identifier", + "start":2798,"end":2804,"loc":{"start":{"line":145,"column":18,"index":2798},"end":{"line":145,"column":24,"index":2804},"identifierName":"TEvent"}, + "name": "TEvent" + } + } + }, + "value": null + }, + { + "type": "ClassProperty", + "start":2810,"end":2840,"loc":{"start":{"line":146,"column":4,"index":2810},"end":{"line":146,"column":34,"index":2840}}, + "static": false, + "key": { + "type": "Identifier", + "start":2810,"end":2817,"loc":{"start":{"line":146,"column":4,"index":2810},"end":{"line":146,"column":11,"index":2817},"identifierName":"_action"}, + "name": "_action" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2817,"end":2839,"loc":{"start":{"line":146,"column":11,"index":2817},"end":{"line":146,"column":33,"index":2839}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2819,"end":2839,"loc":{"start":{"line":146,"column":13,"index":2819},"end":{"line":146,"column":33,"index":2839}}, + "typeName": { + "type": "Identifier", + "start":2819,"end":2831,"loc":{"start":{"line":146,"column":13,"index":2819},"end":{"line":146,"column":25,"index":2831},"identifierName":"ActionObject"}, + "name": "ActionObject" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2831,"end":2839,"loc":{"start":{"line":146,"column":25,"index":2831},"end":{"line":146,"column":33,"index":2839}}, + "params": [ + { + "type": "TSTypeReference", + "start":2832,"end":2838,"loc":{"start":{"line":146,"column":26,"index":2832},"end":{"line":146,"column":32,"index":2838}}, + "typeName": { + "type": "Identifier", + "start":2832,"end":2838,"loc":{"start":{"line":146,"column":26,"index":2832},"end":{"line":146,"column":32,"index":2838},"identifierName":"TEvent"}, + "name": "TEvent" + } + } + ] + } + } + }, + "value": null + }, + { + "type": "ClassProperty", + "start":2845,"end":2878,"loc":{"start":{"line":147,"column":4,"index":2845},"end":{"line":147,"column":37,"index":2878}}, + "static": false, + "key": { + "type": "Identifier", + "start":2845,"end":2851,"loc":{"start":{"line":147,"column":4,"index":2845},"end":{"line":147,"column":10,"index":2851},"identifierName":"_state"}, + "name": "_state" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2851,"end":2877,"loc":{"start":{"line":147,"column":10,"index":2851},"end":{"line":147,"column":36,"index":2877}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2853,"end":2877,"loc":{"start":{"line":147,"column":12,"index":2853},"end":{"line":147,"column":36,"index":2877}}, + "typeName": { + "type": "Identifier", + "start":2853,"end":2862,"loc":{"start":{"line":147,"column":12,"index":2853},"end":{"line":147,"column":21,"index":2862},"identifierName":"StateNode"}, + "name": "StateNode" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2862,"end":2877,"loc":{"start":{"line":147,"column":21,"index":2862},"end":{"line":147,"column":36,"index":2877}}, + "params": [ + { + "type": "TSTypeReference", + "start":2863,"end":2871,"loc":{"start":{"line":147,"column":22,"index":2863},"end":{"line":147,"column":30,"index":2871}}, + "typeName": { + "type": "Identifier", + "start":2863,"end":2871,"loc":{"start":{"line":147,"column":22,"index":2863},"end":{"line":147,"column":30,"index":2871},"identifierName":"TContext"}, + "name": "TContext" + } + }, + { + "type": "TSAnyKeyword", + "start":2873,"end":2876,"loc":{"start":{"line":147,"column":32,"index":2873},"end":{"line":147,"column":35,"index":2876}} + } + ] + } + } + }, + "value": null + } + ] + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":2661,"end":2669,"loc":{"start":{"line":140,"column":39,"index":2661},"end":{"line":140,"column":47,"index":2669}} + }, + { + "type": "CommentLine", + "value": " Repro from comment in #44572", + "start":2671,"end":2702,"loc":{"start":{"line":142,"column":0,"index":2671},"end":{"line":142,"column":31,"index":2702}} + } + ] + }, + { + "type": "TSInterfaceDeclaration", + "start":2882,"end":2991,"loc":{"start":{"line":150,"column":0,"index":2882},"end":{"line":152,"column":1,"index":2991}}, + "id": { + "type": "Identifier", + "start":2892,"end":2904,"loc":{"start":{"line":150,"column":10,"index":2892},"end":{"line":150,"column":22,"index":2904},"identifierName":"ActionObject"}, + "name": "ActionObject" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":2904,"end":2937,"loc":{"start":{"line":150,"column":22,"index":2904},"end":{"line":150,"column":55,"index":2937}}, + "params": [ + { + "type": "TSTypeParameter", + "start":2905,"end":2936,"loc":{"start":{"line":150,"column":23,"index":2905},"end":{"line":150,"column":54,"index":2936}}, + "name": "TEvent", + "constraint": { + "type": "TSTypeLiteral", + "start":2920,"end":2936,"loc":{"start":{"line":150,"column":38,"index":2920},"end":{"line":150,"column":54,"index":2936}}, + "members": [ + { + "type": "TSPropertySignature", + "start":2922,"end":2934,"loc":{"start":{"line":150,"column":40,"index":2922},"end":{"line":150,"column":52,"index":2934}}, + "key": { + "type": "Identifier", + "start":2922,"end":2926,"loc":{"start":{"line":150,"column":40,"index":2922},"end":{"line":150,"column":44,"index":2926},"identifierName":"type"}, + "name": "type" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2926,"end":2934,"loc":{"start":{"line":150,"column":44,"index":2926},"end":{"line":150,"column":52,"index":2934}}, + "typeAnnotation": { + "type": "TSStringKeyword", + "start":2928,"end":2934,"loc":{"start":{"line":150,"column":46,"index":2928},"end":{"line":150,"column":52,"index":2934}} + } + } + } + ] + } + } + ] + }, + "body": { + "type": "TSInterfaceBody", + "start":2938,"end":2991,"loc":{"start":{"line":150,"column":56,"index":2938},"end":{"line":152,"column":1,"index":2991}}, + "body": [ + { + "type": "TSPropertySignature", + "start":2944,"end":2989,"loc":{"start":{"line":151,"column":4,"index":2944},"end":{"line":151,"column":49,"index":2989}}, + "key": { + "type": "Identifier", + "start":2944,"end":2948,"loc":{"start":{"line":151,"column":4,"index":2944},"end":{"line":151,"column":8,"index":2948},"identifierName":"exec"}, + "name": "exec" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2948,"end":2988,"loc":{"start":{"line":151,"column":8,"index":2948},"end":{"line":151,"column":48,"index":2988}}, + "typeAnnotation": { + "type": "TSFunctionType", + "start":2950,"end":2988,"loc":{"start":{"line":151,"column":10,"index":2950},"end":{"line":151,"column":48,"index":2988}}, + "parameters": [ + { + "type": "Identifier", + "start":2951,"end":2979,"loc":{"start":{"line":151,"column":11,"index":2951},"end":{"line":151,"column":39,"index":2979},"identifierName":"meta"}, + "name": "meta", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2955,"end":2979,"loc":{"start":{"line":151,"column":15,"index":2955},"end":{"line":151,"column":39,"index":2979}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2957,"end":2979,"loc":{"start":{"line":151,"column":17,"index":2957},"end":{"line":151,"column":39,"index":2979}}, + "typeName": { + "type": "Identifier", + "start":2957,"end":2966,"loc":{"start":{"line":151,"column":17,"index":2957},"end":{"line":151,"column":26,"index":2966},"identifierName":"StateNode"}, + "name": "StateNode" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2966,"end":2979,"loc":{"start":{"line":151,"column":26,"index":2966},"end":{"line":151,"column":39,"index":2979}}, + "params": [ + { + "type": "TSAnyKeyword", + "start":2967,"end":2970,"loc":{"start":{"line":151,"column":27,"index":2967},"end":{"line":151,"column":30,"index":2970}} + }, + { + "type": "TSTypeReference", + "start":2972,"end":2978,"loc":{"start":{"line":151,"column":32,"index":2972},"end":{"line":151,"column":38,"index":2978}}, + "typeName": { + "type": "Identifier", + "start":2972,"end":2978,"loc":{"start":{"line":151,"column":32,"index":2972},"end":{"line":151,"column":38,"index":2978},"identifierName":"TEvent"}, + "name": "TEvent" + } + } + ] + } + } + } + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2981,"end":2988,"loc":{"start":{"line":151,"column":41,"index":2981},"end":{"line":151,"column":48,"index":2988}}, + "typeAnnotation": { + "type": "TSVoidKeyword", + "start":2984,"end":2988,"loc":{"start":{"line":151,"column":44,"index":2984},"end":{"line":151,"column":48,"index":2988}} + } + } + } + } + } + ] + } + }, + { + "type": "TSDeclareFunction", + "start":2993,"end":3108,"loc":{"start":{"line":154,"column":0,"index":2993},"end":{"line":154,"column":115,"index":3108}}, + "declare": true, + "id": { + "type": "Identifier", + "start":3010,"end":3023,"loc":{"start":{"line":154,"column":17,"index":3010},"end":{"line":154,"column":30,"index":3023},"identifierName":"createMachine"}, + "name": "createMachine" + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":3023,"end":3056,"loc":{"start":{"line":154,"column":30,"index":3023},"end":{"line":154,"column":63,"index":3056}}, + "params": [ + { + "type": "TSTypeParameter", + "start":3024,"end":3055,"loc":{"start":{"line":154,"column":31,"index":3024},"end":{"line":154,"column":62,"index":3055}}, + "name": "TEvent", + "constraint": { + "type": "TSTypeLiteral", + "start":3039,"end":3055,"loc":{"start":{"line":154,"column":46,"index":3039},"end":{"line":154,"column":62,"index":3055}}, + "members": [ + { + "type": "TSPropertySignature", + "start":3041,"end":3053,"loc":{"start":{"line":154,"column":48,"index":3041},"end":{"line":154,"column":60,"index":3053}}, + "key": { + "type": "Identifier", + "start":3041,"end":3045,"loc":{"start":{"line":154,"column":48,"index":3041},"end":{"line":154,"column":52,"index":3045},"identifierName":"type"}, + "name": "type" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3045,"end":3053,"loc":{"start":{"line":154,"column":52,"index":3045},"end":{"line":154,"column":60,"index":3053}}, + "typeAnnotation": { + "type": "TSStringKeyword", + "start":3047,"end":3053,"loc":{"start":{"line":154,"column":54,"index":3047},"end":{"line":154,"column":60,"index":3053}} + } + } + } + ] + } + } + ] + }, + "params": [ + { + "type": "Identifier", + "start":3057,"end":3085,"loc":{"start":{"line":154,"column":64,"index":3057},"end":{"line":154,"column":92,"index":3085},"identifierName":"action"}, + "name": "action", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3063,"end":3085,"loc":{"start":{"line":154,"column":70,"index":3063},"end":{"line":154,"column":92,"index":3085}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":3065,"end":3085,"loc":{"start":{"line":154,"column":72,"index":3065},"end":{"line":154,"column":92,"index":3085}}, + "typeName": { + "type": "Identifier", + "start":3065,"end":3077,"loc":{"start":{"line":154,"column":72,"index":3065},"end":{"line":154,"column":84,"index":3077},"identifierName":"ActionObject"}, + "name": "ActionObject" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":3077,"end":3085,"loc":{"start":{"line":154,"column":84,"index":3077},"end":{"line":154,"column":92,"index":3085}}, + "params": [ + { + "type": "TSTypeReference", + "start":3078,"end":3084,"loc":{"start":{"line":154,"column":85,"index":3078},"end":{"line":154,"column":91,"index":3084}}, + "typeName": { + "type": "Identifier", + "start":3078,"end":3084,"loc":{"start":{"line":154,"column":85,"index":3078},"end":{"line":154,"column":91,"index":3084},"identifierName":"TEvent"}, + "name": "TEvent" + } + } + ] + } + } + } + } + ], + "returnType": { + "type": "TSTypeAnnotation", + "start":3086,"end":3107,"loc":{"start":{"line":154,"column":93,"index":3086},"end":{"line":154,"column":114,"index":3107}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":3088,"end":3107,"loc":{"start":{"line":154,"column":95,"index":3088},"end":{"line":154,"column":114,"index":3107}}, + "typeName": { + "type": "Identifier", + "start":3088,"end":3097,"loc":{"start":{"line":154,"column":95,"index":3088},"end":{"line":154,"column":104,"index":3097},"identifierName":"StateNode"}, + "name": "StateNode" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":3097,"end":3107,"loc":{"start":{"line":154,"column":104,"index":3097},"end":{"line":154,"column":114,"index":3107}}, + "params": [ + { + "type": "TSAnyKeyword", + "start":3098,"end":3101,"loc":{"start":{"line":154,"column":105,"index":3098},"end":{"line":154,"column":108,"index":3101}} + }, + { + "type": "TSAnyKeyword", + "start":3103,"end":3106,"loc":{"start":{"line":154,"column":110,"index":3103},"end":{"line":154,"column":113,"index":3106}} + } + ] + } + } + } + }, + { + "type": "TSDeclareFunction", + "start":3110,"end":3188,"loc":{"start":{"line":156,"column":0,"index":3110},"end":{"line":156,"column":78,"index":3188}}, + "declare": true, + "id": { + "type": "Identifier", + "start":3127,"end":3136,"loc":{"start":{"line":156,"column":17,"index":3127},"end":{"line":156,"column":26,"index":3136},"identifierName":"interpret"}, + "name": "interpret" + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":3136,"end":3146,"loc":{"start":{"line":156,"column":26,"index":3136},"end":{"line":156,"column":36,"index":3146}}, + "params": [ + { + "type": "TSTypeParameter", + "start":3137,"end":3145,"loc":{"start":{"line":156,"column":27,"index":3137},"end":{"line":156,"column":35,"index":3145}}, + "name": "TContext" + } + ] + }, + "params": [ + { + "type": "Identifier", + "start":3147,"end":3180,"loc":{"start":{"line":156,"column":37,"index":3147},"end":{"line":156,"column":70,"index":3180},"identifierName":"machine"}, + "name": "machine", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3154,"end":3180,"loc":{"start":{"line":156,"column":44,"index":3154},"end":{"line":156,"column":70,"index":3180}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":3156,"end":3180,"loc":{"start":{"line":156,"column":46,"index":3156},"end":{"line":156,"column":70,"index":3180}}, + "typeName": { + "type": "Identifier", + "start":3156,"end":3165,"loc":{"start":{"line":156,"column":46,"index":3156},"end":{"line":156,"column":55,"index":3165},"identifierName":"StateNode"}, + "name": "StateNode" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":3165,"end":3180,"loc":{"start":{"line":156,"column":55,"index":3165},"end":{"line":156,"column":70,"index":3180}}, + "params": [ + { + "type": "TSTypeReference", + "start":3166,"end":3174,"loc":{"start":{"line":156,"column":56,"index":3166},"end":{"line":156,"column":64,"index":3174}}, + "typeName": { + "type": "Identifier", + "start":3166,"end":3174,"loc":{"start":{"line":156,"column":56,"index":3166},"end":{"line":156,"column":64,"index":3174},"identifierName":"TContext"}, + "name": "TContext" + } + }, + { + "type": "TSAnyKeyword", + "start":3176,"end":3179,"loc":{"start":{"line":156,"column":66,"index":3176},"end":{"line":156,"column":69,"index":3179}} + } + ] + } + } + } + } + ], + "returnType": { + "type": "TSTypeAnnotation", + "start":3181,"end":3187,"loc":{"start":{"line":156,"column":71,"index":3181},"end":{"line":156,"column":77,"index":3187}}, + "typeAnnotation": { + "type": "TSVoidKeyword", + "start":3183,"end":3187,"loc":{"start":{"line":156,"column":73,"index":3183},"end":{"line":156,"column":77,"index":3187}} + } + } + }, + { + "type": "VariableDeclaration", + "start":3190,"end":3231,"loc":{"start":{"line":158,"column":0,"index":3190},"end":{"line":158,"column":41,"index":3231}}, + "declarations": [ + { + "type": "VariableDeclarator", + "start":3196,"end":3230,"loc":{"start":{"line":158,"column":6,"index":3196},"end":{"line":158,"column":40,"index":3230}}, + "id": { + "type": "Identifier", + "start":3196,"end":3203,"loc":{"start":{"line":158,"column":6,"index":3196},"end":{"line":158,"column":13,"index":3203},"identifierName":"machine"}, + "name": "machine" + }, + "init": { + "type": "CallExpression", + "start":3206,"end":3230,"loc":{"start":{"line":158,"column":16,"index":3206},"end":{"line":158,"column":40,"index":3230}}, + "callee": { + "type": "Identifier", + "start":3206,"end":3219,"loc":{"start":{"line":158,"column":16,"index":3206},"end":{"line":158,"column":29,"index":3219},"identifierName":"createMachine"}, + "name": "createMachine" + }, + "arguments": [ + { + "type": "TSAsExpression", + "start":3220,"end":3229,"loc":{"start":{"line":158,"column":30,"index":3220},"end":{"line":158,"column":39,"index":3229}}, + "expression": { + "type": "ObjectExpression", + "start":3220,"end":3222,"loc":{"start":{"line":158,"column":30,"index":3220},"end":{"line":158,"column":32,"index":3222}}, + "properties": [] + }, + "typeAnnotation": { + "type": "TSAnyKeyword", + "start":3226,"end":3229,"loc":{"start":{"line":158,"column":36,"index":3226},"end":{"line":158,"column":39,"index":3229}} + } + } + ] + } + } + ], + "kind": "const" + }, + { + "type": "ExpressionStatement", + "start":3233,"end":3252,"loc":{"start":{"line":160,"column":0,"index":3233},"end":{"line":160,"column":19,"index":3252}}, + "expression": { + "type": "CallExpression", + "start":3233,"end":3251,"loc":{"start":{"line":160,"column":0,"index":3233},"end":{"line":160,"column":18,"index":3251}}, + "callee": { + "type": "Identifier", + "start":3233,"end":3242,"loc":{"start":{"line":160,"column":0,"index":3233},"end":{"line":160,"column":9,"index":3242},"identifierName":"interpret"}, + "name": "interpret" + }, + "arguments": [ + { + "type": "Identifier", + "start":3243,"end":3250,"loc":{"start":{"line":160,"column":10,"index":3243},"end":{"line":160,"column":17,"index":3250},"identifierName":"machine"}, + "name": "machine" + } + ] + } + }, + { + "type": "VariableDeclaration", + "start":3254,"end":3318,"loc":{"start":{"line":162,"column":0,"index":3254},"end":{"line":162,"column":64,"index":3318}}, + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "start":3268,"end":3317,"loc":{"start":{"line":162,"column":14,"index":3268},"end":{"line":162,"column":63,"index":3317}}, + "id": { + "type": "Identifier", + "start":3268,"end":3317,"loc":{"start":{"line":162,"column":14,"index":3268},"end":{"line":162,"column":63,"index":3317},"identifierName":"qq"}, + "name": "qq", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3270,"end":3317,"loc":{"start":{"line":162,"column":16,"index":3270},"end":{"line":162,"column":63,"index":3317}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":3272,"end":3317,"loc":{"start":{"line":162,"column":18,"index":3272},"end":{"line":162,"column":63,"index":3317}}, + "typeName": { + "type": "Identifier", + "start":3272,"end":3284,"loc":{"start":{"line":162,"column":18,"index":3272},"end":{"line":162,"column":30,"index":3284},"identifierName":"ActionObject"}, + "name": "ActionObject" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":3284,"end":3317,"loc":{"start":{"line":162,"column":30,"index":3284},"end":{"line":162,"column":63,"index":3317}}, + "params": [ + { + "type": "TSTypeLiteral", + "start":3285,"end":3316,"loc":{"start":{"line":162,"column":31,"index":3285},"end":{"line":162,"column":62,"index":3316}}, + "members": [ + { + "type": "TSPropertySignature", + "start":3287,"end":3300,"loc":{"start":{"line":162,"column":33,"index":3287},"end":{"line":162,"column":46,"index":3300}}, + "key": { + "type": "Identifier", + "start":3287,"end":3291,"loc":{"start":{"line":162,"column":33,"index":3287},"end":{"line":162,"column":37,"index":3291},"identifierName":"type"}, + "name": "type" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3291,"end":3299,"loc":{"start":{"line":162,"column":37,"index":3291},"end":{"line":162,"column":45,"index":3299}}, + "typeAnnotation": { + "type": "TSLiteralType", + "start":3293,"end":3299,"loc":{"start":{"line":162,"column":39,"index":3293},"end":{"line":162,"column":45,"index":3299}}, + "literal": { + "type": "StringLiteral", + "start":3293,"end":3299,"loc":{"start":{"line":162,"column":39,"index":3293},"end":{"line":162,"column":45,"index":3299}}, + "extra": { + "rawValue": "PLAY", + "raw": "\"PLAY\"" + }, + "value": "PLAY" + } + } + } + }, + { + "type": "TSPropertySignature", + "start":3301,"end":3314,"loc":{"start":{"line":162,"column":47,"index":3301},"end":{"line":162,"column":60,"index":3314}}, + "key": { + "type": "Identifier", + "start":3301,"end":3306,"loc":{"start":{"line":162,"column":47,"index":3301},"end":{"line":162,"column":52,"index":3306},"identifierName":"value"}, + "name": "value" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3306,"end":3314,"loc":{"start":{"line":162,"column":52,"index":3306},"end":{"line":162,"column":60,"index":3314}}, + "typeAnnotation": { + "type": "TSNumberKeyword", + "start":3308,"end":3314,"loc":{"start":{"line":162,"column":54,"index":3308},"end":{"line":162,"column":60,"index":3314}} + } + } + } + ] + } + ] + } + } + } + }, + "init": null + } + ], + "kind": "const" + }, + { + "type": "ExpressionStatement", + "start":3320,"end":3391,"loc":{"start":{"line":164,"column":0,"index":3320},"end":{"line":164,"column":71,"index":3391}}, + "expression": { + "type": "CallExpression", + "start":3320,"end":3390,"loc":{"start":{"line":164,"column":0,"index":3320},"end":{"line":164,"column":70,"index":3390}}, + "callee": { + "type": "Identifier", + "start":3320,"end":3333,"loc":{"start":{"line":164,"column":0,"index":3320},"end":{"line":164,"column":13,"index":3333},"identifierName":"createMachine"}, + "name": "createMachine" + }, + "arguments": [ + { + "type": "Identifier", + "start":3387,"end":3389,"loc":{"start":{"line":164,"column":67,"index":3387},"end":{"line":164,"column":69,"index":3389},"identifierName":"qq"}, + "name": "qq" + } + ], + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":3333,"end":3386,"loc":{"start":{"line":164,"column":13,"index":3333},"end":{"line":164,"column":66,"index":3386}}, + "params": [ + { + "type": "TSUnionType", + "start":3334,"end":3385,"loc":{"start":{"line":164,"column":14,"index":3334},"end":{"line":164,"column":65,"index":3385}}, + "types": [ + { + "type": "TSTypeLiteral", + "start":3334,"end":3365,"loc":{"start":{"line":164,"column":14,"index":3334},"end":{"line":164,"column":45,"index":3365}}, + "members": [ + { + "type": "TSPropertySignature", + "start":3336,"end":3349,"loc":{"start":{"line":164,"column":16,"index":3336},"end":{"line":164,"column":29,"index":3349}}, + "key": { + "type": "Identifier", + "start":3336,"end":3340,"loc":{"start":{"line":164,"column":16,"index":3336},"end":{"line":164,"column":20,"index":3340},"identifierName":"type"}, + "name": "type" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3340,"end":3348,"loc":{"start":{"line":164,"column":20,"index":3340},"end":{"line":164,"column":28,"index":3348}}, + "typeAnnotation": { + "type": "TSLiteralType", + "start":3342,"end":3348,"loc":{"start":{"line":164,"column":22,"index":3342},"end":{"line":164,"column":28,"index":3348}}, + "literal": { + "type": "StringLiteral", + "start":3342,"end":3348,"loc":{"start":{"line":164,"column":22,"index":3342},"end":{"line":164,"column":28,"index":3348}}, + "extra": { + "rawValue": "PLAY", + "raw": "\"PLAY\"" + }, + "value": "PLAY" + } + } + } + }, + { + "type": "TSPropertySignature", + "start":3350,"end":3363,"loc":{"start":{"line":164,"column":30,"index":3350},"end":{"line":164,"column":43,"index":3363}}, + "key": { + "type": "Identifier", + "start":3350,"end":3355,"loc":{"start":{"line":164,"column":30,"index":3350},"end":{"line":164,"column":35,"index":3355},"identifierName":"value"}, + "name": "value" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3355,"end":3363,"loc":{"start":{"line":164,"column":35,"index":3355},"end":{"line":164,"column":43,"index":3363}}, + "typeAnnotation": { + "type": "TSNumberKeyword", + "start":3357,"end":3363,"loc":{"start":{"line":164,"column":37,"index":3357},"end":{"line":164,"column":43,"index":3363}} + } + } + } + ] + }, + { + "type": "TSTypeLiteral", + "start":3368,"end":3385,"loc":{"start":{"line":164,"column":48,"index":3368},"end":{"line":164,"column":65,"index":3385}}, + "members": [ + { + "type": "TSPropertySignature", + "start":3370,"end":3383,"loc":{"start":{"line":164,"column":50,"index":3370},"end":{"line":164,"column":63,"index":3383}}, + "key": { + "type": "Identifier", + "start":3370,"end":3374,"loc":{"start":{"line":164,"column":50,"index":3370},"end":{"line":164,"column":54,"index":3374},"identifierName":"type"}, + "name": "type" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3374,"end":3383,"loc":{"start":{"line":164,"column":54,"index":3374},"end":{"line":164,"column":63,"index":3383}}, + "typeAnnotation": { + "type": "TSLiteralType", + "start":3376,"end":3383,"loc":{"start":{"line":164,"column":56,"index":3376},"end":{"line":164,"column":63,"index":3383}}, + "literal": { + "type": "StringLiteral", + "start":3376,"end":3383,"loc":{"start":{"line":164,"column":56,"index":3376},"end":{"line":164,"column":63,"index":3383}}, + "extra": { + "rawValue": "RESET", + "raw": "\"RESET\"" + }, + "value": "RESET" + } + } + } + } + ] + } + ] + } + ] + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":3393,"end":3401,"loc":{"start":{"line":164,"column":73,"index":3393},"end":{"line":164,"column":81,"index":3401}} + } + ] + } + ], + "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": " FIXME: this should be recoverable error", + "start":1956,"end":1998,"loc":{"start":{"line":106,"column":0,"index":1956},"end":{"line":106,"column":42,"index":1998}} + }, + { + "type": "CommentLine", + "value": " class C {", + "start":1999,"end":2011,"loc":{"start":{"line":107,"column":0,"index":1999},"end":{"line":107,"column":12,"index":2011}} + }, + { + "type": "CommentLine", + "value": " in a = 0; // Error", + "start":2012,"end":2038,"loc":{"start":{"line":108,"column":0,"index":2012},"end":{"line":108,"column":26,"index":2038}} + }, + { + "type": "CommentLine", + "value": " out b = 0; // Error", + "start":2039,"end":2066,"loc":{"start":{"line":109,"column":0,"index":2039},"end":{"line":109,"column":27,"index":2066}} + }, + { + "type": "CommentLine", + "value": " }", + "start":2067,"end":2071,"loc":{"start":{"line":110,"column":0,"index":2067},"end":{"line":110,"column":4,"index":2071}} + }, + { + "type": "CommentLine", + "value": " Interface merging", + "start":2073,"end":2093,"loc":{"start":{"line":112,"column":0,"index":2073},"end":{"line":112,"column":20,"index":2093}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":2221,"end":2229,"loc":{"start":{"line":120,"column":14,"index":2221},"end":{"line":120,"column":22,"index":2229}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":2244,"end":2252,"loc":{"start":{"line":121,"column":14,"index":2244},"end":{"line":121,"column":22,"index":2252}} + }, + { + "type": "CommentLine", + "value": " Repro from #44572", + "start":2254,"end":2274,"loc":{"start":{"line":123,"column":0,"index":2254},"end":{"line":123,"column":20,"index":2274}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":2661,"end":2669,"loc":{"start":{"line":140,"column":39,"index":2661},"end":{"line":140,"column":47,"index":2669}} + }, + { + "type": "CommentLine", + "value": " Repro from comment in #44572", + "start":2671,"end":2702,"loc":{"start":{"line":142,"column":0,"index":2671},"end":{"line":142,"column":31,"index":2702}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":3393,"end":3401,"loc":{"start":{"line":164,"column":73,"index":3393},"end":{"line":164,"column":81,"index":3401}} + } + ] +} diff --git a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations/input.ts b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations/input.ts index d08fc6d65106..ce573862a9e1 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations/input.ts +++ b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations/input.ts @@ -2,10 +2,160 @@ 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; -} \ No newline at end of file +} + +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 + +// FIXME: this should be recoverable 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 From e89330ad1b09baeeb1f1b1545ad5df0660c9c407 Mon Sep 17 00:00:00 2001 From: magic-akari Date: Sun, 3 Apr 2022 18:22:11 +0800 Subject: [PATCH 6/8] fix: more recoverable error --- .../src/plugins/typescript/index.js | 2 + .../variance-annotations-babel-7/input.ts | 9 +- .../variance-annotations-babel-7/output.json | 778 +++++++++--------- .../variance-annotations-with-jsx/input.tsx | 9 +- .../variance-annotations-with-jsx/output.json | 778 +++++++++--------- .../types/variance-annotations/input.ts | 9 +- 6 files changed, 812 insertions(+), 773 deletions(-) diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js index abe257e0b096..dee618a6cb76 100644 --- a/packages/babel-parser/src/plugins/typescript/index.js +++ b/packages/babel-parser/src/plugins/typescript/index.js @@ -2731,7 +2731,9 @@ export default (superClass: Class): Class => this.tsParseModifiers({ modified: member, allowedModifiers: modifiers, + disallowedModifiers: ["in", "out"], stopOnStartOfClassStaticBlock: true, + errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions, }); const callParseClassMemberWithIsStatic = () => { diff --git a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-babel-7/input.ts b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-babel-7/input.ts index ce573862a9e1..cd6e150b5be6 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-babel-7/input.ts +++ b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-babel-7/input.ts @@ -100,11 +100,10 @@ type T23 = T; // Error declare function f1(x: T): void; // Error declare function f2(): T; // Error -// FIXME: this should be recoverable error -// class C { -// in a = 0; // Error -// out b = 0; // Error -// } +class C { + in a = 0; // Error + out b = 0; // Error +} // Interface merging diff --git a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-babel-7/output.json b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-babel-7/output.json index c3ee05465c01..ea1a7adb1f3c 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-babel-7/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-babel-7/output.json @@ -1,6 +1,6 @@ { "type": "File", - "start":0,"end":3366,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":161,"column":81,"index":3366}}, + "start":0,"end":3311,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":160,"column":81,"index":3311}}, "errors": [ "SyntaxError: 'public' modifier cannot appear on a type parameter. (95:9)", "SyntaxError: Duplicate modifier: 'in'. (96:16)", @@ -8,11 +8,13 @@ "SyntaxError: Duplicate modifier: 'out'. (97:16)", "SyntaxError: 'in' modifier must precede 'out' modifier. (98:13)", "SyntaxError: 'in' modifier can only appear on a type parameter of a class, interface or type alias. (100:20)", - "SyntaxError: 'out' modifier can only appear on a type parameter of a class, interface or type alias. (101:20)" + "SyntaxError: 'out' modifier can only appear on a type parameter of a class, interface or type alias. (101:20)", + "SyntaxError: 'in' modifier can only appear on a type parameter of a class, interface or type alias. (104:4)", + "SyntaxError: 'out' modifier can only appear on a type parameter of a class, interface or type alias. (105:4)" ], "program": { "type": "Program", - "start":0,"end":3366,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":161,"column":81,"index":3366}}, + "start":0,"end":3311,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":160,"column":81,"index":3311}}, "sourceType": "module", "interpreter": null, "body": [ @@ -2195,61 +2197,124 @@ "type": "CommentLine", "value": " Error", "start":1911,"end":1919,"loc":{"start":{"line":101,"column":34,"index":1911},"end":{"line":101,"column":42,"index":1919}} - }, - { - "type": "CommentLine", - "value": " FIXME: this should be recoverable error", - "start":1921,"end":1963,"loc":{"start":{"line":103,"column":0,"index":1921},"end":{"line":103,"column":42,"index":1963}} - }, - { - "type": "CommentLine", - "value": " class C {", - "start":1964,"end":1976,"loc":{"start":{"line":104,"column":0,"index":1964},"end":{"line":104,"column":12,"index":1976}} - }, - { - "type": "CommentLine", - "value": " in a = 0; // Error", - "start":1977,"end":2003,"loc":{"start":{"line":105,"column":0,"index":1977},"end":{"line":105,"column":26,"index":2003}} - }, - { - "type": "CommentLine", - "value": " out b = 0; // Error", - "start":2004,"end":2031,"loc":{"start":{"line":106,"column":0,"index":2004},"end":{"line":106,"column":27,"index":2031}} - }, + } + ], + "leadingComments": [ { "type": "CommentLine", - "value": " }", - "start":2032,"end":2036,"loc":{"start":{"line":107,"column":0,"index":2032},"end":{"line":107,"column":4,"index":2036}} - }, + "value": " Error", + "start":1868,"end":1876,"loc":{"start":{"line":100,"column":40,"index":1868},"end":{"line":100,"column":48,"index":1876}} + } + ] + }, + { + "type": "ClassDeclaration", + "start":1921,"end":1981,"loc":{"start":{"line":103,"column":0,"index":1921},"end":{"line":106,"column":1,"index":1981}}, + "id": { + "type": "Identifier", + "start":1927,"end":1928,"loc":{"start":{"line":103,"column":6,"index":1927},"end":{"line":103,"column":7,"index":1928},"identifierName":"C"}, + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start":1929,"end":1981,"loc":{"start":{"line":103,"column":8,"index":1929},"end":{"line":106,"column":1,"index":1981}}, + "body": [ + { + "type": "ClassProperty", + "start":1935,"end":1944,"loc":{"start":{"line":104,"column":4,"index":1935},"end":{"line":104,"column":13,"index":1944}}, + "in": true, + "static": false, + "key": { + "type": "Identifier", + "start":1938,"end":1939,"loc":{"start":{"line":104,"column":7,"index":1938},"end":{"line":104,"column":8,"index":1939},"identifierName":"a"}, + "name": "a" + }, + "computed": false, + "value": { + "type": "NumericLiteral", + "start":1942,"end":1943,"loc":{"start":{"line":104,"column":11,"index":1942},"end":{"line":104,"column":12,"index":1943}}, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1946,"end":1954,"loc":{"start":{"line":104,"column":15,"index":1946},"end":{"line":104,"column":23,"index":1954}} + } + ] + }, + { + "type": "ClassProperty", + "start":1959,"end":1969,"loc":{"start":{"line":105,"column":4,"index":1959},"end":{"line":105,"column":14,"index":1969}}, + "out": true, + "static": false, + "key": { + "type": "Identifier", + "start":1963,"end":1964,"loc":{"start":{"line":105,"column":8,"index":1963},"end":{"line":105,"column":9,"index":1964},"identifierName":"b"}, + "name": "b" + }, + "computed": false, + "value": { + "type": "NumericLiteral", + "start":1967,"end":1968,"loc":{"start":{"line":105,"column":12,"index":1967},"end":{"line":105,"column":13,"index":1968}}, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1971,"end":1979,"loc":{"start":{"line":105,"column":16,"index":1971},"end":{"line":105,"column":24,"index":1979}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1946,"end":1954,"loc":{"start":{"line":104,"column":15,"index":1946},"end":{"line":104,"column":23,"index":1954}} + } + ] + } + ] + }, + "trailingComments": [ { "type": "CommentLine", "value": " Interface merging", - "start":2038,"end":2058,"loc":{"start":{"line":109,"column":0,"index":2038},"end":{"line":109,"column":20,"index":2058}} + "start":1983,"end":2003,"loc":{"start":{"line":108,"column":0,"index":1983},"end":{"line":108,"column":20,"index":2003}} } ], "leadingComments": [ { "type": "CommentLine", "value": " Error", - "start":1868,"end":1876,"loc":{"start":{"line":100,"column":40,"index":1868},"end":{"line":100,"column":48,"index":1876}} + "start":1911,"end":1919,"loc":{"start":{"line":101,"column":34,"index":1911},"end":{"line":101,"column":42,"index":1919}} } ] }, { "type": "TSInterfaceDeclaration", - "start":2060,"end":2083,"loc":{"start":{"line":111,"column":0,"index":2060},"end":{"line":111,"column":23,"index":2083}}, + "start":2005,"end":2028,"loc":{"start":{"line":110,"column":0,"index":2005},"end":{"line":110,"column":23,"index":2028}}, "id": { "type": "Identifier", - "start":2070,"end":2073,"loc":{"start":{"line":111,"column":10,"index":2070},"end":{"line":111,"column":13,"index":2073},"identifierName":"Baz"}, + "start":2015,"end":2018,"loc":{"start":{"line":110,"column":10,"index":2015},"end":{"line":110,"column":13,"index":2018},"identifierName":"Baz"}, "name": "Baz" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":2073,"end":2080,"loc":{"start":{"line":111,"column":13,"index":2073},"end":{"line":111,"column":20,"index":2080}}, + "start":2018,"end":2025,"loc":{"start":{"line":110,"column":13,"index":2018},"end":{"line":110,"column":20,"index":2025}}, "params": [ { "type": "TSTypeParameter", - "start":2074,"end":2079,"loc":{"start":{"line":111,"column":14,"index":2074},"end":{"line":111,"column":19,"index":2079}}, + "start":2019,"end":2024,"loc":{"start":{"line":110,"column":14,"index":2019},"end":{"line":110,"column":19,"index":2024}}, "out": true, "name": "T" } @@ -2257,62 +2322,32 @@ }, "body": { "type": "TSInterfaceBody", - "start":2081,"end":2083,"loc":{"start":{"line":111,"column":21,"index":2081},"end":{"line":111,"column":23,"index":2083}}, + "start":2026,"end":2028,"loc":{"start":{"line":110,"column":21,"index":2026},"end":{"line":110,"column":23,"index":2028}}, "body": [] }, "leadingComments": [ - { - "type": "CommentLine", - "value": " Error", - "start":1911,"end":1919,"loc":{"start":{"line":101,"column":34,"index":1911},"end":{"line":101,"column":42,"index":1919}} - }, - { - "type": "CommentLine", - "value": " FIXME: this should be recoverable error", - "start":1921,"end":1963,"loc":{"start":{"line":103,"column":0,"index":1921},"end":{"line":103,"column":42,"index":1963}} - }, - { - "type": "CommentLine", - "value": " class C {", - "start":1964,"end":1976,"loc":{"start":{"line":104,"column":0,"index":1964},"end":{"line":104,"column":12,"index":1976}} - }, - { - "type": "CommentLine", - "value": " in a = 0; // Error", - "start":1977,"end":2003,"loc":{"start":{"line":105,"column":0,"index":1977},"end":{"line":105,"column":26,"index":2003}} - }, - { - "type": "CommentLine", - "value": " out b = 0; // Error", - "start":2004,"end":2031,"loc":{"start":{"line":106,"column":0,"index":2004},"end":{"line":106,"column":27,"index":2031}} - }, - { - "type": "CommentLine", - "value": " }", - "start":2032,"end":2036,"loc":{"start":{"line":107,"column":0,"index":2032},"end":{"line":107,"column":4,"index":2036}} - }, { "type": "CommentLine", "value": " Interface merging", - "start":2038,"end":2058,"loc":{"start":{"line":109,"column":0,"index":2038},"end":{"line":109,"column":20,"index":2058}} + "start":1983,"end":2003,"loc":{"start":{"line":108,"column":0,"index":1983},"end":{"line":108,"column":20,"index":2003}} } ] }, { "type": "TSInterfaceDeclaration", - "start":2084,"end":2106,"loc":{"start":{"line":112,"column":0,"index":2084},"end":{"line":112,"column":22,"index":2106}}, + "start":2029,"end":2051,"loc":{"start":{"line":111,"column":0,"index":2029},"end":{"line":111,"column":22,"index":2051}}, "id": { "type": "Identifier", - "start":2094,"end":2097,"loc":{"start":{"line":112,"column":10,"index":2094},"end":{"line":112,"column":13,"index":2097},"identifierName":"Baz"}, + "start":2039,"end":2042,"loc":{"start":{"line":111,"column":10,"index":2039},"end":{"line":111,"column":13,"index":2042},"identifierName":"Baz"}, "name": "Baz" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":2097,"end":2103,"loc":{"start":{"line":112,"column":13,"index":2097},"end":{"line":112,"column":19,"index":2103}}, + "start":2042,"end":2048,"loc":{"start":{"line":111,"column":13,"index":2042},"end":{"line":111,"column":19,"index":2048}}, "params": [ { "type": "TSTypeParameter", - "start":2098,"end":2102,"loc":{"start":{"line":112,"column":14,"index":2098},"end":{"line":112,"column":18,"index":2102}}, + "start":2043,"end":2047,"loc":{"start":{"line":111,"column":14,"index":2043},"end":{"line":111,"column":18,"index":2047}}, "in": true, "name": "T" } @@ -2320,40 +2355,40 @@ }, "body": { "type": "TSInterfaceBody", - "start":2104,"end":2106,"loc":{"start":{"line":112,"column":20,"index":2104},"end":{"line":112,"column":22,"index":2106}}, + "start":2049,"end":2051,"loc":{"start":{"line":111,"column":20,"index":2049},"end":{"line":111,"column":22,"index":2051}}, "body": [] } }, { "type": "VariableDeclaration", - "start":2108,"end":2139,"loc":{"start":{"line":114,"column":0,"index":2108},"end":{"line":114,"column":31,"index":2139}}, + "start":2053,"end":2084,"loc":{"start":{"line":113,"column":0,"index":2053},"end":{"line":113,"column":31,"index":2084}}, "declare": true, "declarations": [ { "type": "VariableDeclarator", - "start":2120,"end":2138,"loc":{"start":{"line":114,"column":12,"index":2120},"end":{"line":114,"column":30,"index":2138}}, + "start":2065,"end":2083,"loc":{"start":{"line":113,"column":12,"index":2065},"end":{"line":113,"column":30,"index":2083}}, "id": { "type": "Identifier", - "start":2120,"end":2138,"loc":{"start":{"line":114,"column":12,"index":2120},"end":{"line":114,"column":30,"index":2138},"identifierName":"baz1"}, + "start":2065,"end":2083,"loc":{"start":{"line":113,"column":12,"index":2065},"end":{"line":113,"column":30,"index":2083},"identifierName":"baz1"}, "name": "baz1", "typeAnnotation": { "type": "TSTypeAnnotation", - "start":2124,"end":2138,"loc":{"start":{"line":114,"column":16,"index":2124},"end":{"line":114,"column":30,"index":2138}}, + "start":2069,"end":2083,"loc":{"start":{"line":113,"column":16,"index":2069},"end":{"line":113,"column":30,"index":2083}}, "typeAnnotation": { "type": "TSTypeReference", - "start":2126,"end":2138,"loc":{"start":{"line":114,"column":18,"index":2126},"end":{"line":114,"column":30,"index":2138}}, + "start":2071,"end":2083,"loc":{"start":{"line":113,"column":18,"index":2071},"end":{"line":113,"column":30,"index":2083}}, "typeName": { "type": "Identifier", - "start":2126,"end":2129,"loc":{"start":{"line":114,"column":18,"index":2126},"end":{"line":114,"column":21,"index":2129},"identifierName":"Baz"}, + "start":2071,"end":2074,"loc":{"start":{"line":113,"column":18,"index":2071},"end":{"line":113,"column":21,"index":2074},"identifierName":"Baz"}, "name": "Baz" }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start":2129,"end":2138,"loc":{"start":{"line":114,"column":21,"index":2129},"end":{"line":114,"column":30,"index":2138}}, + "start":2074,"end":2083,"loc":{"start":{"line":113,"column":21,"index":2074},"end":{"line":113,"column":30,"index":2083}}, "params": [ { "type": "TSUnknownKeyword", - "start":2130,"end":2137,"loc":{"start":{"line":114,"column":22,"index":2130},"end":{"line":114,"column":29,"index":2137}} + "start":2075,"end":2082,"loc":{"start":{"line":113,"column":22,"index":2075},"end":{"line":113,"column":29,"index":2082}} } ] } @@ -2367,34 +2402,34 @@ }, { "type": "VariableDeclaration", - "start":2140,"end":2170,"loc":{"start":{"line":115,"column":0,"index":2140},"end":{"line":115,"column":30,"index":2170}}, + "start":2085,"end":2115,"loc":{"start":{"line":114,"column":0,"index":2085},"end":{"line":114,"column":30,"index":2115}}, "declare": true, "declarations": [ { "type": "VariableDeclarator", - "start":2152,"end":2169,"loc":{"start":{"line":115,"column":12,"index":2152},"end":{"line":115,"column":29,"index":2169}}, + "start":2097,"end":2114,"loc":{"start":{"line":114,"column":12,"index":2097},"end":{"line":114,"column":29,"index":2114}}, "id": { "type": "Identifier", - "start":2152,"end":2169,"loc":{"start":{"line":115,"column":12,"index":2152},"end":{"line":115,"column":29,"index":2169},"identifierName":"baz2"}, + "start":2097,"end":2114,"loc":{"start":{"line":114,"column":12,"index":2097},"end":{"line":114,"column":29,"index":2114},"identifierName":"baz2"}, "name": "baz2", "typeAnnotation": { "type": "TSTypeAnnotation", - "start":2156,"end":2169,"loc":{"start":{"line":115,"column":16,"index":2156},"end":{"line":115,"column":29,"index":2169}}, + "start":2101,"end":2114,"loc":{"start":{"line":114,"column":16,"index":2101},"end":{"line":114,"column":29,"index":2114}}, "typeAnnotation": { "type": "TSTypeReference", - "start":2158,"end":2169,"loc":{"start":{"line":115,"column":18,"index":2158},"end":{"line":115,"column":29,"index":2169}}, + "start":2103,"end":2114,"loc":{"start":{"line":114,"column":18,"index":2103},"end":{"line":114,"column":29,"index":2114}}, "typeName": { "type": "Identifier", - "start":2158,"end":2161,"loc":{"start":{"line":115,"column":18,"index":2158},"end":{"line":115,"column":21,"index":2161},"identifierName":"Baz"}, + "start":2103,"end":2106,"loc":{"start":{"line":114,"column":18,"index":2103},"end":{"line":114,"column":21,"index":2106},"identifierName":"Baz"}, "name": "Baz" }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start":2161,"end":2169,"loc":{"start":{"line":115,"column":21,"index":2161},"end":{"line":115,"column":29,"index":2169}}, + "start":2106,"end":2114,"loc":{"start":{"line":114,"column":21,"index":2106},"end":{"line":114,"column":29,"index":2114}}, "params": [ { "type": "TSStringKeyword", - "start":2162,"end":2168,"loc":{"start":{"line":115,"column":22,"index":2162},"end":{"line":115,"column":28,"index":2168}} + "start":2107,"end":2113,"loc":{"start":{"line":114,"column":22,"index":2107},"end":{"line":114,"column":28,"index":2113}} } ] } @@ -2408,19 +2443,19 @@ }, { "type": "ExpressionStatement", - "start":2172,"end":2184,"loc":{"start":{"line":117,"column":0,"index":2172},"end":{"line":117,"column":12,"index":2184}}, + "start":2117,"end":2129,"loc":{"start":{"line":116,"column":0,"index":2117},"end":{"line":116,"column":12,"index":2129}}, "expression": { "type": "AssignmentExpression", - "start":2172,"end":2183,"loc":{"start":{"line":117,"column":0,"index":2172},"end":{"line":117,"column":11,"index":2183}}, + "start":2117,"end":2128,"loc":{"start":{"line":116,"column":0,"index":2117},"end":{"line":116,"column":11,"index":2128}}, "operator": "=", "left": { "type": "Identifier", - "start":2172,"end":2176,"loc":{"start":{"line":117,"column":0,"index":2172},"end":{"line":117,"column":4,"index":2176},"identifierName":"baz1"}, + "start":2117,"end":2121,"loc":{"start":{"line":116,"column":0,"index":2117},"end":{"line":116,"column":4,"index":2121},"identifierName":"baz1"}, "name": "baz1" }, "right": { "type": "Identifier", - "start":2179,"end":2183,"loc":{"start":{"line":117,"column":7,"index":2179},"end":{"line":117,"column":11,"index":2183},"identifierName":"baz2"}, + "start":2124,"end":2128,"loc":{"start":{"line":116,"column":7,"index":2124},"end":{"line":116,"column":11,"index":2128},"identifierName":"baz2"}, "name": "baz2" } }, @@ -2428,25 +2463,25 @@ { "type": "CommentLine", "value": " Error", - "start":2186,"end":2194,"loc":{"start":{"line":117,"column":14,"index":2186},"end":{"line":117,"column":22,"index":2194}} + "start":2131,"end":2139,"loc":{"start":{"line":116,"column":14,"index":2131},"end":{"line":116,"column":22,"index":2139}} } ] }, { "type": "ExpressionStatement", - "start":2195,"end":2207,"loc":{"start":{"line":118,"column":0,"index":2195},"end":{"line":118,"column":12,"index":2207}}, + "start":2140,"end":2152,"loc":{"start":{"line":117,"column":0,"index":2140},"end":{"line":117,"column":12,"index":2152}}, "expression": { "type": "AssignmentExpression", - "start":2195,"end":2206,"loc":{"start":{"line":118,"column":0,"index":2195},"end":{"line":118,"column":11,"index":2206}}, + "start":2140,"end":2151,"loc":{"start":{"line":117,"column":0,"index":2140},"end":{"line":117,"column":11,"index":2151}}, "operator": "=", "left": { "type": "Identifier", - "start":2195,"end":2199,"loc":{"start":{"line":118,"column":0,"index":2195},"end":{"line":118,"column":4,"index":2199},"identifierName":"baz2"}, + "start":2140,"end":2144,"loc":{"start":{"line":117,"column":0,"index":2140},"end":{"line":117,"column":4,"index":2144},"identifierName":"baz2"}, "name": "baz2" }, "right": { "type": "Identifier", - "start":2202,"end":2206,"loc":{"start":{"line":118,"column":7,"index":2202},"end":{"line":118,"column":11,"index":2206},"identifierName":"baz1"}, + "start":2147,"end":2151,"loc":{"start":{"line":117,"column":7,"index":2147},"end":{"line":117,"column":11,"index":2151},"identifierName":"baz1"}, "name": "baz1" } }, @@ -2454,37 +2489,37 @@ { "type": "CommentLine", "value": " Error", - "start":2209,"end":2217,"loc":{"start":{"line":118,"column":14,"index":2209},"end":{"line":118,"column":22,"index":2217}} + "start":2154,"end":2162,"loc":{"start":{"line":117,"column":14,"index":2154},"end":{"line":117,"column":22,"index":2162}} }, { "type": "CommentLine", "value": " Repro from #44572", - "start":2219,"end":2239,"loc":{"start":{"line":120,"column":0,"index":2219},"end":{"line":120,"column":20,"index":2239}} + "start":2164,"end":2184,"loc":{"start":{"line":119,"column":0,"index":2164},"end":{"line":119,"column":20,"index":2184}} } ], "leadingComments": [ { "type": "CommentLine", "value": " Error", - "start":2186,"end":2194,"loc":{"start":{"line":117,"column":14,"index":2186},"end":{"line":117,"column":22,"index":2194}} + "start":2131,"end":2139,"loc":{"start":{"line":116,"column":14,"index":2131},"end":{"line":116,"column":22,"index":2139}} } ] }, { "type": "TSInterfaceDeclaration", - "start":2241,"end":2326,"loc":{"start":{"line":122,"column":0,"index":2241},"end":{"line":125,"column":1,"index":2326}}, + "start":2186,"end":2271,"loc":{"start":{"line":121,"column":0,"index":2186},"end":{"line":124,"column":1,"index":2271}}, "id": { "type": "Identifier", - "start":2251,"end":2257,"loc":{"start":{"line":122,"column":10,"index":2251},"end":{"line":122,"column":16,"index":2257},"identifierName":"Parent"}, + "start":2196,"end":2202,"loc":{"start":{"line":121,"column":10,"index":2196},"end":{"line":121,"column":16,"index":2202},"identifierName":"Parent"}, "name": "Parent" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":2257,"end":2264,"loc":{"start":{"line":122,"column":16,"index":2257},"end":{"line":122,"column":23,"index":2264}}, + "start":2202,"end":2209,"loc":{"start":{"line":121,"column":16,"index":2202},"end":{"line":121,"column":23,"index":2209}}, "params": [ { "type": "TSTypeParameter", - "start":2258,"end":2263,"loc":{"start":{"line":122,"column":17,"index":2258},"end":{"line":122,"column":22,"index":2263}}, + "start":2203,"end":2208,"loc":{"start":{"line":121,"column":17,"index":2203},"end":{"line":121,"column":22,"index":2208}}, "out": true, "name": "A" } @@ -2492,42 +2527,42 @@ }, "body": { "type": "TSInterfaceBody", - "start":2265,"end":2326,"loc":{"start":{"line":122,"column":24,"index":2265},"end":{"line":125,"column":1,"index":2326}}, + "start":2210,"end":2271,"loc":{"start":{"line":121,"column":24,"index":2210},"end":{"line":124,"column":1,"index":2271}}, "body": [ { "type": "TSPropertySignature", - "start":2271,"end":2294,"loc":{"start":{"line":123,"column":4,"index":2271},"end":{"line":123,"column":27,"index":2294}}, + "start":2216,"end":2239,"loc":{"start":{"line":122,"column":4,"index":2216},"end":{"line":122,"column":27,"index":2239}}, "key": { "type": "Identifier", - "start":2271,"end":2276,"loc":{"start":{"line":123,"column":4,"index":2271},"end":{"line":123,"column":9,"index":2276},"identifierName":"child"}, + "start":2216,"end":2221,"loc":{"start":{"line":122,"column":4,"index":2216},"end":{"line":122,"column":9,"index":2221},"identifierName":"child"}, "name": "child" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start":2276,"end":2293,"loc":{"start":{"line":123,"column":9,"index":2276},"end":{"line":123,"column":26,"index":2293}}, + "start":2221,"end":2238,"loc":{"start":{"line":122,"column":9,"index":2221},"end":{"line":122,"column":26,"index":2238}}, "typeAnnotation": { "type": "TSUnionType", - "start":2278,"end":2293,"loc":{"start":{"line":123,"column":11,"index":2278},"end":{"line":123,"column":26,"index":2293}}, + "start":2223,"end":2238,"loc":{"start":{"line":122,"column":11,"index":2223},"end":{"line":122,"column":26,"index":2238}}, "types": [ { "type": "TSTypeReference", - "start":2278,"end":2286,"loc":{"start":{"line":123,"column":11,"index":2278},"end":{"line":123,"column":19,"index":2286}}, + "start":2223,"end":2231,"loc":{"start":{"line":122,"column":11,"index":2223},"end":{"line":122,"column":19,"index":2231}}, "typeName": { "type": "Identifier", - "start":2278,"end":2283,"loc":{"start":{"line":123,"column":11,"index":2278},"end":{"line":123,"column":16,"index":2283},"identifierName":"Child"}, + "start":2223,"end":2228,"loc":{"start":{"line":122,"column":11,"index":2223},"end":{"line":122,"column":16,"index":2228},"identifierName":"Child"}, "name": "Child" }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start":2283,"end":2286,"loc":{"start":{"line":123,"column":16,"index":2283},"end":{"line":123,"column":19,"index":2286}}, + "start":2228,"end":2231,"loc":{"start":{"line":122,"column":16,"index":2228},"end":{"line":122,"column":19,"index":2231}}, "params": [ { "type": "TSTypeReference", - "start":2284,"end":2285,"loc":{"start":{"line":123,"column":17,"index":2284},"end":{"line":123,"column":18,"index":2285}}, + "start":2229,"end":2230,"loc":{"start":{"line":122,"column":17,"index":2229},"end":{"line":122,"column":18,"index":2230}}, "typeName": { "type": "Identifier", - "start":2284,"end":2285,"loc":{"start":{"line":123,"column":17,"index":2284},"end":{"line":123,"column":18,"index":2285},"identifierName":"A"}, + "start":2229,"end":2230,"loc":{"start":{"line":122,"column":17,"index":2229},"end":{"line":122,"column":18,"index":2230},"identifierName":"A"}, "name": "A" } } @@ -2536,7 +2571,7 @@ }, { "type": "TSNullKeyword", - "start":2289,"end":2293,"loc":{"start":{"line":123,"column":22,"index":2289},"end":{"line":123,"column":26,"index":2293}} + "start":2234,"end":2238,"loc":{"start":{"line":122,"column":22,"index":2234},"end":{"line":122,"column":26,"index":2238}} } ] } @@ -2544,38 +2579,38 @@ }, { "type": "TSPropertySignature", - "start":2299,"end":2324,"loc":{"start":{"line":124,"column":4,"index":2299},"end":{"line":124,"column":29,"index":2324}}, + "start":2244,"end":2269,"loc":{"start":{"line":123,"column":4,"index":2244},"end":{"line":123,"column":29,"index":2269}}, "key": { "type": "Identifier", - "start":2299,"end":2305,"loc":{"start":{"line":124,"column":4,"index":2299},"end":{"line":124,"column":10,"index":2305},"identifierName":"parent"}, + "start":2244,"end":2250,"loc":{"start":{"line":123,"column":4,"index":2244},"end":{"line":123,"column":10,"index":2250},"identifierName":"parent"}, "name": "parent" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start":2305,"end":2323,"loc":{"start":{"line":124,"column":10,"index":2305},"end":{"line":124,"column":28,"index":2323}}, + "start":2250,"end":2268,"loc":{"start":{"line":123,"column":10,"index":2250},"end":{"line":123,"column":28,"index":2268}}, "typeAnnotation": { "type": "TSUnionType", - "start":2307,"end":2323,"loc":{"start":{"line":124,"column":12,"index":2307},"end":{"line":124,"column":28,"index":2323}}, + "start":2252,"end":2268,"loc":{"start":{"line":123,"column":12,"index":2252},"end":{"line":123,"column":28,"index":2268}}, "types": [ { "type": "TSTypeReference", - "start":2307,"end":2316,"loc":{"start":{"line":124,"column":12,"index":2307},"end":{"line":124,"column":21,"index":2316}}, + "start":2252,"end":2261,"loc":{"start":{"line":123,"column":12,"index":2252},"end":{"line":123,"column":21,"index":2261}}, "typeName": { "type": "Identifier", - "start":2307,"end":2313,"loc":{"start":{"line":124,"column":12,"index":2307},"end":{"line":124,"column":18,"index":2313},"identifierName":"Parent"}, + "start":2252,"end":2258,"loc":{"start":{"line":123,"column":12,"index":2252},"end":{"line":123,"column":18,"index":2258},"identifierName":"Parent"}, "name": "Parent" }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start":2313,"end":2316,"loc":{"start":{"line":124,"column":18,"index":2313},"end":{"line":124,"column":21,"index":2316}}, + "start":2258,"end":2261,"loc":{"start":{"line":123,"column":18,"index":2258},"end":{"line":123,"column":21,"index":2261}}, "params": [ { "type": "TSTypeReference", - "start":2314,"end":2315,"loc":{"start":{"line":124,"column":19,"index":2314},"end":{"line":124,"column":20,"index":2315}}, + "start":2259,"end":2260,"loc":{"start":{"line":123,"column":19,"index":2259},"end":{"line":123,"column":20,"index":2260}}, "typeName": { "type": "Identifier", - "start":2314,"end":2315,"loc":{"start":{"line":124,"column":19,"index":2314},"end":{"line":124,"column":20,"index":2315},"identifierName":"A"}, + "start":2259,"end":2260,"loc":{"start":{"line":123,"column":19,"index":2259},"end":{"line":123,"column":20,"index":2260},"identifierName":"A"}, "name": "A" } } @@ -2584,7 +2619,7 @@ }, { "type": "TSNullKeyword", - "start":2319,"end":2323,"loc":{"start":{"line":124,"column":24,"index":2319},"end":{"line":124,"column":28,"index":2323}} + "start":2264,"end":2268,"loc":{"start":{"line":123,"column":24,"index":2264},"end":{"line":123,"column":28,"index":2268}} } ] } @@ -2596,39 +2631,39 @@ { "type": "CommentLine", "value": " Error", - "start":2209,"end":2217,"loc":{"start":{"line":118,"column":14,"index":2209},"end":{"line":118,"column":22,"index":2217}} + "start":2154,"end":2162,"loc":{"start":{"line":117,"column":14,"index":2154},"end":{"line":117,"column":22,"index":2162}} }, { "type": "CommentLine", "value": " Repro from #44572", - "start":2219,"end":2239,"loc":{"start":{"line":120,"column":0,"index":2219},"end":{"line":120,"column":20,"index":2239}} + "start":2164,"end":2184,"loc":{"start":{"line":119,"column":0,"index":2164},"end":{"line":119,"column":20,"index":2184}} } ] }, { "type": "TSInterfaceDeclaration", - "start":2328,"end":2419,"loc":{"start":{"line":127,"column":0,"index":2328},"end":{"line":130,"column":1,"index":2419}}, + "start":2273,"end":2364,"loc":{"start":{"line":126,"column":0,"index":2273},"end":{"line":129,"column":1,"index":2364}}, "id": { "type": "Identifier", - "start":2338,"end":2343,"loc":{"start":{"line":127,"column":10,"index":2338},"end":{"line":127,"column":15,"index":2343},"identifierName":"Child"}, + "start":2283,"end":2288,"loc":{"start":{"line":126,"column":10,"index":2283},"end":{"line":126,"column":15,"index":2288},"identifierName":"Child"}, "name": "Child" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":2343,"end":2359,"loc":{"start":{"line":127,"column":15,"index":2343},"end":{"line":127,"column":31,"index":2359}}, + "start":2288,"end":2304,"loc":{"start":{"line":126,"column":15,"index":2288},"end":{"line":126,"column":31,"index":2304}}, "params": [ { "type": "TSTypeParameter", - "start":2344,"end":2345,"loc":{"start":{"line":127,"column":16,"index":2344},"end":{"line":127,"column":17,"index":2345}}, + "start":2289,"end":2290,"loc":{"start":{"line":126,"column":16,"index":2289},"end":{"line":126,"column":17,"index":2290}}, "name": "A" }, { "type": "TSTypeParameter", - "start":2347,"end":2358,"loc":{"start":{"line":127,"column":19,"index":2347},"end":{"line":127,"column":30,"index":2358}}, + "start":2292,"end":2303,"loc":{"start":{"line":126,"column":19,"index":2292},"end":{"line":126,"column":30,"index":2303}}, "name": "B", "default": { "type": "TSUnknownKeyword", - "start":2351,"end":2358,"loc":{"start":{"line":127,"column":23,"index":2351},"end":{"line":127,"column":30,"index":2358}} + "start":2296,"end":2303,"loc":{"start":{"line":126,"column":23,"index":2296},"end":{"line":126,"column":30,"index":2303}} } } ] @@ -2636,22 +2671,22 @@ "extends": [ { "type": "TSExpressionWithTypeArguments", - "start":2368,"end":2377,"loc":{"start":{"line":127,"column":40,"index":2368},"end":{"line":127,"column":49,"index":2377}}, + "start":2313,"end":2322,"loc":{"start":{"line":126,"column":40,"index":2313},"end":{"line":126,"column":49,"index":2322}}, "expression": { "type": "Identifier", - "start":2368,"end":2374,"loc":{"start":{"line":127,"column":40,"index":2368},"end":{"line":127,"column":46,"index":2374},"identifierName":"Parent"}, + "start":2313,"end":2319,"loc":{"start":{"line":126,"column":40,"index":2313},"end":{"line":126,"column":46,"index":2319},"identifierName":"Parent"}, "name": "Parent" }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start":2374,"end":2377,"loc":{"start":{"line":127,"column":46,"index":2374},"end":{"line":127,"column":49,"index":2377}}, + "start":2319,"end":2322,"loc":{"start":{"line":126,"column":46,"index":2319},"end":{"line":126,"column":49,"index":2322}}, "params": [ { "type": "TSTypeReference", - "start":2375,"end":2376,"loc":{"start":{"line":127,"column":47,"index":2375},"end":{"line":127,"column":48,"index":2376}}, + "start":2320,"end":2321,"loc":{"start":{"line":126,"column":47,"index":2320},"end":{"line":126,"column":48,"index":2321}}, "typeName": { "type": "Identifier", - "start":2375,"end":2376,"loc":{"start":{"line":127,"column":47,"index":2375},"end":{"line":127,"column":48,"index":2376},"identifierName":"A"}, + "start":2320,"end":2321,"loc":{"start":{"line":126,"column":47,"index":2320},"end":{"line":126,"column":48,"index":2321},"identifierName":"A"}, "name": "A" } } @@ -2661,27 +2696,27 @@ ], "body": { "type": "TSInterfaceBody", - "start":2378,"end":2419,"loc":{"start":{"line":127,"column":50,"index":2378},"end":{"line":130,"column":1,"index":2419}}, + "start":2323,"end":2364,"loc":{"start":{"line":126,"column":50,"index":2323},"end":{"line":129,"column":1,"index":2364}}, "body": [ { "type": "TSPropertySignature", - "start":2384,"end":2398,"loc":{"start":{"line":128,"column":4,"index":2384},"end":{"line":128,"column":18,"index":2398}}, + "start":2329,"end":2343,"loc":{"start":{"line":127,"column":4,"index":2329},"end":{"line":127,"column":18,"index":2343}}, "readonly": true, "key": { "type": "Identifier", - "start":2393,"end":2394,"loc":{"start":{"line":128,"column":13,"index":2393},"end":{"line":128,"column":14,"index":2394},"identifierName":"a"}, + "start":2338,"end":2339,"loc":{"start":{"line":127,"column":13,"index":2338},"end":{"line":127,"column":14,"index":2339},"identifierName":"a"}, "name": "a" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start":2394,"end":2397,"loc":{"start":{"line":128,"column":14,"index":2394},"end":{"line":128,"column":17,"index":2397}}, + "start":2339,"end":2342,"loc":{"start":{"line":127,"column":14,"index":2339},"end":{"line":127,"column":17,"index":2342}}, "typeAnnotation": { "type": "TSTypeReference", - "start":2396,"end":2397,"loc":{"start":{"line":128,"column":16,"index":2396},"end":{"line":128,"column":17,"index":2397}}, + "start":2341,"end":2342,"loc":{"start":{"line":127,"column":16,"index":2341},"end":{"line":127,"column":17,"index":2342}}, "typeName": { "type": "Identifier", - "start":2396,"end":2397,"loc":{"start":{"line":128,"column":16,"index":2396},"end":{"line":128,"column":17,"index":2397},"identifierName":"A"}, + "start":2341,"end":2342,"loc":{"start":{"line":127,"column":16,"index":2341},"end":{"line":127,"column":17,"index":2342},"identifierName":"A"}, "name": "A" } } @@ -2689,23 +2724,23 @@ }, { "type": "TSPropertySignature", - "start":2403,"end":2417,"loc":{"start":{"line":129,"column":4,"index":2403},"end":{"line":129,"column":18,"index":2417}}, + "start":2348,"end":2362,"loc":{"start":{"line":128,"column":4,"index":2348},"end":{"line":128,"column":18,"index":2362}}, "readonly": true, "key": { "type": "Identifier", - "start":2412,"end":2413,"loc":{"start":{"line":129,"column":13,"index":2412},"end":{"line":129,"column":14,"index":2413},"identifierName":"b"}, + "start":2357,"end":2358,"loc":{"start":{"line":128,"column":13,"index":2357},"end":{"line":128,"column":14,"index":2358},"identifierName":"b"}, "name": "b" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start":2413,"end":2416,"loc":{"start":{"line":129,"column":14,"index":2413},"end":{"line":129,"column":17,"index":2416}}, + "start":2358,"end":2361,"loc":{"start":{"line":128,"column":14,"index":2358},"end":{"line":128,"column":17,"index":2361}}, "typeAnnotation": { "type": "TSTypeReference", - "start":2415,"end":2416,"loc":{"start":{"line":129,"column":16,"index":2415},"end":{"line":129,"column":17,"index":2416}}, + "start":2360,"end":2361,"loc":{"start":{"line":128,"column":16,"index":2360},"end":{"line":128,"column":17,"index":2361}}, "typeName": { "type": "Identifier", - "start":2415,"end":2416,"loc":{"start":{"line":129,"column":16,"index":2415},"end":{"line":129,"column":17,"index":2416},"identifierName":"B"}, + "start":2360,"end":2361,"loc":{"start":{"line":128,"column":16,"index":2360},"end":{"line":128,"column":17,"index":2361},"identifierName":"B"}, "name": "B" } } @@ -2716,21 +2751,21 @@ }, { "type": "FunctionDeclaration", - "start":2421,"end":2489,"loc":{"start":{"line":132,"column":0,"index":2421},"end":{"line":134,"column":1,"index":2489}}, + "start":2366,"end":2434,"loc":{"start":{"line":131,"column":0,"index":2366},"end":{"line":133,"column":1,"index":2434}}, "id": { "type": "Identifier", - "start":2430,"end":2432,"loc":{"start":{"line":132,"column":9,"index":2430},"end":{"line":132,"column":11,"index":2432},"identifierName":"fn"}, + "start":2375,"end":2377,"loc":{"start":{"line":131,"column":9,"index":2375},"end":{"line":131,"column":11,"index":2377},"identifierName":"fn"}, "name": "fn" }, "generator": false, "async": false, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":2432,"end":2435,"loc":{"start":{"line":132,"column":11,"index":2432},"end":{"line":132,"column":14,"index":2435}}, + "start":2377,"end":2380,"loc":{"start":{"line":131,"column":11,"index":2377},"end":{"line":131,"column":14,"index":2380}}, "params": [ { "type": "TSTypeParameter", - "start":2433,"end":2434,"loc":{"start":{"line":132,"column":12,"index":2433},"end":{"line":132,"column":13,"index":2434}}, + "start":2378,"end":2379,"loc":{"start":{"line":131,"column":12,"index":2378},"end":{"line":131,"column":13,"index":2379}}, "name": "A" } ] @@ -2738,29 +2773,29 @@ "params": [ { "type": "Identifier", - "start":2436,"end":2449,"loc":{"start":{"line":132,"column":15,"index":2436},"end":{"line":132,"column":28,"index":2449},"identifierName":"inp"}, + "start":2381,"end":2394,"loc":{"start":{"line":131,"column":15,"index":2381},"end":{"line":131,"column":28,"index":2394},"identifierName":"inp"}, "name": "inp", "typeAnnotation": { "type": "TSTypeAnnotation", - "start":2439,"end":2449,"loc":{"start":{"line":132,"column":18,"index":2439},"end":{"line":132,"column":28,"index":2449}}, + "start":2384,"end":2394,"loc":{"start":{"line":131,"column":18,"index":2384},"end":{"line":131,"column":28,"index":2394}}, "typeAnnotation": { "type": "TSTypeReference", - "start":2441,"end":2449,"loc":{"start":{"line":132,"column":20,"index":2441},"end":{"line":132,"column":28,"index":2449}}, + "start":2386,"end":2394,"loc":{"start":{"line":131,"column":20,"index":2386},"end":{"line":131,"column":28,"index":2394}}, "typeName": { "type": "Identifier", - "start":2441,"end":2446,"loc":{"start":{"line":132,"column":20,"index":2441},"end":{"line":132,"column":25,"index":2446},"identifierName":"Child"}, + "start":2386,"end":2391,"loc":{"start":{"line":131,"column":20,"index":2386},"end":{"line":131,"column":25,"index":2391},"identifierName":"Child"}, "name": "Child" }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start":2446,"end":2449,"loc":{"start":{"line":132,"column":25,"index":2446},"end":{"line":132,"column":28,"index":2449}}, + "start":2391,"end":2394,"loc":{"start":{"line":131,"column":25,"index":2391},"end":{"line":131,"column":28,"index":2394}}, "params": [ { "type": "TSTypeReference", - "start":2447,"end":2448,"loc":{"start":{"line":132,"column":26,"index":2447},"end":{"line":132,"column":27,"index":2448}}, + "start":2392,"end":2393,"loc":{"start":{"line":131,"column":26,"index":2392},"end":{"line":131,"column":27,"index":2393}}, "typeName": { "type": "Identifier", - "start":2447,"end":2448,"loc":{"start":{"line":132,"column":26,"index":2447},"end":{"line":132,"column":27,"index":2448},"identifierName":"A"}, + "start":2392,"end":2393,"loc":{"start":{"line":131,"column":26,"index":2392},"end":{"line":131,"column":27,"index":2393},"identifierName":"A"}, "name": "A" } } @@ -2772,37 +2807,37 @@ ], "body": { "type": "BlockStatement", - "start":2451,"end":2489,"loc":{"start":{"line":132,"column":30,"index":2451},"end":{"line":134,"column":1,"index":2489}}, + "start":2396,"end":2434,"loc":{"start":{"line":131,"column":30,"index":2396},"end":{"line":133,"column":1,"index":2434}}, "body": [ { "type": "VariableDeclaration", - "start":2457,"end":2487,"loc":{"start":{"line":133,"column":4,"index":2457},"end":{"line":133,"column":34,"index":2487}}, + "start":2402,"end":2432,"loc":{"start":{"line":132,"column":4,"index":2402},"end":{"line":132,"column":34,"index":2432}}, "declarations": [ { "type": "VariableDeclarator", - "start":2463,"end":2486,"loc":{"start":{"line":133,"column":10,"index":2463},"end":{"line":133,"column":33,"index":2486}}, + "start":2408,"end":2431,"loc":{"start":{"line":132,"column":10,"index":2408},"end":{"line":132,"column":33,"index":2431}}, "id": { "type": "Identifier", - "start":2463,"end":2480,"loc":{"start":{"line":133,"column":10,"index":2463},"end":{"line":133,"column":27,"index":2480},"identifierName":"a"}, + "start":2408,"end":2425,"loc":{"start":{"line":132,"column":10,"index":2408},"end":{"line":132,"column":27,"index":2425},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TSTypeAnnotation", - "start":2464,"end":2480,"loc":{"start":{"line":133,"column":11,"index":2464},"end":{"line":133,"column":27,"index":2480}}, + "start":2409,"end":2425,"loc":{"start":{"line":132,"column":11,"index":2409},"end":{"line":132,"column":27,"index":2425}}, "typeAnnotation": { "type": "TSTypeReference", - "start":2466,"end":2480,"loc":{"start":{"line":133,"column":13,"index":2466},"end":{"line":133,"column":27,"index":2480}}, + "start":2411,"end":2425,"loc":{"start":{"line":132,"column":13,"index":2411},"end":{"line":132,"column":27,"index":2425}}, "typeName": { "type": "Identifier", - "start":2466,"end":2471,"loc":{"start":{"line":133,"column":13,"index":2466},"end":{"line":133,"column":18,"index":2471},"identifierName":"Child"}, + "start":2411,"end":2416,"loc":{"start":{"line":132,"column":13,"index":2411},"end":{"line":132,"column":18,"index":2416},"identifierName":"Child"}, "name": "Child" }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start":2471,"end":2480,"loc":{"start":{"line":133,"column":18,"index":2471},"end":{"line":133,"column":27,"index":2480}}, + "start":2416,"end":2425,"loc":{"start":{"line":132,"column":18,"index":2416},"end":{"line":132,"column":27,"index":2425}}, "params": [ { "type": "TSUnknownKeyword", - "start":2472,"end":2479,"loc":{"start":{"line":133,"column":19,"index":2472},"end":{"line":133,"column":26,"index":2479}} + "start":2417,"end":2424,"loc":{"start":{"line":132,"column":19,"index":2417},"end":{"line":132,"column":26,"index":2424}} } ] } @@ -2811,7 +2846,7 @@ }, "init": { "type": "Identifier", - "start":2483,"end":2486,"loc":{"start":{"line":133,"column":30,"index":2483},"end":{"line":133,"column":33,"index":2486},"identifierName":"inp"}, + "start":2428,"end":2431,"loc":{"start":{"line":132,"column":30,"index":2428},"end":{"line":132,"column":33,"index":2431},"identifierName":"inp"}, "name": "inp" } } @@ -2824,33 +2859,33 @@ }, { "type": "VariableDeclaration", - "start":2491,"end":2586,"loc":{"start":{"line":136,"column":0,"index":2491},"end":{"line":136,"column":95,"index":2586}}, + "start":2436,"end":2531,"loc":{"start":{"line":135,"column":0,"index":2436},"end":{"line":135,"column":95,"index":2531}}, "declarations": [ { "type": "VariableDeclarator", - "start":2497,"end":2585,"loc":{"start":{"line":136,"column":6,"index":2497},"end":{"line":136,"column":94,"index":2585}}, + "start":2442,"end":2530,"loc":{"start":{"line":135,"column":6,"index":2442},"end":{"line":135,"column":94,"index":2530}}, "id": { "type": "Identifier", - "start":2497,"end":2516,"loc":{"start":{"line":136,"column":6,"index":2497},"end":{"line":136,"column":25,"index":2516},"identifierName":"pu"}, + "start":2442,"end":2461,"loc":{"start":{"line":135,"column":6,"index":2442},"end":{"line":135,"column":25,"index":2461},"identifierName":"pu"}, "name": "pu", "typeAnnotation": { "type": "TSTypeAnnotation", - "start":2499,"end":2516,"loc":{"start":{"line":136,"column":8,"index":2499},"end":{"line":136,"column":25,"index":2516}}, + "start":2444,"end":2461,"loc":{"start":{"line":135,"column":8,"index":2444},"end":{"line":135,"column":25,"index":2461}}, "typeAnnotation": { "type": "TSTypeReference", - "start":2501,"end":2516,"loc":{"start":{"line":136,"column":10,"index":2501},"end":{"line":136,"column":25,"index":2516}}, + "start":2446,"end":2461,"loc":{"start":{"line":135,"column":10,"index":2446},"end":{"line":135,"column":25,"index":2461}}, "typeName": { "type": "Identifier", - "start":2501,"end":2507,"loc":{"start":{"line":136,"column":10,"index":2501},"end":{"line":136,"column":16,"index":2507},"identifierName":"Parent"}, + "start":2446,"end":2452,"loc":{"start":{"line":135,"column":10,"index":2446},"end":{"line":135,"column":16,"index":2452},"identifierName":"Parent"}, "name": "Parent" }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start":2507,"end":2516,"loc":{"start":{"line":136,"column":16,"index":2507},"end":{"line":136,"column":25,"index":2516}}, + "start":2452,"end":2461,"loc":{"start":{"line":135,"column":16,"index":2452},"end":{"line":135,"column":25,"index":2461}}, "params": [ { "type": "TSUnknownKeyword", - "start":2508,"end":2515,"loc":{"start":{"line":136,"column":17,"index":2508},"end":{"line":136,"column":24,"index":2515}} + "start":2453,"end":2460,"loc":{"start":{"line":135,"column":17,"index":2453},"end":{"line":135,"column":24,"index":2460}} } ] } @@ -2859,37 +2894,37 @@ }, "init": { "type": "ObjectExpression", - "start":2519,"end":2585,"loc":{"start":{"line":136,"column":28,"index":2519},"end":{"line":136,"column":94,"index":2585}}, + "start":2464,"end":2530,"loc":{"start":{"line":135,"column":28,"index":2464},"end":{"line":135,"column":94,"index":2530}}, "properties": [ { "type": "ObjectProperty", - "start":2521,"end":2569,"loc":{"start":{"line":136,"column":30,"index":2521},"end":{"line":136,"column":78,"index":2569}}, + "start":2466,"end":2514,"loc":{"start":{"line":135,"column":30,"index":2466},"end":{"line":135,"column":78,"index":2514}}, "method": false, "key": { "type": "Identifier", - "start":2521,"end":2526,"loc":{"start":{"line":136,"column":30,"index":2521},"end":{"line":136,"column":35,"index":2526},"identifierName":"child"}, + "start":2466,"end":2471,"loc":{"start":{"line":135,"column":30,"index":2466},"end":{"line":135,"column":35,"index":2471},"identifierName":"child"}, "name": "child" }, "computed": false, "shorthand": false, "value": { "type": "ObjectExpression", - "start":2528,"end":2569,"loc":{"start":{"line":136,"column":37,"index":2528},"end":{"line":136,"column":78,"index":2569}}, + "start":2473,"end":2514,"loc":{"start":{"line":135,"column":37,"index":2473},"end":{"line":135,"column":78,"index":2514}}, "properties": [ { "type": "ObjectProperty", - "start":2530,"end":2534,"loc":{"start":{"line":136,"column":39,"index":2530},"end":{"line":136,"column":43,"index":2534}}, + "start":2475,"end":2479,"loc":{"start":{"line":135,"column":39,"index":2475},"end":{"line":135,"column":43,"index":2479}}, "method": false, "key": { "type": "Identifier", - "start":2530,"end":2531,"loc":{"start":{"line":136,"column":39,"index":2530},"end":{"line":136,"column":40,"index":2531},"identifierName":"a"}, + "start":2475,"end":2476,"loc":{"start":{"line":135,"column":39,"index":2475},"end":{"line":135,"column":40,"index":2476},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start":2533,"end":2534,"loc":{"start":{"line":136,"column":42,"index":2533},"end":{"line":136,"column":43,"index":2534}}, + "start":2478,"end":2479,"loc":{"start":{"line":135,"column":42,"index":2478},"end":{"line":135,"column":43,"index":2479}}, "extra": { "rawValue": 0, "raw": "0" @@ -2899,18 +2934,18 @@ }, { "type": "ObjectProperty", - "start":2536,"end":2540,"loc":{"start":{"line":136,"column":45,"index":2536},"end":{"line":136,"column":49,"index":2540}}, + "start":2481,"end":2485,"loc":{"start":{"line":135,"column":45,"index":2481},"end":{"line":135,"column":49,"index":2485}}, "method": false, "key": { "type": "Identifier", - "start":2536,"end":2537,"loc":{"start":{"line":136,"column":45,"index":2536},"end":{"line":136,"column":46,"index":2537},"identifierName":"b"}, + "start":2481,"end":2482,"loc":{"start":{"line":135,"column":45,"index":2481},"end":{"line":135,"column":46,"index":2482},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start":2539,"end":2540,"loc":{"start":{"line":136,"column":48,"index":2539},"end":{"line":136,"column":49,"index":2540}}, + "start":2484,"end":2485,"loc":{"start":{"line":135,"column":48,"index":2484},"end":{"line":135,"column":49,"index":2485}}, "extra": { "rawValue": 0, "raw": "0" @@ -2920,34 +2955,34 @@ }, { "type": "ObjectProperty", - "start":2542,"end":2553,"loc":{"start":{"line":136,"column":51,"index":2542},"end":{"line":136,"column":62,"index":2553}}, + "start":2487,"end":2498,"loc":{"start":{"line":135,"column":51,"index":2487},"end":{"line":135,"column":62,"index":2498}}, "method": false, "key": { "type": "Identifier", - "start":2542,"end":2547,"loc":{"start":{"line":136,"column":51,"index":2542},"end":{"line":136,"column":56,"index":2547},"identifierName":"child"}, + "start":2487,"end":2492,"loc":{"start":{"line":135,"column":51,"index":2487},"end":{"line":135,"column":56,"index":2492},"identifierName":"child"}, "name": "child" }, "computed": false, "shorthand": false, "value": { "type": "NullLiteral", - "start":2549,"end":2553,"loc":{"start":{"line":136,"column":58,"index":2549},"end":{"line":136,"column":62,"index":2553}} + "start":2494,"end":2498,"loc":{"start":{"line":135,"column":58,"index":2494},"end":{"line":135,"column":62,"index":2498}} } }, { "type": "ObjectProperty", - "start":2555,"end":2567,"loc":{"start":{"line":136,"column":64,"index":2555},"end":{"line":136,"column":76,"index":2567}}, + "start":2500,"end":2512,"loc":{"start":{"line":135,"column":64,"index":2500},"end":{"line":135,"column":76,"index":2512}}, "method": false, "key": { "type": "Identifier", - "start":2555,"end":2561,"loc":{"start":{"line":136,"column":64,"index":2555},"end":{"line":136,"column":70,"index":2561},"identifierName":"parent"}, + "start":2500,"end":2506,"loc":{"start":{"line":135,"column":64,"index":2500},"end":{"line":135,"column":70,"index":2506},"identifierName":"parent"}, "name": "parent" }, "computed": false, "shorthand": false, "value": { "type": "NullLiteral", - "start":2563,"end":2567,"loc":{"start":{"line":136,"column":72,"index":2563},"end":{"line":136,"column":76,"index":2567}} + "start":2508,"end":2512,"loc":{"start":{"line":135,"column":72,"index":2508},"end":{"line":135,"column":76,"index":2512}} } } ] @@ -2955,18 +2990,18 @@ }, { "type": "ObjectProperty", - "start":2571,"end":2583,"loc":{"start":{"line":136,"column":80,"index":2571},"end":{"line":136,"column":92,"index":2583}}, + "start":2516,"end":2528,"loc":{"start":{"line":135,"column":80,"index":2516},"end":{"line":135,"column":92,"index":2528}}, "method": false, "key": { "type": "Identifier", - "start":2571,"end":2577,"loc":{"start":{"line":136,"column":80,"index":2571},"end":{"line":136,"column":86,"index":2577},"identifierName":"parent"}, + "start":2516,"end":2522,"loc":{"start":{"line":135,"column":80,"index":2516},"end":{"line":135,"column":86,"index":2522},"identifierName":"parent"}, "name": "parent" }, "computed": false, "shorthand": false, "value": { "type": "NullLiteral", - "start":2579,"end":2583,"loc":{"start":{"line":136,"column":88,"index":2579},"end":{"line":136,"column":92,"index":2583}} + "start":2524,"end":2528,"loc":{"start":{"line":135,"column":88,"index":2524},"end":{"line":135,"column":92,"index":2528}} } } ] @@ -2977,33 +3012,33 @@ }, { "type": "VariableDeclaration", - "start":2587,"end":2624,"loc":{"start":{"line":137,"column":0,"index":2587},"end":{"line":137,"column":37,"index":2624}}, + "start":2532,"end":2569,"loc":{"start":{"line":136,"column":0,"index":2532},"end":{"line":136,"column":37,"index":2569}}, "declarations": [ { "type": "VariableDeclarator", - "start":2593,"end":2623,"loc":{"start":{"line":137,"column":6,"index":2593},"end":{"line":137,"column":36,"index":2623}}, + "start":2538,"end":2568,"loc":{"start":{"line":136,"column":6,"index":2538},"end":{"line":136,"column":36,"index":2568}}, "id": { "type": "Identifier", - "start":2593,"end":2618,"loc":{"start":{"line":137,"column":6,"index":2593},"end":{"line":137,"column":31,"index":2618},"identifierName":"notString"}, + "start":2538,"end":2563,"loc":{"start":{"line":136,"column":6,"index":2538},"end":{"line":136,"column":31,"index":2563},"identifierName":"notString"}, "name": "notString", "typeAnnotation": { "type": "TSTypeAnnotation", - "start":2602,"end":2618,"loc":{"start":{"line":137,"column":15,"index":2602},"end":{"line":137,"column":31,"index":2618}}, + "start":2547,"end":2563,"loc":{"start":{"line":136,"column":15,"index":2547},"end":{"line":136,"column":31,"index":2563}}, "typeAnnotation": { "type": "TSTypeReference", - "start":2604,"end":2618,"loc":{"start":{"line":137,"column":17,"index":2604},"end":{"line":137,"column":31,"index":2618}}, + "start":2549,"end":2563,"loc":{"start":{"line":136,"column":17,"index":2549},"end":{"line":136,"column":31,"index":2563}}, "typeName": { "type": "Identifier", - "start":2604,"end":2610,"loc":{"start":{"line":137,"column":17,"index":2604},"end":{"line":137,"column":23,"index":2610},"identifierName":"Parent"}, + "start":2549,"end":2555,"loc":{"start":{"line":136,"column":17,"index":2549},"end":{"line":136,"column":23,"index":2555},"identifierName":"Parent"}, "name": "Parent" }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start":2610,"end":2618,"loc":{"start":{"line":137,"column":23,"index":2610},"end":{"line":137,"column":31,"index":2618}}, + "start":2555,"end":2563,"loc":{"start":{"line":136,"column":23,"index":2555},"end":{"line":136,"column":31,"index":2563}}, "params": [ { "type": "TSStringKeyword", - "start":2611,"end":2617,"loc":{"start":{"line":137,"column":24,"index":2611},"end":{"line":137,"column":30,"index":2617}} + "start":2556,"end":2562,"loc":{"start":{"line":136,"column":24,"index":2556},"end":{"line":136,"column":30,"index":2562}} } ] } @@ -3012,7 +3047,7 @@ }, "init": { "type": "Identifier", - "start":2621,"end":2623,"loc":{"start":{"line":137,"column":34,"index":2621},"end":{"line":137,"column":36,"index":2623},"identifierName":"pu"}, + "start":2566,"end":2568,"loc":{"start":{"line":136,"column":34,"index":2566},"end":{"line":136,"column":36,"index":2568},"identifierName":"pu"}, "name": "pu" } } @@ -3022,58 +3057,58 @@ { "type": "CommentLine", "value": " Error", - "start":2626,"end":2634,"loc":{"start":{"line":137,"column":39,"index":2626},"end":{"line":137,"column":47,"index":2634}} + "start":2571,"end":2579,"loc":{"start":{"line":136,"column":39,"index":2571},"end":{"line":136,"column":47,"index":2579}} }, { "type": "CommentLine", "value": " Repro from comment in #44572", - "start":2636,"end":2667,"loc":{"start":{"line":139,"column":0,"index":2636},"end":{"line":139,"column":31,"index":2667}} + "start":2581,"end":2612,"loc":{"start":{"line":138,"column":0,"index":2581},"end":{"line":138,"column":31,"index":2612}} } ] }, { "type": "ClassDeclaration", - "start":2669,"end":2845,"loc":{"start":{"line":141,"column":0,"index":2669},"end":{"line":145,"column":1,"index":2845}}, + "start":2614,"end":2790,"loc":{"start":{"line":140,"column":0,"index":2614},"end":{"line":144,"column":1,"index":2790}}, "declare": true, "id": { "type": "Identifier", - "start":2683,"end":2692,"loc":{"start":{"line":141,"column":14,"index":2683},"end":{"line":141,"column":23,"index":2692},"identifierName":"StateNode"}, + "start":2628,"end":2637,"loc":{"start":{"line":140,"column":14,"index":2628},"end":{"line":140,"column":23,"index":2637},"identifierName":"StateNode"}, "name": "StateNode" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":2692,"end":2742,"loc":{"start":{"line":141,"column":23,"index":2692},"end":{"line":141,"column":73,"index":2742}}, + "start":2637,"end":2687,"loc":{"start":{"line":140,"column":23,"index":2637},"end":{"line":140,"column":73,"index":2687}}, "params": [ { "type": "TSTypeParameter", - "start":2693,"end":2701,"loc":{"start":{"line":141,"column":24,"index":2693},"end":{"line":141,"column":32,"index":2701}}, + "start":2638,"end":2646,"loc":{"start":{"line":140,"column":24,"index":2638},"end":{"line":140,"column":32,"index":2646}}, "name": "TContext" }, { "type": "TSTypeParameter", - "start":2703,"end":2741,"loc":{"start":{"line":141,"column":34,"index":2703},"end":{"line":141,"column":72,"index":2741}}, + "start":2648,"end":2686,"loc":{"start":{"line":140,"column":34,"index":2648},"end":{"line":140,"column":72,"index":2686}}, "in": true, "out": true, "name": "TEvent", "constraint": { "type": "TSTypeLiteral", - "start":2725,"end":2741,"loc":{"start":{"line":141,"column":56,"index":2725},"end":{"line":141,"column":72,"index":2741}}, + "start":2670,"end":2686,"loc":{"start":{"line":140,"column":56,"index":2670},"end":{"line":140,"column":72,"index":2686}}, "members": [ { "type": "TSPropertySignature", - "start":2727,"end":2739,"loc":{"start":{"line":141,"column":58,"index":2727},"end":{"line":141,"column":70,"index":2739}}, + "start":2672,"end":2684,"loc":{"start":{"line":140,"column":58,"index":2672},"end":{"line":140,"column":70,"index":2684}}, "key": { "type": "Identifier", - "start":2727,"end":2731,"loc":{"start":{"line":141,"column":58,"index":2727},"end":{"line":141,"column":62,"index":2731},"identifierName":"type"}, + "start":2672,"end":2676,"loc":{"start":{"line":140,"column":58,"index":2672},"end":{"line":140,"column":62,"index":2676},"identifierName":"type"}, "name": "type" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start":2731,"end":2739,"loc":{"start":{"line":141,"column":62,"index":2731},"end":{"line":141,"column":70,"index":2739}}, + "start":2676,"end":2684,"loc":{"start":{"line":140,"column":62,"index":2676},"end":{"line":140,"column":70,"index":2684}}, "typeAnnotation": { "type": "TSStringKeyword", - "start":2733,"end":2739,"loc":{"start":{"line":141,"column":64,"index":2733},"end":{"line":141,"column":70,"index":2739}} + "start":2678,"end":2684,"loc":{"start":{"line":140,"column":64,"index":2678},"end":{"line":140,"column":70,"index":2684}} } } } @@ -3085,27 +3120,27 @@ "superClass": null, "body": { "type": "ClassBody", - "start":2743,"end":2845,"loc":{"start":{"line":141,"column":74,"index":2743},"end":{"line":145,"column":1,"index":2845}}, + "start":2688,"end":2790,"loc":{"start":{"line":140,"column":74,"index":2688},"end":{"line":144,"column":1,"index":2790}}, "body": [ { "type": "ClassProperty", - "start":2749,"end":2770,"loc":{"start":{"line":142,"column":4,"index":2749},"end":{"line":142,"column":25,"index":2770}}, + "start":2694,"end":2715,"loc":{"start":{"line":141,"column":4,"index":2694},"end":{"line":141,"column":25,"index":2715}}, "static": false, "key": { "type": "Identifier", - "start":2749,"end":2761,"loc":{"start":{"line":142,"column":4,"index":2749},"end":{"line":142,"column":16,"index":2761},"identifierName":"_storedEvent"}, + "start":2694,"end":2706,"loc":{"start":{"line":141,"column":4,"index":2694},"end":{"line":141,"column":16,"index":2706},"identifierName":"_storedEvent"}, "name": "_storedEvent" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start":2761,"end":2769,"loc":{"start":{"line":142,"column":16,"index":2761},"end":{"line":142,"column":24,"index":2769}}, + "start":2706,"end":2714,"loc":{"start":{"line":141,"column":16,"index":2706},"end":{"line":141,"column":24,"index":2714}}, "typeAnnotation": { "type": "TSTypeReference", - "start":2763,"end":2769,"loc":{"start":{"line":142,"column":18,"index":2763},"end":{"line":142,"column":24,"index":2769}}, + "start":2708,"end":2714,"loc":{"start":{"line":141,"column":18,"index":2708},"end":{"line":141,"column":24,"index":2714}}, "typeName": { "type": "Identifier", - "start":2763,"end":2769,"loc":{"start":{"line":142,"column":18,"index":2763},"end":{"line":142,"column":24,"index":2769},"identifierName":"TEvent"}, + "start":2708,"end":2714,"loc":{"start":{"line":141,"column":18,"index":2708},"end":{"line":141,"column":24,"index":2714},"identifierName":"TEvent"}, "name": "TEvent" } } @@ -3114,35 +3149,35 @@ }, { "type": "ClassProperty", - "start":2775,"end":2805,"loc":{"start":{"line":143,"column":4,"index":2775},"end":{"line":143,"column":34,"index":2805}}, + "start":2720,"end":2750,"loc":{"start":{"line":142,"column":4,"index":2720},"end":{"line":142,"column":34,"index":2750}}, "static": false, "key": { "type": "Identifier", - "start":2775,"end":2782,"loc":{"start":{"line":143,"column":4,"index":2775},"end":{"line":143,"column":11,"index":2782},"identifierName":"_action"}, + "start":2720,"end":2727,"loc":{"start":{"line":142,"column":4,"index":2720},"end":{"line":142,"column":11,"index":2727},"identifierName":"_action"}, "name": "_action" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start":2782,"end":2804,"loc":{"start":{"line":143,"column":11,"index":2782},"end":{"line":143,"column":33,"index":2804}}, + "start":2727,"end":2749,"loc":{"start":{"line":142,"column":11,"index":2727},"end":{"line":142,"column":33,"index":2749}}, "typeAnnotation": { "type": "TSTypeReference", - "start":2784,"end":2804,"loc":{"start":{"line":143,"column":13,"index":2784},"end":{"line":143,"column":33,"index":2804}}, + "start":2729,"end":2749,"loc":{"start":{"line":142,"column":13,"index":2729},"end":{"line":142,"column":33,"index":2749}}, "typeName": { "type": "Identifier", - "start":2784,"end":2796,"loc":{"start":{"line":143,"column":13,"index":2784},"end":{"line":143,"column":25,"index":2796},"identifierName":"ActionObject"}, + "start":2729,"end":2741,"loc":{"start":{"line":142,"column":13,"index":2729},"end":{"line":142,"column":25,"index":2741},"identifierName":"ActionObject"}, "name": "ActionObject" }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start":2796,"end":2804,"loc":{"start":{"line":143,"column":25,"index":2796},"end":{"line":143,"column":33,"index":2804}}, + "start":2741,"end":2749,"loc":{"start":{"line":142,"column":25,"index":2741},"end":{"line":142,"column":33,"index":2749}}, "params": [ { "type": "TSTypeReference", - "start":2797,"end":2803,"loc":{"start":{"line":143,"column":26,"index":2797},"end":{"line":143,"column":32,"index":2803}}, + "start":2742,"end":2748,"loc":{"start":{"line":142,"column":26,"index":2742},"end":{"line":142,"column":32,"index":2748}}, "typeName": { "type": "Identifier", - "start":2797,"end":2803,"loc":{"start":{"line":143,"column":26,"index":2797},"end":{"line":143,"column":32,"index":2803},"identifierName":"TEvent"}, + "start":2742,"end":2748,"loc":{"start":{"line":142,"column":26,"index":2742},"end":{"line":142,"column":32,"index":2748},"identifierName":"TEvent"}, "name": "TEvent" } } @@ -3154,41 +3189,41 @@ }, { "type": "ClassProperty", - "start":2810,"end":2843,"loc":{"start":{"line":144,"column":4,"index":2810},"end":{"line":144,"column":37,"index":2843}}, + "start":2755,"end":2788,"loc":{"start":{"line":143,"column":4,"index":2755},"end":{"line":143,"column":37,"index":2788}}, "static": false, "key": { "type": "Identifier", - "start":2810,"end":2816,"loc":{"start":{"line":144,"column":4,"index":2810},"end":{"line":144,"column":10,"index":2816},"identifierName":"_state"}, + "start":2755,"end":2761,"loc":{"start":{"line":143,"column":4,"index":2755},"end":{"line":143,"column":10,"index":2761},"identifierName":"_state"}, "name": "_state" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start":2816,"end":2842,"loc":{"start":{"line":144,"column":10,"index":2816},"end":{"line":144,"column":36,"index":2842}}, + "start":2761,"end":2787,"loc":{"start":{"line":143,"column":10,"index":2761},"end":{"line":143,"column":36,"index":2787}}, "typeAnnotation": { "type": "TSTypeReference", - "start":2818,"end":2842,"loc":{"start":{"line":144,"column":12,"index":2818},"end":{"line":144,"column":36,"index":2842}}, + "start":2763,"end":2787,"loc":{"start":{"line":143,"column":12,"index":2763},"end":{"line":143,"column":36,"index":2787}}, "typeName": { "type": "Identifier", - "start":2818,"end":2827,"loc":{"start":{"line":144,"column":12,"index":2818},"end":{"line":144,"column":21,"index":2827},"identifierName":"StateNode"}, + "start":2763,"end":2772,"loc":{"start":{"line":143,"column":12,"index":2763},"end":{"line":143,"column":21,"index":2772},"identifierName":"StateNode"}, "name": "StateNode" }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start":2827,"end":2842,"loc":{"start":{"line":144,"column":21,"index":2827},"end":{"line":144,"column":36,"index":2842}}, + "start":2772,"end":2787,"loc":{"start":{"line":143,"column":21,"index":2772},"end":{"line":143,"column":36,"index":2787}}, "params": [ { "type": "TSTypeReference", - "start":2828,"end":2836,"loc":{"start":{"line":144,"column":22,"index":2828},"end":{"line":144,"column":30,"index":2836}}, + "start":2773,"end":2781,"loc":{"start":{"line":143,"column":22,"index":2773},"end":{"line":143,"column":30,"index":2781}}, "typeName": { "type": "Identifier", - "start":2828,"end":2836,"loc":{"start":{"line":144,"column":22,"index":2828},"end":{"line":144,"column":30,"index":2836},"identifierName":"TContext"}, + "start":2773,"end":2781,"loc":{"start":{"line":143,"column":22,"index":2773},"end":{"line":143,"column":30,"index":2781},"identifierName":"TContext"}, "name": "TContext" } }, { "type": "TSAnyKeyword", - "start":2838,"end":2841,"loc":{"start":{"line":144,"column":32,"index":2838},"end":{"line":144,"column":35,"index":2841}} + "start":2783,"end":2786,"loc":{"start":{"line":143,"column":32,"index":2783},"end":{"line":143,"column":35,"index":2786}} } ] } @@ -3202,50 +3237,50 @@ { "type": "CommentLine", "value": " Error", - "start":2626,"end":2634,"loc":{"start":{"line":137,"column":39,"index":2626},"end":{"line":137,"column":47,"index":2634}} + "start":2571,"end":2579,"loc":{"start":{"line":136,"column":39,"index":2571},"end":{"line":136,"column":47,"index":2579}} }, { "type": "CommentLine", "value": " Repro from comment in #44572", - "start":2636,"end":2667,"loc":{"start":{"line":139,"column":0,"index":2636},"end":{"line":139,"column":31,"index":2667}} + "start":2581,"end":2612,"loc":{"start":{"line":138,"column":0,"index":2581},"end":{"line":138,"column":31,"index":2612}} } ] }, { "type": "TSInterfaceDeclaration", - "start":2847,"end":2956,"loc":{"start":{"line":147,"column":0,"index":2847},"end":{"line":149,"column":1,"index":2956}}, + "start":2792,"end":2901,"loc":{"start":{"line":146,"column":0,"index":2792},"end":{"line":148,"column":1,"index":2901}}, "id": { "type": "Identifier", - "start":2857,"end":2869,"loc":{"start":{"line":147,"column":10,"index":2857},"end":{"line":147,"column":22,"index":2869},"identifierName":"ActionObject"}, + "start":2802,"end":2814,"loc":{"start":{"line":146,"column":10,"index":2802},"end":{"line":146,"column":22,"index":2814},"identifierName":"ActionObject"}, "name": "ActionObject" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":2869,"end":2902,"loc":{"start":{"line":147,"column":22,"index":2869},"end":{"line":147,"column":55,"index":2902}}, + "start":2814,"end":2847,"loc":{"start":{"line":146,"column":22,"index":2814},"end":{"line":146,"column":55,"index":2847}}, "params": [ { "type": "TSTypeParameter", - "start":2870,"end":2901,"loc":{"start":{"line":147,"column":23,"index":2870},"end":{"line":147,"column":54,"index":2901}}, + "start":2815,"end":2846,"loc":{"start":{"line":146,"column":23,"index":2815},"end":{"line":146,"column":54,"index":2846}}, "name": "TEvent", "constraint": { "type": "TSTypeLiteral", - "start":2885,"end":2901,"loc":{"start":{"line":147,"column":38,"index":2885},"end":{"line":147,"column":54,"index":2901}}, + "start":2830,"end":2846,"loc":{"start":{"line":146,"column":38,"index":2830},"end":{"line":146,"column":54,"index":2846}}, "members": [ { "type": "TSPropertySignature", - "start":2887,"end":2899,"loc":{"start":{"line":147,"column":40,"index":2887},"end":{"line":147,"column":52,"index":2899}}, + "start":2832,"end":2844,"loc":{"start":{"line":146,"column":40,"index":2832},"end":{"line":146,"column":52,"index":2844}}, "key": { "type": "Identifier", - "start":2887,"end":2891,"loc":{"start":{"line":147,"column":40,"index":2887},"end":{"line":147,"column":44,"index":2891},"identifierName":"type"}, + "start":2832,"end":2836,"loc":{"start":{"line":146,"column":40,"index":2832},"end":{"line":146,"column":44,"index":2836},"identifierName":"type"}, "name": "type" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start":2891,"end":2899,"loc":{"start":{"line":147,"column":44,"index":2891},"end":{"line":147,"column":52,"index":2899}}, + "start":2836,"end":2844,"loc":{"start":{"line":146,"column":44,"index":2836},"end":{"line":146,"column":52,"index":2844}}, "typeAnnotation": { "type": "TSStringKeyword", - "start":2893,"end":2899,"loc":{"start":{"line":147,"column":46,"index":2893},"end":{"line":147,"column":52,"index":2899}} + "start":2838,"end":2844,"loc":{"start":{"line":146,"column":46,"index":2838},"end":{"line":146,"column":52,"index":2844}} } } } @@ -3256,53 +3291,53 @@ }, "body": { "type": "TSInterfaceBody", - "start":2903,"end":2956,"loc":{"start":{"line":147,"column":56,"index":2903},"end":{"line":149,"column":1,"index":2956}}, + "start":2848,"end":2901,"loc":{"start":{"line":146,"column":56,"index":2848},"end":{"line":148,"column":1,"index":2901}}, "body": [ { "type": "TSPropertySignature", - "start":2909,"end":2954,"loc":{"start":{"line":148,"column":4,"index":2909},"end":{"line":148,"column":49,"index":2954}}, + "start":2854,"end":2899,"loc":{"start":{"line":147,"column":4,"index":2854},"end":{"line":147,"column":49,"index":2899}}, "key": { "type": "Identifier", - "start":2909,"end":2913,"loc":{"start":{"line":148,"column":4,"index":2909},"end":{"line":148,"column":8,"index":2913},"identifierName":"exec"}, + "start":2854,"end":2858,"loc":{"start":{"line":147,"column":4,"index":2854},"end":{"line":147,"column":8,"index":2858},"identifierName":"exec"}, "name": "exec" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start":2913,"end":2953,"loc":{"start":{"line":148,"column":8,"index":2913},"end":{"line":148,"column":48,"index":2953}}, + "start":2858,"end":2898,"loc":{"start":{"line":147,"column":8,"index":2858},"end":{"line":147,"column":48,"index":2898}}, "typeAnnotation": { "type": "TSFunctionType", - "start":2915,"end":2953,"loc":{"start":{"line":148,"column":10,"index":2915},"end":{"line":148,"column":48,"index":2953}}, + "start":2860,"end":2898,"loc":{"start":{"line":147,"column":10,"index":2860},"end":{"line":147,"column":48,"index":2898}}, "parameters": [ { "type": "Identifier", - "start":2916,"end":2944,"loc":{"start":{"line":148,"column":11,"index":2916},"end":{"line":148,"column":39,"index":2944},"identifierName":"meta"}, + "start":2861,"end":2889,"loc":{"start":{"line":147,"column":11,"index":2861},"end":{"line":147,"column":39,"index":2889},"identifierName":"meta"}, "name": "meta", "typeAnnotation": { "type": "TSTypeAnnotation", - "start":2920,"end":2944,"loc":{"start":{"line":148,"column":15,"index":2920},"end":{"line":148,"column":39,"index":2944}}, + "start":2865,"end":2889,"loc":{"start":{"line":147,"column":15,"index":2865},"end":{"line":147,"column":39,"index":2889}}, "typeAnnotation": { "type": "TSTypeReference", - "start":2922,"end":2944,"loc":{"start":{"line":148,"column":17,"index":2922},"end":{"line":148,"column":39,"index":2944}}, + "start":2867,"end":2889,"loc":{"start":{"line":147,"column":17,"index":2867},"end":{"line":147,"column":39,"index":2889}}, "typeName": { "type": "Identifier", - "start":2922,"end":2931,"loc":{"start":{"line":148,"column":17,"index":2922},"end":{"line":148,"column":26,"index":2931},"identifierName":"StateNode"}, + "start":2867,"end":2876,"loc":{"start":{"line":147,"column":17,"index":2867},"end":{"line":147,"column":26,"index":2876},"identifierName":"StateNode"}, "name": "StateNode" }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start":2931,"end":2944,"loc":{"start":{"line":148,"column":26,"index":2931},"end":{"line":148,"column":39,"index":2944}}, + "start":2876,"end":2889,"loc":{"start":{"line":147,"column":26,"index":2876},"end":{"line":147,"column":39,"index":2889}}, "params": [ { "type": "TSAnyKeyword", - "start":2932,"end":2935,"loc":{"start":{"line":148,"column":27,"index":2932},"end":{"line":148,"column":30,"index":2935}} + "start":2877,"end":2880,"loc":{"start":{"line":147,"column":27,"index":2877},"end":{"line":147,"column":30,"index":2880}} }, { "type": "TSTypeReference", - "start":2937,"end":2943,"loc":{"start":{"line":148,"column":32,"index":2937},"end":{"line":148,"column":38,"index":2943}}, + "start":2882,"end":2888,"loc":{"start":{"line":147,"column":32,"index":2882},"end":{"line":147,"column":38,"index":2888}}, "typeName": { "type": "Identifier", - "start":2937,"end":2943,"loc":{"start":{"line":148,"column":32,"index":2937},"end":{"line":148,"column":38,"index":2943},"identifierName":"TEvent"}, + "start":2882,"end":2888,"loc":{"start":{"line":147,"column":32,"index":2882},"end":{"line":147,"column":38,"index":2888},"identifierName":"TEvent"}, "name": "TEvent" } } @@ -3314,10 +3349,10 @@ ], "typeAnnotation": { "type": "TSTypeAnnotation", - "start":2946,"end":2953,"loc":{"start":{"line":148,"column":41,"index":2946},"end":{"line":148,"column":48,"index":2953}}, + "start":2891,"end":2898,"loc":{"start":{"line":147,"column":41,"index":2891},"end":{"line":147,"column":48,"index":2898}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start":2949,"end":2953,"loc":{"start":{"line":148,"column":44,"index":2949},"end":{"line":148,"column":48,"index":2953}} + "start":2894,"end":2898,"loc":{"start":{"line":147,"column":44,"index":2894},"end":{"line":147,"column":48,"index":2898}} } } } @@ -3328,42 +3363,42 @@ }, { "type": "TSDeclareFunction", - "start":2958,"end":3073,"loc":{"start":{"line":151,"column":0,"index":2958},"end":{"line":151,"column":115,"index":3073}}, + "start":2903,"end":3018,"loc":{"start":{"line":150,"column":0,"index":2903},"end":{"line":150,"column":115,"index":3018}}, "declare": true, "id": { "type": "Identifier", - "start":2975,"end":2988,"loc":{"start":{"line":151,"column":17,"index":2975},"end":{"line":151,"column":30,"index":2988},"identifierName":"createMachine"}, + "start":2920,"end":2933,"loc":{"start":{"line":150,"column":17,"index":2920},"end":{"line":150,"column":30,"index":2933},"identifierName":"createMachine"}, "name": "createMachine" }, "generator": false, "async": false, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":2988,"end":3021,"loc":{"start":{"line":151,"column":30,"index":2988},"end":{"line":151,"column":63,"index":3021}}, + "start":2933,"end":2966,"loc":{"start":{"line":150,"column":30,"index":2933},"end":{"line":150,"column":63,"index":2966}}, "params": [ { "type": "TSTypeParameter", - "start":2989,"end":3020,"loc":{"start":{"line":151,"column":31,"index":2989},"end":{"line":151,"column":62,"index":3020}}, + "start":2934,"end":2965,"loc":{"start":{"line":150,"column":31,"index":2934},"end":{"line":150,"column":62,"index":2965}}, "name": "TEvent", "constraint": { "type": "TSTypeLiteral", - "start":3004,"end":3020,"loc":{"start":{"line":151,"column":46,"index":3004},"end":{"line":151,"column":62,"index":3020}}, + "start":2949,"end":2965,"loc":{"start":{"line":150,"column":46,"index":2949},"end":{"line":150,"column":62,"index":2965}}, "members": [ { "type": "TSPropertySignature", - "start":3006,"end":3018,"loc":{"start":{"line":151,"column":48,"index":3006},"end":{"line":151,"column":60,"index":3018}}, + "start":2951,"end":2963,"loc":{"start":{"line":150,"column":48,"index":2951},"end":{"line":150,"column":60,"index":2963}}, "key": { "type": "Identifier", - "start":3006,"end":3010,"loc":{"start":{"line":151,"column":48,"index":3006},"end":{"line":151,"column":52,"index":3010},"identifierName":"type"}, + "start":2951,"end":2955,"loc":{"start":{"line":150,"column":48,"index":2951},"end":{"line":150,"column":52,"index":2955},"identifierName":"type"}, "name": "type" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start":3010,"end":3018,"loc":{"start":{"line":151,"column":52,"index":3010},"end":{"line":151,"column":60,"index":3018}}, + "start":2955,"end":2963,"loc":{"start":{"line":150,"column":52,"index":2955},"end":{"line":150,"column":60,"index":2963}}, "typeAnnotation": { "type": "TSStringKeyword", - "start":3012,"end":3018,"loc":{"start":{"line":151,"column":54,"index":3012},"end":{"line":151,"column":60,"index":3018}} + "start":2957,"end":2963,"loc":{"start":{"line":150,"column":54,"index":2957},"end":{"line":150,"column":60,"index":2963}} } } } @@ -3375,29 +3410,29 @@ "params": [ { "type": "Identifier", - "start":3022,"end":3050,"loc":{"start":{"line":151,"column":64,"index":3022},"end":{"line":151,"column":92,"index":3050},"identifierName":"action"}, + "start":2967,"end":2995,"loc":{"start":{"line":150,"column":64,"index":2967},"end":{"line":150,"column":92,"index":2995},"identifierName":"action"}, "name": "action", "typeAnnotation": { "type": "TSTypeAnnotation", - "start":3028,"end":3050,"loc":{"start":{"line":151,"column":70,"index":3028},"end":{"line":151,"column":92,"index":3050}}, + "start":2973,"end":2995,"loc":{"start":{"line":150,"column":70,"index":2973},"end":{"line":150,"column":92,"index":2995}}, "typeAnnotation": { "type": "TSTypeReference", - "start":3030,"end":3050,"loc":{"start":{"line":151,"column":72,"index":3030},"end":{"line":151,"column":92,"index":3050}}, + "start":2975,"end":2995,"loc":{"start":{"line":150,"column":72,"index":2975},"end":{"line":150,"column":92,"index":2995}}, "typeName": { "type": "Identifier", - "start":3030,"end":3042,"loc":{"start":{"line":151,"column":72,"index":3030},"end":{"line":151,"column":84,"index":3042},"identifierName":"ActionObject"}, + "start":2975,"end":2987,"loc":{"start":{"line":150,"column":72,"index":2975},"end":{"line":150,"column":84,"index":2987},"identifierName":"ActionObject"}, "name": "ActionObject" }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start":3042,"end":3050,"loc":{"start":{"line":151,"column":84,"index":3042},"end":{"line":151,"column":92,"index":3050}}, + "start":2987,"end":2995,"loc":{"start":{"line":150,"column":84,"index":2987},"end":{"line":150,"column":92,"index":2995}}, "params": [ { "type": "TSTypeReference", - "start":3043,"end":3049,"loc":{"start":{"line":151,"column":85,"index":3043},"end":{"line":151,"column":91,"index":3049}}, + "start":2988,"end":2994,"loc":{"start":{"line":150,"column":85,"index":2988},"end":{"line":150,"column":91,"index":2994}}, "typeName": { "type": "Identifier", - "start":3043,"end":3049,"loc":{"start":{"line":151,"column":85,"index":3043},"end":{"line":151,"column":91,"index":3049},"identifierName":"TEvent"}, + "start":2988,"end":2994,"loc":{"start":{"line":150,"column":85,"index":2988},"end":{"line":150,"column":91,"index":2994},"identifierName":"TEvent"}, "name": "TEvent" } } @@ -3409,26 +3444,26 @@ ], "returnType": { "type": "TSTypeAnnotation", - "start":3051,"end":3072,"loc":{"start":{"line":151,"column":93,"index":3051},"end":{"line":151,"column":114,"index":3072}}, + "start":2996,"end":3017,"loc":{"start":{"line":150,"column":93,"index":2996},"end":{"line":150,"column":114,"index":3017}}, "typeAnnotation": { "type": "TSTypeReference", - "start":3053,"end":3072,"loc":{"start":{"line":151,"column":95,"index":3053},"end":{"line":151,"column":114,"index":3072}}, + "start":2998,"end":3017,"loc":{"start":{"line":150,"column":95,"index":2998},"end":{"line":150,"column":114,"index":3017}}, "typeName": { "type": "Identifier", - "start":3053,"end":3062,"loc":{"start":{"line":151,"column":95,"index":3053},"end":{"line":151,"column":104,"index":3062},"identifierName":"StateNode"}, + "start":2998,"end":3007,"loc":{"start":{"line":150,"column":95,"index":2998},"end":{"line":150,"column":104,"index":3007},"identifierName":"StateNode"}, "name": "StateNode" }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start":3062,"end":3072,"loc":{"start":{"line":151,"column":104,"index":3062},"end":{"line":151,"column":114,"index":3072}}, + "start":3007,"end":3017,"loc":{"start":{"line":150,"column":104,"index":3007},"end":{"line":150,"column":114,"index":3017}}, "params": [ { "type": "TSAnyKeyword", - "start":3063,"end":3066,"loc":{"start":{"line":151,"column":105,"index":3063},"end":{"line":151,"column":108,"index":3066}} + "start":3008,"end":3011,"loc":{"start":{"line":150,"column":105,"index":3008},"end":{"line":150,"column":108,"index":3011}} }, { "type": "TSAnyKeyword", - "start":3068,"end":3071,"loc":{"start":{"line":151,"column":110,"index":3068},"end":{"line":151,"column":113,"index":3071}} + "start":3013,"end":3016,"loc":{"start":{"line":150,"column":110,"index":3013},"end":{"line":150,"column":113,"index":3016}} } ] } @@ -3437,22 +3472,22 @@ }, { "type": "TSDeclareFunction", - "start":3075,"end":3153,"loc":{"start":{"line":153,"column":0,"index":3075},"end":{"line":153,"column":78,"index":3153}}, + "start":3020,"end":3098,"loc":{"start":{"line":152,"column":0,"index":3020},"end":{"line":152,"column":78,"index":3098}}, "declare": true, "id": { "type": "Identifier", - "start":3092,"end":3101,"loc":{"start":{"line":153,"column":17,"index":3092},"end":{"line":153,"column":26,"index":3101},"identifierName":"interpret"}, + "start":3037,"end":3046,"loc":{"start":{"line":152,"column":17,"index":3037},"end":{"line":152,"column":26,"index":3046},"identifierName":"interpret"}, "name": "interpret" }, "generator": false, "async": false, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":3101,"end":3111,"loc":{"start":{"line":153,"column":26,"index":3101},"end":{"line":153,"column":36,"index":3111}}, + "start":3046,"end":3056,"loc":{"start":{"line":152,"column":26,"index":3046},"end":{"line":152,"column":36,"index":3056}}, "params": [ { "type": "TSTypeParameter", - "start":3102,"end":3110,"loc":{"start":{"line":153,"column":27,"index":3102},"end":{"line":153,"column":35,"index":3110}}, + "start":3047,"end":3055,"loc":{"start":{"line":152,"column":27,"index":3047},"end":{"line":152,"column":35,"index":3055}}, "name": "TContext" } ] @@ -3460,35 +3495,35 @@ "params": [ { "type": "Identifier", - "start":3112,"end":3145,"loc":{"start":{"line":153,"column":37,"index":3112},"end":{"line":153,"column":70,"index":3145},"identifierName":"machine"}, + "start":3057,"end":3090,"loc":{"start":{"line":152,"column":37,"index":3057},"end":{"line":152,"column":70,"index":3090},"identifierName":"machine"}, "name": "machine", "typeAnnotation": { "type": "TSTypeAnnotation", - "start":3119,"end":3145,"loc":{"start":{"line":153,"column":44,"index":3119},"end":{"line":153,"column":70,"index":3145}}, + "start":3064,"end":3090,"loc":{"start":{"line":152,"column":44,"index":3064},"end":{"line":152,"column":70,"index":3090}}, "typeAnnotation": { "type": "TSTypeReference", - "start":3121,"end":3145,"loc":{"start":{"line":153,"column":46,"index":3121},"end":{"line":153,"column":70,"index":3145}}, + "start":3066,"end":3090,"loc":{"start":{"line":152,"column":46,"index":3066},"end":{"line":152,"column":70,"index":3090}}, "typeName": { "type": "Identifier", - "start":3121,"end":3130,"loc":{"start":{"line":153,"column":46,"index":3121},"end":{"line":153,"column":55,"index":3130},"identifierName":"StateNode"}, + "start":3066,"end":3075,"loc":{"start":{"line":152,"column":46,"index":3066},"end":{"line":152,"column":55,"index":3075},"identifierName":"StateNode"}, "name": "StateNode" }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start":3130,"end":3145,"loc":{"start":{"line":153,"column":55,"index":3130},"end":{"line":153,"column":70,"index":3145}}, + "start":3075,"end":3090,"loc":{"start":{"line":152,"column":55,"index":3075},"end":{"line":152,"column":70,"index":3090}}, "params": [ { "type": "TSTypeReference", - "start":3131,"end":3139,"loc":{"start":{"line":153,"column":56,"index":3131},"end":{"line":153,"column":64,"index":3139}}, + "start":3076,"end":3084,"loc":{"start":{"line":152,"column":56,"index":3076},"end":{"line":152,"column":64,"index":3084}}, "typeName": { "type": "Identifier", - "start":3131,"end":3139,"loc":{"start":{"line":153,"column":56,"index":3131},"end":{"line":153,"column":64,"index":3139},"identifierName":"TContext"}, + "start":3076,"end":3084,"loc":{"start":{"line":152,"column":56,"index":3076},"end":{"line":152,"column":64,"index":3084},"identifierName":"TContext"}, "name": "TContext" } }, { "type": "TSAnyKeyword", - "start":3141,"end":3144,"loc":{"start":{"line":153,"column":66,"index":3141},"end":{"line":153,"column":69,"index":3144}} + "start":3086,"end":3089,"loc":{"start":{"line":152,"column":66,"index":3086},"end":{"line":152,"column":69,"index":3089}} } ] } @@ -3498,45 +3533,45 @@ ], "returnType": { "type": "TSTypeAnnotation", - "start":3146,"end":3152,"loc":{"start":{"line":153,"column":71,"index":3146},"end":{"line":153,"column":77,"index":3152}}, + "start":3091,"end":3097,"loc":{"start":{"line":152,"column":71,"index":3091},"end":{"line":152,"column":77,"index":3097}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start":3148,"end":3152,"loc":{"start":{"line":153,"column":73,"index":3148},"end":{"line":153,"column":77,"index":3152}} + "start":3093,"end":3097,"loc":{"start":{"line":152,"column":73,"index":3093},"end":{"line":152,"column":77,"index":3097}} } } }, { "type": "VariableDeclaration", - "start":3155,"end":3196,"loc":{"start":{"line":155,"column":0,"index":3155},"end":{"line":155,"column":41,"index":3196}}, + "start":3100,"end":3141,"loc":{"start":{"line":154,"column":0,"index":3100},"end":{"line":154,"column":41,"index":3141}}, "declarations": [ { "type": "VariableDeclarator", - "start":3161,"end":3195,"loc":{"start":{"line":155,"column":6,"index":3161},"end":{"line":155,"column":40,"index":3195}}, + "start":3106,"end":3140,"loc":{"start":{"line":154,"column":6,"index":3106},"end":{"line":154,"column":40,"index":3140}}, "id": { "type": "Identifier", - "start":3161,"end":3168,"loc":{"start":{"line":155,"column":6,"index":3161},"end":{"line":155,"column":13,"index":3168},"identifierName":"machine"}, + "start":3106,"end":3113,"loc":{"start":{"line":154,"column":6,"index":3106},"end":{"line":154,"column":13,"index":3113},"identifierName":"machine"}, "name": "machine" }, "init": { "type": "CallExpression", - "start":3171,"end":3195,"loc":{"start":{"line":155,"column":16,"index":3171},"end":{"line":155,"column":40,"index":3195}}, + "start":3116,"end":3140,"loc":{"start":{"line":154,"column":16,"index":3116},"end":{"line":154,"column":40,"index":3140}}, "callee": { "type": "Identifier", - "start":3171,"end":3184,"loc":{"start":{"line":155,"column":16,"index":3171},"end":{"line":155,"column":29,"index":3184},"identifierName":"createMachine"}, + "start":3116,"end":3129,"loc":{"start":{"line":154,"column":16,"index":3116},"end":{"line":154,"column":29,"index":3129},"identifierName":"createMachine"}, "name": "createMachine" }, "arguments": [ { "type": "TSAsExpression", - "start":3185,"end":3194,"loc":{"start":{"line":155,"column":30,"index":3185},"end":{"line":155,"column":39,"index":3194}}, + "start":3130,"end":3139,"loc":{"start":{"line":154,"column":30,"index":3130},"end":{"line":154,"column":39,"index":3139}}, "expression": { "type": "ObjectExpression", - "start":3185,"end":3187,"loc":{"start":{"line":155,"column":30,"index":3185},"end":{"line":155,"column":32,"index":3187}}, + "start":3130,"end":3132,"loc":{"start":{"line":154,"column":30,"index":3130},"end":{"line":154,"column":32,"index":3132}}, "properties": [] }, "typeAnnotation": { "type": "TSAnyKeyword", - "start":3191,"end":3194,"loc":{"start":{"line":155,"column":36,"index":3191},"end":{"line":155,"column":39,"index":3194}} + "start":3136,"end":3139,"loc":{"start":{"line":154,"column":36,"index":3136},"end":{"line":154,"column":39,"index":3139}} } } ] @@ -3547,19 +3582,19 @@ }, { "type": "ExpressionStatement", - "start":3198,"end":3217,"loc":{"start":{"line":157,"column":0,"index":3198},"end":{"line":157,"column":19,"index":3217}}, + "start":3143,"end":3162,"loc":{"start":{"line":156,"column":0,"index":3143},"end":{"line":156,"column":19,"index":3162}}, "expression": { "type": "CallExpression", - "start":3198,"end":3216,"loc":{"start":{"line":157,"column":0,"index":3198},"end":{"line":157,"column":18,"index":3216}}, + "start":3143,"end":3161,"loc":{"start":{"line":156,"column":0,"index":3143},"end":{"line":156,"column":18,"index":3161}}, "callee": { "type": "Identifier", - "start":3198,"end":3207,"loc":{"start":{"line":157,"column":0,"index":3198},"end":{"line":157,"column":9,"index":3207},"identifierName":"interpret"}, + "start":3143,"end":3152,"loc":{"start":{"line":156,"column":0,"index":3143},"end":{"line":156,"column":9,"index":3152},"identifierName":"interpret"}, "name": "interpret" }, "arguments": [ { "type": "Identifier", - "start":3208,"end":3215,"loc":{"start":{"line":157,"column":10,"index":3208},"end":{"line":157,"column":17,"index":3215},"identifierName":"machine"}, + "start":3153,"end":3160,"loc":{"start":{"line":156,"column":10,"index":3153},"end":{"line":156,"column":17,"index":3160},"identifierName":"machine"}, "name": "machine" } ] @@ -3567,53 +3602,53 @@ }, { "type": "VariableDeclaration", - "start":3219,"end":3283,"loc":{"start":{"line":159,"column":0,"index":3219},"end":{"line":159,"column":64,"index":3283}}, + "start":3164,"end":3228,"loc":{"start":{"line":158,"column":0,"index":3164},"end":{"line":158,"column":64,"index":3228}}, "declare": true, "declarations": [ { "type": "VariableDeclarator", - "start":3233,"end":3282,"loc":{"start":{"line":159,"column":14,"index":3233},"end":{"line":159,"column":63,"index":3282}}, + "start":3178,"end":3227,"loc":{"start":{"line":158,"column":14,"index":3178},"end":{"line":158,"column":63,"index":3227}}, "id": { "type": "Identifier", - "start":3233,"end":3282,"loc":{"start":{"line":159,"column":14,"index":3233},"end":{"line":159,"column":63,"index":3282},"identifierName":"qq"}, + "start":3178,"end":3227,"loc":{"start":{"line":158,"column":14,"index":3178},"end":{"line":158,"column":63,"index":3227},"identifierName":"qq"}, "name": "qq", "typeAnnotation": { "type": "TSTypeAnnotation", - "start":3235,"end":3282,"loc":{"start":{"line":159,"column":16,"index":3235},"end":{"line":159,"column":63,"index":3282}}, + "start":3180,"end":3227,"loc":{"start":{"line":158,"column":16,"index":3180},"end":{"line":158,"column":63,"index":3227}}, "typeAnnotation": { "type": "TSTypeReference", - "start":3237,"end":3282,"loc":{"start":{"line":159,"column":18,"index":3237},"end":{"line":159,"column":63,"index":3282}}, + "start":3182,"end":3227,"loc":{"start":{"line":158,"column":18,"index":3182},"end":{"line":158,"column":63,"index":3227}}, "typeName": { "type": "Identifier", - "start":3237,"end":3249,"loc":{"start":{"line":159,"column":18,"index":3237},"end":{"line":159,"column":30,"index":3249},"identifierName":"ActionObject"}, + "start":3182,"end":3194,"loc":{"start":{"line":158,"column":18,"index":3182},"end":{"line":158,"column":30,"index":3194},"identifierName":"ActionObject"}, "name": "ActionObject" }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start":3249,"end":3282,"loc":{"start":{"line":159,"column":30,"index":3249},"end":{"line":159,"column":63,"index":3282}}, + "start":3194,"end":3227,"loc":{"start":{"line":158,"column":30,"index":3194},"end":{"line":158,"column":63,"index":3227}}, "params": [ { "type": "TSTypeLiteral", - "start":3250,"end":3281,"loc":{"start":{"line":159,"column":31,"index":3250},"end":{"line":159,"column":62,"index":3281}}, + "start":3195,"end":3226,"loc":{"start":{"line":158,"column":31,"index":3195},"end":{"line":158,"column":62,"index":3226}}, "members": [ { "type": "TSPropertySignature", - "start":3252,"end":3265,"loc":{"start":{"line":159,"column":33,"index":3252},"end":{"line":159,"column":46,"index":3265}}, + "start":3197,"end":3210,"loc":{"start":{"line":158,"column":33,"index":3197},"end":{"line":158,"column":46,"index":3210}}, "key": { "type": "Identifier", - "start":3252,"end":3256,"loc":{"start":{"line":159,"column":33,"index":3252},"end":{"line":159,"column":37,"index":3256},"identifierName":"type"}, + "start":3197,"end":3201,"loc":{"start":{"line":158,"column":33,"index":3197},"end":{"line":158,"column":37,"index":3201},"identifierName":"type"}, "name": "type" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start":3256,"end":3264,"loc":{"start":{"line":159,"column":37,"index":3256},"end":{"line":159,"column":45,"index":3264}}, + "start":3201,"end":3209,"loc":{"start":{"line":158,"column":37,"index":3201},"end":{"line":158,"column":45,"index":3209}}, "typeAnnotation": { "type": "TSLiteralType", - "start":3258,"end":3264,"loc":{"start":{"line":159,"column":39,"index":3258},"end":{"line":159,"column":45,"index":3264}}, + "start":3203,"end":3209,"loc":{"start":{"line":158,"column":39,"index":3203},"end":{"line":158,"column":45,"index":3209}}, "literal": { "type": "StringLiteral", - "start":3258,"end":3264,"loc":{"start":{"line":159,"column":39,"index":3258},"end":{"line":159,"column":45,"index":3264}}, + "start":3203,"end":3209,"loc":{"start":{"line":158,"column":39,"index":3203},"end":{"line":158,"column":45,"index":3209}}, "extra": { "rawValue": "PLAY", "raw": "\"PLAY\"" @@ -3625,19 +3660,19 @@ }, { "type": "TSPropertySignature", - "start":3266,"end":3279,"loc":{"start":{"line":159,"column":47,"index":3266},"end":{"line":159,"column":60,"index":3279}}, + "start":3211,"end":3224,"loc":{"start":{"line":158,"column":47,"index":3211},"end":{"line":158,"column":60,"index":3224}}, "key": { "type": "Identifier", - "start":3266,"end":3271,"loc":{"start":{"line":159,"column":47,"index":3266},"end":{"line":159,"column":52,"index":3271},"identifierName":"value"}, + "start":3211,"end":3216,"loc":{"start":{"line":158,"column":47,"index":3211},"end":{"line":158,"column":52,"index":3216},"identifierName":"value"}, "name": "value" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start":3271,"end":3279,"loc":{"start":{"line":159,"column":52,"index":3271},"end":{"line":159,"column":60,"index":3279}}, + "start":3216,"end":3224,"loc":{"start":{"line":158,"column":52,"index":3216},"end":{"line":158,"column":60,"index":3224}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start":3273,"end":3279,"loc":{"start":{"line":159,"column":54,"index":3273},"end":{"line":159,"column":60,"index":3279}} + "start":3218,"end":3224,"loc":{"start":{"line":158,"column":54,"index":3218},"end":{"line":158,"column":60,"index":3224}} } } } @@ -3655,52 +3690,52 @@ }, { "type": "ExpressionStatement", - "start":3285,"end":3356,"loc":{"start":{"line":161,"column":0,"index":3285},"end":{"line":161,"column":71,"index":3356}}, + "start":3230,"end":3301,"loc":{"start":{"line":160,"column":0,"index":3230},"end":{"line":160,"column":71,"index":3301}}, "expression": { "type": "CallExpression", - "start":3285,"end":3355,"loc":{"start":{"line":161,"column":0,"index":3285},"end":{"line":161,"column":70,"index":3355}}, + "start":3230,"end":3300,"loc":{"start":{"line":160,"column":0,"index":3230},"end":{"line":160,"column":70,"index":3300}}, "callee": { "type": "Identifier", - "start":3285,"end":3298,"loc":{"start":{"line":161,"column":0,"index":3285},"end":{"line":161,"column":13,"index":3298},"identifierName":"createMachine"}, + "start":3230,"end":3243,"loc":{"start":{"line":160,"column":0,"index":3230},"end":{"line":160,"column":13,"index":3243},"identifierName":"createMachine"}, "name": "createMachine" }, "arguments": [ { "type": "Identifier", - "start":3352,"end":3354,"loc":{"start":{"line":161,"column":67,"index":3352},"end":{"line":161,"column":69,"index":3354},"identifierName":"qq"}, + "start":3297,"end":3299,"loc":{"start":{"line":160,"column":67,"index":3297},"end":{"line":160,"column":69,"index":3299},"identifierName":"qq"}, "name": "qq" } ], "typeParameters": { "type": "TSTypeParameterInstantiation", - "start":3298,"end":3351,"loc":{"start":{"line":161,"column":13,"index":3298},"end":{"line":161,"column":66,"index":3351}}, + "start":3243,"end":3296,"loc":{"start":{"line":160,"column":13,"index":3243},"end":{"line":160,"column":66,"index":3296}}, "params": [ { "type": "TSUnionType", - "start":3299,"end":3350,"loc":{"start":{"line":161,"column":14,"index":3299},"end":{"line":161,"column":65,"index":3350}}, + "start":3244,"end":3295,"loc":{"start":{"line":160,"column":14,"index":3244},"end":{"line":160,"column":65,"index":3295}}, "types": [ { "type": "TSTypeLiteral", - "start":3299,"end":3330,"loc":{"start":{"line":161,"column":14,"index":3299},"end":{"line":161,"column":45,"index":3330}}, + "start":3244,"end":3275,"loc":{"start":{"line":160,"column":14,"index":3244},"end":{"line":160,"column":45,"index":3275}}, "members": [ { "type": "TSPropertySignature", - "start":3301,"end":3314,"loc":{"start":{"line":161,"column":16,"index":3301},"end":{"line":161,"column":29,"index":3314}}, + "start":3246,"end":3259,"loc":{"start":{"line":160,"column":16,"index":3246},"end":{"line":160,"column":29,"index":3259}}, "key": { "type": "Identifier", - "start":3301,"end":3305,"loc":{"start":{"line":161,"column":16,"index":3301},"end":{"line":161,"column":20,"index":3305},"identifierName":"type"}, + "start":3246,"end":3250,"loc":{"start":{"line":160,"column":16,"index":3246},"end":{"line":160,"column":20,"index":3250},"identifierName":"type"}, "name": "type" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start":3305,"end":3313,"loc":{"start":{"line":161,"column":20,"index":3305},"end":{"line":161,"column":28,"index":3313}}, + "start":3250,"end":3258,"loc":{"start":{"line":160,"column":20,"index":3250},"end":{"line":160,"column":28,"index":3258}}, "typeAnnotation": { "type": "TSLiteralType", - "start":3307,"end":3313,"loc":{"start":{"line":161,"column":22,"index":3307},"end":{"line":161,"column":28,"index":3313}}, + "start":3252,"end":3258,"loc":{"start":{"line":160,"column":22,"index":3252},"end":{"line":160,"column":28,"index":3258}}, "literal": { "type": "StringLiteral", - "start":3307,"end":3313,"loc":{"start":{"line":161,"column":22,"index":3307},"end":{"line":161,"column":28,"index":3313}}, + "start":3252,"end":3258,"loc":{"start":{"line":160,"column":22,"index":3252},"end":{"line":160,"column":28,"index":3258}}, "extra": { "rawValue": "PLAY", "raw": "\"PLAY\"" @@ -3712,19 +3747,19 @@ }, { "type": "TSPropertySignature", - "start":3315,"end":3328,"loc":{"start":{"line":161,"column":30,"index":3315},"end":{"line":161,"column":43,"index":3328}}, + "start":3260,"end":3273,"loc":{"start":{"line":160,"column":30,"index":3260},"end":{"line":160,"column":43,"index":3273}}, "key": { "type": "Identifier", - "start":3315,"end":3320,"loc":{"start":{"line":161,"column":30,"index":3315},"end":{"line":161,"column":35,"index":3320},"identifierName":"value"}, + "start":3260,"end":3265,"loc":{"start":{"line":160,"column":30,"index":3260},"end":{"line":160,"column":35,"index":3265},"identifierName":"value"}, "name": "value" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start":3320,"end":3328,"loc":{"start":{"line":161,"column":35,"index":3320},"end":{"line":161,"column":43,"index":3328}}, + "start":3265,"end":3273,"loc":{"start":{"line":160,"column":35,"index":3265},"end":{"line":160,"column":43,"index":3273}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start":3322,"end":3328,"loc":{"start":{"line":161,"column":37,"index":3322},"end":{"line":161,"column":43,"index":3328}} + "start":3267,"end":3273,"loc":{"start":{"line":160,"column":37,"index":3267},"end":{"line":160,"column":43,"index":3273}} } } } @@ -3732,26 +3767,26 @@ }, { "type": "TSTypeLiteral", - "start":3333,"end":3350,"loc":{"start":{"line":161,"column":48,"index":3333},"end":{"line":161,"column":65,"index":3350}}, + "start":3278,"end":3295,"loc":{"start":{"line":160,"column":48,"index":3278},"end":{"line":160,"column":65,"index":3295}}, "members": [ { "type": "TSPropertySignature", - "start":3335,"end":3348,"loc":{"start":{"line":161,"column":50,"index":3335},"end":{"line":161,"column":63,"index":3348}}, + "start":3280,"end":3293,"loc":{"start":{"line":160,"column":50,"index":3280},"end":{"line":160,"column":63,"index":3293}}, "key": { "type": "Identifier", - "start":3335,"end":3339,"loc":{"start":{"line":161,"column":50,"index":3335},"end":{"line":161,"column":54,"index":3339},"identifierName":"type"}, + "start":3280,"end":3284,"loc":{"start":{"line":160,"column":50,"index":3280},"end":{"line":160,"column":54,"index":3284},"identifierName":"type"}, "name": "type" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start":3339,"end":3348,"loc":{"start":{"line":161,"column":54,"index":3339},"end":{"line":161,"column":63,"index":3348}}, + "start":3284,"end":3293,"loc":{"start":{"line":160,"column":54,"index":3284},"end":{"line":160,"column":63,"index":3293}}, "typeAnnotation": { "type": "TSLiteralType", - "start":3341,"end":3348,"loc":{"start":{"line":161,"column":56,"index":3341},"end":{"line":161,"column":63,"index":3348}}, + "start":3286,"end":3293,"loc":{"start":{"line":160,"column":56,"index":3286},"end":{"line":160,"column":63,"index":3293}}, "literal": { "type": "StringLiteral", - "start":3341,"end":3348,"loc":{"start":{"line":161,"column":56,"index":3341},"end":{"line":161,"column":63,"index":3348}}, + "start":3286,"end":3293,"loc":{"start":{"line":160,"column":56,"index":3286},"end":{"line":160,"column":63,"index":3293}}, "extra": { "rawValue": "RESET", "raw": "\"RESET\"" @@ -3772,7 +3807,7 @@ { "type": "CommentLine", "value": " Error", - "start":3358,"end":3366,"loc":{"start":{"line":161,"column":73,"index":3358},"end":{"line":161,"column":81,"index":3366}} + "start":3303,"end":3311,"loc":{"start":{"line":160,"column":73,"index":3303},"end":{"line":160,"column":81,"index":3311}} } ] } @@ -3887,63 +3922,48 @@ }, { "type": "CommentLine", - "value": " FIXME: this should be recoverable error", - "start":1921,"end":1963,"loc":{"start":{"line":103,"column":0,"index":1921},"end":{"line":103,"column":42,"index":1963}} - }, - { - "type": "CommentLine", - "value": " class C {", - "start":1964,"end":1976,"loc":{"start":{"line":104,"column":0,"index":1964},"end":{"line":104,"column":12,"index":1976}} - }, - { - "type": "CommentLine", - "value": " in a = 0; // Error", - "start":1977,"end":2003,"loc":{"start":{"line":105,"column":0,"index":1977},"end":{"line":105,"column":26,"index":2003}} - }, - { - "type": "CommentLine", - "value": " out b = 0; // Error", - "start":2004,"end":2031,"loc":{"start":{"line":106,"column":0,"index":2004},"end":{"line":106,"column":27,"index":2031}} + "value": " Error", + "start":1946,"end":1954,"loc":{"start":{"line":104,"column":15,"index":1946},"end":{"line":104,"column":23,"index":1954}} }, { "type": "CommentLine", - "value": " }", - "start":2032,"end":2036,"loc":{"start":{"line":107,"column":0,"index":2032},"end":{"line":107,"column":4,"index":2036}} + "value": " Error", + "start":1971,"end":1979,"loc":{"start":{"line":105,"column":16,"index":1971},"end":{"line":105,"column":24,"index":1979}} }, { "type": "CommentLine", "value": " Interface merging", - "start":2038,"end":2058,"loc":{"start":{"line":109,"column":0,"index":2038},"end":{"line":109,"column":20,"index":2058}} + "start":1983,"end":2003,"loc":{"start":{"line":108,"column":0,"index":1983},"end":{"line":108,"column":20,"index":2003}} }, { "type": "CommentLine", "value": " Error", - "start":2186,"end":2194,"loc":{"start":{"line":117,"column":14,"index":2186},"end":{"line":117,"column":22,"index":2194}} + "start":2131,"end":2139,"loc":{"start":{"line":116,"column":14,"index":2131},"end":{"line":116,"column":22,"index":2139}} }, { "type": "CommentLine", "value": " Error", - "start":2209,"end":2217,"loc":{"start":{"line":118,"column":14,"index":2209},"end":{"line":118,"column":22,"index":2217}} + "start":2154,"end":2162,"loc":{"start":{"line":117,"column":14,"index":2154},"end":{"line":117,"column":22,"index":2162}} }, { "type": "CommentLine", "value": " Repro from #44572", - "start":2219,"end":2239,"loc":{"start":{"line":120,"column":0,"index":2219},"end":{"line":120,"column":20,"index":2239}} + "start":2164,"end":2184,"loc":{"start":{"line":119,"column":0,"index":2164},"end":{"line":119,"column":20,"index":2184}} }, { "type": "CommentLine", "value": " Error", - "start":2626,"end":2634,"loc":{"start":{"line":137,"column":39,"index":2626},"end":{"line":137,"column":47,"index":2634}} + "start":2571,"end":2579,"loc":{"start":{"line":136,"column":39,"index":2571},"end":{"line":136,"column":47,"index":2579}} }, { "type": "CommentLine", "value": " Repro from comment in #44572", - "start":2636,"end":2667,"loc":{"start":{"line":139,"column":0,"index":2636},"end":{"line":139,"column":31,"index":2667}} + "start":2581,"end":2612,"loc":{"start":{"line":138,"column":0,"index":2581},"end":{"line":138,"column":31,"index":2612}} }, { "type": "CommentLine", "value": " Error", - "start":3358,"end":3366,"loc":{"start":{"line":161,"column":73,"index":3358},"end":{"line":161,"column":81,"index":3366}} + "start":3303,"end":3311,"loc":{"start":{"line":160,"column":73,"index":3303},"end":{"line":160,"column":81,"index":3311}} } ] } diff --git a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx/input.tsx b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx/input.tsx index b58a9a150b2c..311e850b6319 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx/input.tsx +++ b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations-with-jsx/input.tsx @@ -103,11 +103,10 @@ type T23 = T; // Error declare function f1(x: T): void; // Error declare function f2(): T; // Error -// FIXME: this should be recoverable error -// class C { -// in a = 0; // Error -// out b = 0; // Error -// } +class C { + in a = 0; // Error + out b = 0; // Error +} // Interface merging 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 21458586c9d8..1c4773d8258a 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 @@ -1,6 +1,6 @@ { "type": "File", - "start":0,"end":3401,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":164,"column":81,"index":3401}}, + "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)", @@ -8,11 +8,13 @@ "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: '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":3401,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":164,"column":81,"index":3401}}, + "start":0,"end":3346,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":163,"column":81,"index":3346}}, "sourceType": "module", "interpreter": null, "body": [ @@ -2260,61 +2262,124 @@ "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": " FIXME: this should be recoverable error", - "start":1956,"end":1998,"loc":{"start":{"line":106,"column":0,"index":1956},"end":{"line":106,"column":42,"index":1998}} - }, - { - "type": "CommentLine", - "value": " class C {", - "start":1999,"end":2011,"loc":{"start":{"line":107,"column":0,"index":1999},"end":{"line":107,"column":12,"index":2011}} - }, - { - "type": "CommentLine", - "value": " in a = 0; // Error", - "start":2012,"end":2038,"loc":{"start":{"line":108,"column":0,"index":2012},"end":{"line":108,"column":26,"index":2038}} - }, - { - "type": "CommentLine", - "value": " out b = 0; // Error", - "start":2039,"end":2066,"loc":{"start":{"line":109,"column":0,"index":2039},"end":{"line":109,"column":27,"index":2066}} - }, + } + ], + "leadingComments": [ { "type": "CommentLine", - "value": " }", - "start":2067,"end":2071,"loc":{"start":{"line":110,"column":0,"index":2067},"end":{"line":110,"column":4,"index":2071}} - }, + "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":2073,"end":2093,"loc":{"start":{"line":112,"column":0,"index":2073},"end":{"line":112,"column":20,"index":2093}} + "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":1903,"end":1911,"loc":{"start":{"line":103,"column":40,"index":1903},"end":{"line":103,"column":48,"index":1911}} + "start":1946,"end":1954,"loc":{"start":{"line":104,"column":34,"index":1946},"end":{"line":104,"column":42,"index":1954}} } ] }, { "type": "TSInterfaceDeclaration", - "start":2095,"end":2118,"loc":{"start":{"line":114,"column":0,"index":2095},"end":{"line":114,"column":23,"index":2118}}, + "start":2040,"end":2063,"loc":{"start":{"line":113,"column":0,"index":2040},"end":{"line":113,"column":23,"index":2063}}, "id": { "type": "Identifier", - "start":2105,"end":2108,"loc":{"start":{"line":114,"column":10,"index":2105},"end":{"line":114,"column":13,"index":2108},"identifierName":"Baz"}, + "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":2108,"end":2115,"loc":{"start":{"line":114,"column":13,"index":2108},"end":{"line":114,"column":20,"index":2115}}, + "start":2053,"end":2060,"loc":{"start":{"line":113,"column":13,"index":2053},"end":{"line":113,"column":20,"index":2060}}, "params": [ { "type": "TSTypeParameter", - "start":2109,"end":2114,"loc":{"start":{"line":114,"column":14,"index":2109},"end":{"line":114,"column":19,"index":2114}}, + "start":2054,"end":2059,"loc":{"start":{"line":113,"column":14,"index":2054},"end":{"line":113,"column":19,"index":2059}}, "out": true, "name": "T" } @@ -2322,62 +2387,32 @@ }, "body": { "type": "TSInterfaceBody", - "start":2116,"end":2118,"loc":{"start":{"line":114,"column":21,"index":2116},"end":{"line":114,"column":23,"index":2118}}, + "start":2061,"end":2063,"loc":{"start":{"line":113,"column":21,"index":2061},"end":{"line":113,"column":23,"index":2063}}, "body": [] }, "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": "CommentLine", - "value": " FIXME: this should be recoverable error", - "start":1956,"end":1998,"loc":{"start":{"line":106,"column":0,"index":1956},"end":{"line":106,"column":42,"index":1998}} - }, - { - "type": "CommentLine", - "value": " class C {", - "start":1999,"end":2011,"loc":{"start":{"line":107,"column":0,"index":1999},"end":{"line":107,"column":12,"index":2011}} - }, - { - "type": "CommentLine", - "value": " in a = 0; // Error", - "start":2012,"end":2038,"loc":{"start":{"line":108,"column":0,"index":2012},"end":{"line":108,"column":26,"index":2038}} - }, - { - "type": "CommentLine", - "value": " out b = 0; // Error", - "start":2039,"end":2066,"loc":{"start":{"line":109,"column":0,"index":2039},"end":{"line":109,"column":27,"index":2066}} - }, - { - "type": "CommentLine", - "value": " }", - "start":2067,"end":2071,"loc":{"start":{"line":110,"column":0,"index":2067},"end":{"line":110,"column":4,"index":2071}} - }, { "type": "CommentLine", "value": " Interface merging", - "start":2073,"end":2093,"loc":{"start":{"line":112,"column":0,"index":2073},"end":{"line":112,"column":20,"index":2093}} + "start":2018,"end":2038,"loc":{"start":{"line":111,"column":0,"index":2018},"end":{"line":111,"column":20,"index":2038}} } ] }, { "type": "TSInterfaceDeclaration", - "start":2119,"end":2141,"loc":{"start":{"line":115,"column":0,"index":2119},"end":{"line":115,"column":22,"index":2141}}, + "start":2064,"end":2086,"loc":{"start":{"line":114,"column":0,"index":2064},"end":{"line":114,"column":22,"index":2086}}, "id": { "type": "Identifier", - "start":2129,"end":2132,"loc":{"start":{"line":115,"column":10,"index":2129},"end":{"line":115,"column":13,"index":2132},"identifierName":"Baz"}, + "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":2132,"end":2138,"loc":{"start":{"line":115,"column":13,"index":2132},"end":{"line":115,"column":19,"index":2138}}, + "start":2077,"end":2083,"loc":{"start":{"line":114,"column":13,"index":2077},"end":{"line":114,"column":19,"index":2083}}, "params": [ { "type": "TSTypeParameter", - "start":2133,"end":2137,"loc":{"start":{"line":115,"column":14,"index":2133},"end":{"line":115,"column":18,"index":2137}}, + "start":2078,"end":2082,"loc":{"start":{"line":114,"column":14,"index":2078},"end":{"line":114,"column":18,"index":2082}}, "in": true, "name": "T" } @@ -2385,40 +2420,40 @@ }, "body": { "type": "TSInterfaceBody", - "start":2139,"end":2141,"loc":{"start":{"line":115,"column":20,"index":2139},"end":{"line":115,"column":22,"index":2141}}, + "start":2084,"end":2086,"loc":{"start":{"line":114,"column":20,"index":2084},"end":{"line":114,"column":22,"index":2086}}, "body": [] } }, { "type": "VariableDeclaration", - "start":2143,"end":2174,"loc":{"start":{"line":117,"column":0,"index":2143},"end":{"line":117,"column":31,"index":2174}}, + "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":2155,"end":2173,"loc":{"start":{"line":117,"column":12,"index":2155},"end":{"line":117,"column":30,"index":2173}}, + "start":2100,"end":2118,"loc":{"start":{"line":116,"column":12,"index":2100},"end":{"line":116,"column":30,"index":2118}}, "id": { "type": "Identifier", - "start":2155,"end":2173,"loc":{"start":{"line":117,"column":12,"index":2155},"end":{"line":117,"column":30,"index":2173},"identifierName":"baz1"}, + "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":2159,"end":2173,"loc":{"start":{"line":117,"column":16,"index":2159},"end":{"line":117,"column":30,"index":2173}}, + "start":2104,"end":2118,"loc":{"start":{"line":116,"column":16,"index":2104},"end":{"line":116,"column":30,"index":2118}}, "typeAnnotation": { "type": "TSTypeReference", - "start":2161,"end":2173,"loc":{"start":{"line":117,"column":18,"index":2161},"end":{"line":117,"column":30,"index":2173}}, + "start":2106,"end":2118,"loc":{"start":{"line":116,"column":18,"index":2106},"end":{"line":116,"column":30,"index":2118}}, "typeName": { "type": "Identifier", - "start":2161,"end":2164,"loc":{"start":{"line":117,"column":18,"index":2161},"end":{"line":117,"column":21,"index":2164},"identifierName":"Baz"}, + "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":2164,"end":2173,"loc":{"start":{"line":117,"column":21,"index":2164},"end":{"line":117,"column":30,"index":2173}}, + "start":2109,"end":2118,"loc":{"start":{"line":116,"column":21,"index":2109},"end":{"line":116,"column":30,"index":2118}}, "params": [ { "type": "TSUnknownKeyword", - "start":2165,"end":2172,"loc":{"start":{"line":117,"column":22,"index":2165},"end":{"line":117,"column":29,"index":2172}} + "start":2110,"end":2117,"loc":{"start":{"line":116,"column":22,"index":2110},"end":{"line":116,"column":29,"index":2117}} } ] } @@ -2432,34 +2467,34 @@ }, { "type": "VariableDeclaration", - "start":2175,"end":2205,"loc":{"start":{"line":118,"column":0,"index":2175},"end":{"line":118,"column":30,"index":2205}}, + "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":2187,"end":2204,"loc":{"start":{"line":118,"column":12,"index":2187},"end":{"line":118,"column":29,"index":2204}}, + "start":2132,"end":2149,"loc":{"start":{"line":117,"column":12,"index":2132},"end":{"line":117,"column":29,"index":2149}}, "id": { "type": "Identifier", - "start":2187,"end":2204,"loc":{"start":{"line":118,"column":12,"index":2187},"end":{"line":118,"column":29,"index":2204},"identifierName":"baz2"}, + "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":2191,"end":2204,"loc":{"start":{"line":118,"column":16,"index":2191},"end":{"line":118,"column":29,"index":2204}}, + "start":2136,"end":2149,"loc":{"start":{"line":117,"column":16,"index":2136},"end":{"line":117,"column":29,"index":2149}}, "typeAnnotation": { "type": "TSTypeReference", - "start":2193,"end":2204,"loc":{"start":{"line":118,"column":18,"index":2193},"end":{"line":118,"column":29,"index":2204}}, + "start":2138,"end":2149,"loc":{"start":{"line":117,"column":18,"index":2138},"end":{"line":117,"column":29,"index":2149}}, "typeName": { "type": "Identifier", - "start":2193,"end":2196,"loc":{"start":{"line":118,"column":18,"index":2193},"end":{"line":118,"column":21,"index":2196},"identifierName":"Baz"}, + "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":2196,"end":2204,"loc":{"start":{"line":118,"column":21,"index":2196},"end":{"line":118,"column":29,"index":2204}}, + "start":2141,"end":2149,"loc":{"start":{"line":117,"column":21,"index":2141},"end":{"line":117,"column":29,"index":2149}}, "params": [ { "type": "TSStringKeyword", - "start":2197,"end":2203,"loc":{"start":{"line":118,"column":22,"index":2197},"end":{"line":118,"column":28,"index":2203}} + "start":2142,"end":2148,"loc":{"start":{"line":117,"column":22,"index":2142},"end":{"line":117,"column":28,"index":2148}} } ] } @@ -2473,19 +2508,19 @@ }, { "type": "ExpressionStatement", - "start":2207,"end":2219,"loc":{"start":{"line":120,"column":0,"index":2207},"end":{"line":120,"column":12,"index":2219}}, + "start":2152,"end":2164,"loc":{"start":{"line":119,"column":0,"index":2152},"end":{"line":119,"column":12,"index":2164}}, "expression": { "type": "AssignmentExpression", - "start":2207,"end":2218,"loc":{"start":{"line":120,"column":0,"index":2207},"end":{"line":120,"column":11,"index":2218}}, + "start":2152,"end":2163,"loc":{"start":{"line":119,"column":0,"index":2152},"end":{"line":119,"column":11,"index":2163}}, "operator": "=", "left": { "type": "Identifier", - "start":2207,"end":2211,"loc":{"start":{"line":120,"column":0,"index":2207},"end":{"line":120,"column":4,"index":2211},"identifierName":"baz1"}, + "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":2214,"end":2218,"loc":{"start":{"line":120,"column":7,"index":2214},"end":{"line":120,"column":11,"index":2218},"identifierName":"baz2"}, + "start":2159,"end":2163,"loc":{"start":{"line":119,"column":7,"index":2159},"end":{"line":119,"column":11,"index":2163},"identifierName":"baz2"}, "name": "baz2" } }, @@ -2493,25 +2528,25 @@ { "type": "CommentLine", "value": " Error", - "start":2221,"end":2229,"loc":{"start":{"line":120,"column":14,"index":2221},"end":{"line":120,"column":22,"index":2229}} + "start":2166,"end":2174,"loc":{"start":{"line":119,"column":14,"index":2166},"end":{"line":119,"column":22,"index":2174}} } ] }, { "type": "ExpressionStatement", - "start":2230,"end":2242,"loc":{"start":{"line":121,"column":0,"index":2230},"end":{"line":121,"column":12,"index":2242}}, + "start":2175,"end":2187,"loc":{"start":{"line":120,"column":0,"index":2175},"end":{"line":120,"column":12,"index":2187}}, "expression": { "type": "AssignmentExpression", - "start":2230,"end":2241,"loc":{"start":{"line":121,"column":0,"index":2230},"end":{"line":121,"column":11,"index":2241}}, + "start":2175,"end":2186,"loc":{"start":{"line":120,"column":0,"index":2175},"end":{"line":120,"column":11,"index":2186}}, "operator": "=", "left": { "type": "Identifier", - "start":2230,"end":2234,"loc":{"start":{"line":121,"column":0,"index":2230},"end":{"line":121,"column":4,"index":2234},"identifierName":"baz2"}, + "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":2237,"end":2241,"loc":{"start":{"line":121,"column":7,"index":2237},"end":{"line":121,"column":11,"index":2241},"identifierName":"baz1"}, + "start":2182,"end":2186,"loc":{"start":{"line":120,"column":7,"index":2182},"end":{"line":120,"column":11,"index":2186},"identifierName":"baz1"}, "name": "baz1" } }, @@ -2519,37 +2554,37 @@ { "type": "CommentLine", "value": " Error", - "start":2244,"end":2252,"loc":{"start":{"line":121,"column":14,"index":2244},"end":{"line":121,"column":22,"index":2252}} + "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":2254,"end":2274,"loc":{"start":{"line":123,"column":0,"index":2254},"end":{"line":123,"column":20,"index":2274}} + "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":2221,"end":2229,"loc":{"start":{"line":120,"column":14,"index":2221},"end":{"line":120,"column":22,"index":2229}} + "start":2166,"end":2174,"loc":{"start":{"line":119,"column":14,"index":2166},"end":{"line":119,"column":22,"index":2174}} } ] }, { "type": "TSInterfaceDeclaration", - "start":2276,"end":2361,"loc":{"start":{"line":125,"column":0,"index":2276},"end":{"line":128,"column":1,"index":2361}}, + "start":2221,"end":2306,"loc":{"start":{"line":124,"column":0,"index":2221},"end":{"line":127,"column":1,"index":2306}}, "id": { "type": "Identifier", - "start":2286,"end":2292,"loc":{"start":{"line":125,"column":10,"index":2286},"end":{"line":125,"column":16,"index":2292},"identifierName":"Parent"}, + "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":2292,"end":2299,"loc":{"start":{"line":125,"column":16,"index":2292},"end":{"line":125,"column":23,"index":2299}}, + "start":2237,"end":2244,"loc":{"start":{"line":124,"column":16,"index":2237},"end":{"line":124,"column":23,"index":2244}}, "params": [ { "type": "TSTypeParameter", - "start":2293,"end":2298,"loc":{"start":{"line":125,"column":17,"index":2293},"end":{"line":125,"column":22,"index":2298}}, + "start":2238,"end":2243,"loc":{"start":{"line":124,"column":17,"index":2238},"end":{"line":124,"column":22,"index":2243}}, "out": true, "name": "A" } @@ -2557,42 +2592,42 @@ }, "body": { "type": "TSInterfaceBody", - "start":2300,"end":2361,"loc":{"start":{"line":125,"column":24,"index":2300},"end":{"line":128,"column":1,"index":2361}}, + "start":2245,"end":2306,"loc":{"start":{"line":124,"column":24,"index":2245},"end":{"line":127,"column":1,"index":2306}}, "body": [ { "type": "TSPropertySignature", - "start":2306,"end":2329,"loc":{"start":{"line":126,"column":4,"index":2306},"end":{"line":126,"column":27,"index":2329}}, + "start":2251,"end":2274,"loc":{"start":{"line":125,"column":4,"index":2251},"end":{"line":125,"column":27,"index":2274}}, "key": { "type": "Identifier", - "start":2306,"end":2311,"loc":{"start":{"line":126,"column":4,"index":2306},"end":{"line":126,"column":9,"index":2311},"identifierName":"child"}, + "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":2311,"end":2328,"loc":{"start":{"line":126,"column":9,"index":2311},"end":{"line":126,"column":26,"index":2328}}, + "start":2256,"end":2273,"loc":{"start":{"line":125,"column":9,"index":2256},"end":{"line":125,"column":26,"index":2273}}, "typeAnnotation": { "type": "TSUnionType", - "start":2313,"end":2328,"loc":{"start":{"line":126,"column":11,"index":2313},"end":{"line":126,"column":26,"index":2328}}, + "start":2258,"end":2273,"loc":{"start":{"line":125,"column":11,"index":2258},"end":{"line":125,"column":26,"index":2273}}, "types": [ { "type": "TSTypeReference", - "start":2313,"end":2321,"loc":{"start":{"line":126,"column":11,"index":2313},"end":{"line":126,"column":19,"index":2321}}, + "start":2258,"end":2266,"loc":{"start":{"line":125,"column":11,"index":2258},"end":{"line":125,"column":19,"index":2266}}, "typeName": { "type": "Identifier", - "start":2313,"end":2318,"loc":{"start":{"line":126,"column":11,"index":2313},"end":{"line":126,"column":16,"index":2318},"identifierName":"Child"}, + "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":2318,"end":2321,"loc":{"start":{"line":126,"column":16,"index":2318},"end":{"line":126,"column":19,"index":2321}}, + "start":2263,"end":2266,"loc":{"start":{"line":125,"column":16,"index":2263},"end":{"line":125,"column":19,"index":2266}}, "params": [ { "type": "TSTypeReference", - "start":2319,"end":2320,"loc":{"start":{"line":126,"column":17,"index":2319},"end":{"line":126,"column":18,"index":2320}}, + "start":2264,"end":2265,"loc":{"start":{"line":125,"column":17,"index":2264},"end":{"line":125,"column":18,"index":2265}}, "typeName": { "type": "Identifier", - "start":2319,"end":2320,"loc":{"start":{"line":126,"column":17,"index":2319},"end":{"line":126,"column":18,"index":2320},"identifierName":"A"}, + "start":2264,"end":2265,"loc":{"start":{"line":125,"column":17,"index":2264},"end":{"line":125,"column":18,"index":2265},"identifierName":"A"}, "name": "A" } } @@ -2601,7 +2636,7 @@ }, { "type": "TSNullKeyword", - "start":2324,"end":2328,"loc":{"start":{"line":126,"column":22,"index":2324},"end":{"line":126,"column":26,"index":2328}} + "start":2269,"end":2273,"loc":{"start":{"line":125,"column":22,"index":2269},"end":{"line":125,"column":26,"index":2273}} } ] } @@ -2609,38 +2644,38 @@ }, { "type": "TSPropertySignature", - "start":2334,"end":2359,"loc":{"start":{"line":127,"column":4,"index":2334},"end":{"line":127,"column":29,"index":2359}}, + "start":2279,"end":2304,"loc":{"start":{"line":126,"column":4,"index":2279},"end":{"line":126,"column":29,"index":2304}}, "key": { "type": "Identifier", - "start":2334,"end":2340,"loc":{"start":{"line":127,"column":4,"index":2334},"end":{"line":127,"column":10,"index":2340},"identifierName":"parent"}, + "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":2340,"end":2358,"loc":{"start":{"line":127,"column":10,"index":2340},"end":{"line":127,"column":28,"index":2358}}, + "start":2285,"end":2303,"loc":{"start":{"line":126,"column":10,"index":2285},"end":{"line":126,"column":28,"index":2303}}, "typeAnnotation": { "type": "TSUnionType", - "start":2342,"end":2358,"loc":{"start":{"line":127,"column":12,"index":2342},"end":{"line":127,"column":28,"index":2358}}, + "start":2287,"end":2303,"loc":{"start":{"line":126,"column":12,"index":2287},"end":{"line":126,"column":28,"index":2303}}, "types": [ { "type": "TSTypeReference", - "start":2342,"end":2351,"loc":{"start":{"line":127,"column":12,"index":2342},"end":{"line":127,"column":21,"index":2351}}, + "start":2287,"end":2296,"loc":{"start":{"line":126,"column":12,"index":2287},"end":{"line":126,"column":21,"index":2296}}, "typeName": { "type": "Identifier", - "start":2342,"end":2348,"loc":{"start":{"line":127,"column":12,"index":2342},"end":{"line":127,"column":18,"index":2348},"identifierName":"Parent"}, + "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":2348,"end":2351,"loc":{"start":{"line":127,"column":18,"index":2348},"end":{"line":127,"column":21,"index":2351}}, + "start":2293,"end":2296,"loc":{"start":{"line":126,"column":18,"index":2293},"end":{"line":126,"column":21,"index":2296}}, "params": [ { "type": "TSTypeReference", - "start":2349,"end":2350,"loc":{"start":{"line":127,"column":19,"index":2349},"end":{"line":127,"column":20,"index":2350}}, + "start":2294,"end":2295,"loc":{"start":{"line":126,"column":19,"index":2294},"end":{"line":126,"column":20,"index":2295}}, "typeName": { "type": "Identifier", - "start":2349,"end":2350,"loc":{"start":{"line":127,"column":19,"index":2349},"end":{"line":127,"column":20,"index":2350},"identifierName":"A"}, + "start":2294,"end":2295,"loc":{"start":{"line":126,"column":19,"index":2294},"end":{"line":126,"column":20,"index":2295},"identifierName":"A"}, "name": "A" } } @@ -2649,7 +2684,7 @@ }, { "type": "TSNullKeyword", - "start":2354,"end":2358,"loc":{"start":{"line":127,"column":24,"index":2354},"end":{"line":127,"column":28,"index":2358}} + "start":2299,"end":2303,"loc":{"start":{"line":126,"column":24,"index":2299},"end":{"line":126,"column":28,"index":2303}} } ] } @@ -2661,39 +2696,39 @@ { "type": "CommentLine", "value": " Error", - "start":2244,"end":2252,"loc":{"start":{"line":121,"column":14,"index":2244},"end":{"line":121,"column":22,"index":2252}} + "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":2254,"end":2274,"loc":{"start":{"line":123,"column":0,"index":2254},"end":{"line":123,"column":20,"index":2274}} + "start":2199,"end":2219,"loc":{"start":{"line":122,"column":0,"index":2199},"end":{"line":122,"column":20,"index":2219}} } ] }, { "type": "TSInterfaceDeclaration", - "start":2363,"end":2454,"loc":{"start":{"line":130,"column":0,"index":2363},"end":{"line":133,"column":1,"index":2454}}, + "start":2308,"end":2399,"loc":{"start":{"line":129,"column":0,"index":2308},"end":{"line":132,"column":1,"index":2399}}, "id": { "type": "Identifier", - "start":2373,"end":2378,"loc":{"start":{"line":130,"column":10,"index":2373},"end":{"line":130,"column":15,"index":2378},"identifierName":"Child"}, + "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":2378,"end":2394,"loc":{"start":{"line":130,"column":15,"index":2378},"end":{"line":130,"column":31,"index":2394}}, + "start":2323,"end":2339,"loc":{"start":{"line":129,"column":15,"index":2323},"end":{"line":129,"column":31,"index":2339}}, "params": [ { "type": "TSTypeParameter", - "start":2379,"end":2380,"loc":{"start":{"line":130,"column":16,"index":2379},"end":{"line":130,"column":17,"index":2380}}, + "start":2324,"end":2325,"loc":{"start":{"line":129,"column":16,"index":2324},"end":{"line":129,"column":17,"index":2325}}, "name": "A" }, { "type": "TSTypeParameter", - "start":2382,"end":2393,"loc":{"start":{"line":130,"column":19,"index":2382},"end":{"line":130,"column":30,"index":2393}}, + "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":2386,"end":2393,"loc":{"start":{"line":130,"column":23,"index":2386},"end":{"line":130,"column":30,"index":2393}} + "start":2331,"end":2338,"loc":{"start":{"line":129,"column":23,"index":2331},"end":{"line":129,"column":30,"index":2338}} } } ] @@ -2701,22 +2736,22 @@ "extends": [ { "type": "TSExpressionWithTypeArguments", - "start":2403,"end":2412,"loc":{"start":{"line":130,"column":40,"index":2403},"end":{"line":130,"column":49,"index":2412}}, + "start":2348,"end":2357,"loc":{"start":{"line":129,"column":40,"index":2348},"end":{"line":129,"column":49,"index":2357}}, "expression": { "type": "Identifier", - "start":2403,"end":2409,"loc":{"start":{"line":130,"column":40,"index":2403},"end":{"line":130,"column":46,"index":2409},"identifierName":"Parent"}, + "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":2409,"end":2412,"loc":{"start":{"line":130,"column":46,"index":2409},"end":{"line":130,"column":49,"index":2412}}, + "start":2354,"end":2357,"loc":{"start":{"line":129,"column":46,"index":2354},"end":{"line":129,"column":49,"index":2357}}, "params": [ { "type": "TSTypeReference", - "start":2410,"end":2411,"loc":{"start":{"line":130,"column":47,"index":2410},"end":{"line":130,"column":48,"index":2411}}, + "start":2355,"end":2356,"loc":{"start":{"line":129,"column":47,"index":2355},"end":{"line":129,"column":48,"index":2356}}, "typeName": { "type": "Identifier", - "start":2410,"end":2411,"loc":{"start":{"line":130,"column":47,"index":2410},"end":{"line":130,"column":48,"index":2411},"identifierName":"A"}, + "start":2355,"end":2356,"loc":{"start":{"line":129,"column":47,"index":2355},"end":{"line":129,"column":48,"index":2356},"identifierName":"A"}, "name": "A" } } @@ -2726,27 +2761,27 @@ ], "body": { "type": "TSInterfaceBody", - "start":2413,"end":2454,"loc":{"start":{"line":130,"column":50,"index":2413},"end":{"line":133,"column":1,"index":2454}}, + "start":2358,"end":2399,"loc":{"start":{"line":129,"column":50,"index":2358},"end":{"line":132,"column":1,"index":2399}}, "body": [ { "type": "TSPropertySignature", - "start":2419,"end":2433,"loc":{"start":{"line":131,"column":4,"index":2419},"end":{"line":131,"column":18,"index":2433}}, + "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":2428,"end":2429,"loc":{"start":{"line":131,"column":13,"index":2428},"end":{"line":131,"column":14,"index":2429},"identifierName":"a"}, + "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":2429,"end":2432,"loc":{"start":{"line":131,"column":14,"index":2429},"end":{"line":131,"column":17,"index":2432}}, + "start":2374,"end":2377,"loc":{"start":{"line":130,"column":14,"index":2374},"end":{"line":130,"column":17,"index":2377}}, "typeAnnotation": { "type": "TSTypeReference", - "start":2431,"end":2432,"loc":{"start":{"line":131,"column":16,"index":2431},"end":{"line":131,"column":17,"index":2432}}, + "start":2376,"end":2377,"loc":{"start":{"line":130,"column":16,"index":2376},"end":{"line":130,"column":17,"index":2377}}, "typeName": { "type": "Identifier", - "start":2431,"end":2432,"loc":{"start":{"line":131,"column":16,"index":2431},"end":{"line":131,"column":17,"index":2432},"identifierName":"A"}, + "start":2376,"end":2377,"loc":{"start":{"line":130,"column":16,"index":2376},"end":{"line":130,"column":17,"index":2377},"identifierName":"A"}, "name": "A" } } @@ -2754,23 +2789,23 @@ }, { "type": "TSPropertySignature", - "start":2438,"end":2452,"loc":{"start":{"line":132,"column":4,"index":2438},"end":{"line":132,"column":18,"index":2452}}, + "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":2447,"end":2448,"loc":{"start":{"line":132,"column":13,"index":2447},"end":{"line":132,"column":14,"index":2448},"identifierName":"b"}, + "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":2448,"end":2451,"loc":{"start":{"line":132,"column":14,"index":2448},"end":{"line":132,"column":17,"index":2451}}, + "start":2393,"end":2396,"loc":{"start":{"line":131,"column":14,"index":2393},"end":{"line":131,"column":17,"index":2396}}, "typeAnnotation": { "type": "TSTypeReference", - "start":2450,"end":2451,"loc":{"start":{"line":132,"column":16,"index":2450},"end":{"line":132,"column":17,"index":2451}}, + "start":2395,"end":2396,"loc":{"start":{"line":131,"column":16,"index":2395},"end":{"line":131,"column":17,"index":2396}}, "typeName": { "type": "Identifier", - "start":2450,"end":2451,"loc":{"start":{"line":132,"column":16,"index":2450},"end":{"line":132,"column":17,"index":2451},"identifierName":"B"}, + "start":2395,"end":2396,"loc":{"start":{"line":131,"column":16,"index":2395},"end":{"line":131,"column":17,"index":2396},"identifierName":"B"}, "name": "B" } } @@ -2781,21 +2816,21 @@ }, { "type": "FunctionDeclaration", - "start":2456,"end":2524,"loc":{"start":{"line":135,"column":0,"index":2456},"end":{"line":137,"column":1,"index":2524}}, + "start":2401,"end":2469,"loc":{"start":{"line":134,"column":0,"index":2401},"end":{"line":136,"column":1,"index":2469}}, "id": { "type": "Identifier", - "start":2465,"end":2467,"loc":{"start":{"line":135,"column":9,"index":2465},"end":{"line":135,"column":11,"index":2467},"identifierName":"fn"}, + "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":2467,"end":2470,"loc":{"start":{"line":135,"column":11,"index":2467},"end":{"line":135,"column":14,"index":2470}}, + "start":2412,"end":2415,"loc":{"start":{"line":134,"column":11,"index":2412},"end":{"line":134,"column":14,"index":2415}}, "params": [ { "type": "TSTypeParameter", - "start":2468,"end":2469,"loc":{"start":{"line":135,"column":12,"index":2468},"end":{"line":135,"column":13,"index":2469}}, + "start":2413,"end":2414,"loc":{"start":{"line":134,"column":12,"index":2413},"end":{"line":134,"column":13,"index":2414}}, "name": "A" } ] @@ -2803,29 +2838,29 @@ "params": [ { "type": "Identifier", - "start":2471,"end":2484,"loc":{"start":{"line":135,"column":15,"index":2471},"end":{"line":135,"column":28,"index":2484},"identifierName":"inp"}, + "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":2474,"end":2484,"loc":{"start":{"line":135,"column":18,"index":2474},"end":{"line":135,"column":28,"index":2484}}, + "start":2419,"end":2429,"loc":{"start":{"line":134,"column":18,"index":2419},"end":{"line":134,"column":28,"index":2429}}, "typeAnnotation": { "type": "TSTypeReference", - "start":2476,"end":2484,"loc":{"start":{"line":135,"column":20,"index":2476},"end":{"line":135,"column":28,"index":2484}}, + "start":2421,"end":2429,"loc":{"start":{"line":134,"column":20,"index":2421},"end":{"line":134,"column":28,"index":2429}}, "typeName": { "type": "Identifier", - "start":2476,"end":2481,"loc":{"start":{"line":135,"column":20,"index":2476},"end":{"line":135,"column":25,"index":2481},"identifierName":"Child"}, + "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":2481,"end":2484,"loc":{"start":{"line":135,"column":25,"index":2481},"end":{"line":135,"column":28,"index":2484}}, + "start":2426,"end":2429,"loc":{"start":{"line":134,"column":25,"index":2426},"end":{"line":134,"column":28,"index":2429}}, "params": [ { "type": "TSTypeReference", - "start":2482,"end":2483,"loc":{"start":{"line":135,"column":26,"index":2482},"end":{"line":135,"column":27,"index":2483}}, + "start":2427,"end":2428,"loc":{"start":{"line":134,"column":26,"index":2427},"end":{"line":134,"column":27,"index":2428}}, "typeName": { "type": "Identifier", - "start":2482,"end":2483,"loc":{"start":{"line":135,"column":26,"index":2482},"end":{"line":135,"column":27,"index":2483},"identifierName":"A"}, + "start":2427,"end":2428,"loc":{"start":{"line":134,"column":26,"index":2427},"end":{"line":134,"column":27,"index":2428},"identifierName":"A"}, "name": "A" } } @@ -2837,37 +2872,37 @@ ], "body": { "type": "BlockStatement", - "start":2486,"end":2524,"loc":{"start":{"line":135,"column":30,"index":2486},"end":{"line":137,"column":1,"index":2524}}, + "start":2431,"end":2469,"loc":{"start":{"line":134,"column":30,"index":2431},"end":{"line":136,"column":1,"index":2469}}, "body": [ { "type": "VariableDeclaration", - "start":2492,"end":2522,"loc":{"start":{"line":136,"column":4,"index":2492},"end":{"line":136,"column":34,"index":2522}}, + "start":2437,"end":2467,"loc":{"start":{"line":135,"column":4,"index":2437},"end":{"line":135,"column":34,"index":2467}}, "declarations": [ { "type": "VariableDeclarator", - "start":2498,"end":2521,"loc":{"start":{"line":136,"column":10,"index":2498},"end":{"line":136,"column":33,"index":2521}}, + "start":2443,"end":2466,"loc":{"start":{"line":135,"column":10,"index":2443},"end":{"line":135,"column":33,"index":2466}}, "id": { "type": "Identifier", - "start":2498,"end":2515,"loc":{"start":{"line":136,"column":10,"index":2498},"end":{"line":136,"column":27,"index":2515},"identifierName":"a"}, + "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":2499,"end":2515,"loc":{"start":{"line":136,"column":11,"index":2499},"end":{"line":136,"column":27,"index":2515}}, + "start":2444,"end":2460,"loc":{"start":{"line":135,"column":11,"index":2444},"end":{"line":135,"column":27,"index":2460}}, "typeAnnotation": { "type": "TSTypeReference", - "start":2501,"end":2515,"loc":{"start":{"line":136,"column":13,"index":2501},"end":{"line":136,"column":27,"index":2515}}, + "start":2446,"end":2460,"loc":{"start":{"line":135,"column":13,"index":2446},"end":{"line":135,"column":27,"index":2460}}, "typeName": { "type": "Identifier", - "start":2501,"end":2506,"loc":{"start":{"line":136,"column":13,"index":2501},"end":{"line":136,"column":18,"index":2506},"identifierName":"Child"}, + "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":2506,"end":2515,"loc":{"start":{"line":136,"column":18,"index":2506},"end":{"line":136,"column":27,"index":2515}}, + "start":2451,"end":2460,"loc":{"start":{"line":135,"column":18,"index":2451},"end":{"line":135,"column":27,"index":2460}}, "params": [ { "type": "TSUnknownKeyword", - "start":2507,"end":2514,"loc":{"start":{"line":136,"column":19,"index":2507},"end":{"line":136,"column":26,"index":2514}} + "start":2452,"end":2459,"loc":{"start":{"line":135,"column":19,"index":2452},"end":{"line":135,"column":26,"index":2459}} } ] } @@ -2876,7 +2911,7 @@ }, "init": { "type": "Identifier", - "start":2518,"end":2521,"loc":{"start":{"line":136,"column":30,"index":2518},"end":{"line":136,"column":33,"index":2521},"identifierName":"inp"}, + "start":2463,"end":2466,"loc":{"start":{"line":135,"column":30,"index":2463},"end":{"line":135,"column":33,"index":2466},"identifierName":"inp"}, "name": "inp" } } @@ -2889,33 +2924,33 @@ }, { "type": "VariableDeclaration", - "start":2526,"end":2621,"loc":{"start":{"line":139,"column":0,"index":2526},"end":{"line":139,"column":95,"index":2621}}, + "start":2471,"end":2566,"loc":{"start":{"line":138,"column":0,"index":2471},"end":{"line":138,"column":95,"index":2566}}, "declarations": [ { "type": "VariableDeclarator", - "start":2532,"end":2620,"loc":{"start":{"line":139,"column":6,"index":2532},"end":{"line":139,"column":94,"index":2620}}, + "start":2477,"end":2565,"loc":{"start":{"line":138,"column":6,"index":2477},"end":{"line":138,"column":94,"index":2565}}, "id": { "type": "Identifier", - "start":2532,"end":2551,"loc":{"start":{"line":139,"column":6,"index":2532},"end":{"line":139,"column":25,"index":2551},"identifierName":"pu"}, + "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":2534,"end":2551,"loc":{"start":{"line":139,"column":8,"index":2534},"end":{"line":139,"column":25,"index":2551}}, + "start":2479,"end":2496,"loc":{"start":{"line":138,"column":8,"index":2479},"end":{"line":138,"column":25,"index":2496}}, "typeAnnotation": { "type": "TSTypeReference", - "start":2536,"end":2551,"loc":{"start":{"line":139,"column":10,"index":2536},"end":{"line":139,"column":25,"index":2551}}, + "start":2481,"end":2496,"loc":{"start":{"line":138,"column":10,"index":2481},"end":{"line":138,"column":25,"index":2496}}, "typeName": { "type": "Identifier", - "start":2536,"end":2542,"loc":{"start":{"line":139,"column":10,"index":2536},"end":{"line":139,"column":16,"index":2542},"identifierName":"Parent"}, + "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":2542,"end":2551,"loc":{"start":{"line":139,"column":16,"index":2542},"end":{"line":139,"column":25,"index":2551}}, + "start":2487,"end":2496,"loc":{"start":{"line":138,"column":16,"index":2487},"end":{"line":138,"column":25,"index":2496}}, "params": [ { "type": "TSUnknownKeyword", - "start":2543,"end":2550,"loc":{"start":{"line":139,"column":17,"index":2543},"end":{"line":139,"column":24,"index":2550}} + "start":2488,"end":2495,"loc":{"start":{"line":138,"column":17,"index":2488},"end":{"line":138,"column":24,"index":2495}} } ] } @@ -2924,37 +2959,37 @@ }, "init": { "type": "ObjectExpression", - "start":2554,"end":2620,"loc":{"start":{"line":139,"column":28,"index":2554},"end":{"line":139,"column":94,"index":2620}}, + "start":2499,"end":2565,"loc":{"start":{"line":138,"column":28,"index":2499},"end":{"line":138,"column":94,"index":2565}}, "properties": [ { "type": "ObjectProperty", - "start":2556,"end":2604,"loc":{"start":{"line":139,"column":30,"index":2556},"end":{"line":139,"column":78,"index":2604}}, + "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":2556,"end":2561,"loc":{"start":{"line":139,"column":30,"index":2556},"end":{"line":139,"column":35,"index":2561},"identifierName":"child"}, + "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":2563,"end":2604,"loc":{"start":{"line":139,"column":37,"index":2563},"end":{"line":139,"column":78,"index":2604}}, + "start":2508,"end":2549,"loc":{"start":{"line":138,"column":37,"index":2508},"end":{"line":138,"column":78,"index":2549}}, "properties": [ { "type": "ObjectProperty", - "start":2565,"end":2569,"loc":{"start":{"line":139,"column":39,"index":2565},"end":{"line":139,"column":43,"index":2569}}, + "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":2565,"end":2566,"loc":{"start":{"line":139,"column":39,"index":2565},"end":{"line":139,"column":40,"index":2566},"identifierName":"a"}, + "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":2568,"end":2569,"loc":{"start":{"line":139,"column":42,"index":2568},"end":{"line":139,"column":43,"index":2569}}, + "start":2513,"end":2514,"loc":{"start":{"line":138,"column":42,"index":2513},"end":{"line":138,"column":43,"index":2514}}, "extra": { "rawValue": 0, "raw": "0" @@ -2964,18 +2999,18 @@ }, { "type": "ObjectProperty", - "start":2571,"end":2575,"loc":{"start":{"line":139,"column":45,"index":2571},"end":{"line":139,"column":49,"index":2575}}, + "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":2571,"end":2572,"loc":{"start":{"line":139,"column":45,"index":2571},"end":{"line":139,"column":46,"index":2572},"identifierName":"b"}, + "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":2574,"end":2575,"loc":{"start":{"line":139,"column":48,"index":2574},"end":{"line":139,"column":49,"index":2575}}, + "start":2519,"end":2520,"loc":{"start":{"line":138,"column":48,"index":2519},"end":{"line":138,"column":49,"index":2520}}, "extra": { "rawValue": 0, "raw": "0" @@ -2985,34 +3020,34 @@ }, { "type": "ObjectProperty", - "start":2577,"end":2588,"loc":{"start":{"line":139,"column":51,"index":2577},"end":{"line":139,"column":62,"index":2588}}, + "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":2577,"end":2582,"loc":{"start":{"line":139,"column":51,"index":2577},"end":{"line":139,"column":56,"index":2582},"identifierName":"child"}, + "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":2584,"end":2588,"loc":{"start":{"line":139,"column":58,"index":2584},"end":{"line":139,"column":62,"index":2588}} + "start":2529,"end":2533,"loc":{"start":{"line":138,"column":58,"index":2529},"end":{"line":138,"column":62,"index":2533}} } }, { "type": "ObjectProperty", - "start":2590,"end":2602,"loc":{"start":{"line":139,"column":64,"index":2590},"end":{"line":139,"column":76,"index":2602}}, + "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":2590,"end":2596,"loc":{"start":{"line":139,"column":64,"index":2590},"end":{"line":139,"column":70,"index":2596},"identifierName":"parent"}, + "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":2598,"end":2602,"loc":{"start":{"line":139,"column":72,"index":2598},"end":{"line":139,"column":76,"index":2602}} + "start":2543,"end":2547,"loc":{"start":{"line":138,"column":72,"index":2543},"end":{"line":138,"column":76,"index":2547}} } } ] @@ -3020,18 +3055,18 @@ }, { "type": "ObjectProperty", - "start":2606,"end":2618,"loc":{"start":{"line":139,"column":80,"index":2606},"end":{"line":139,"column":92,"index":2618}}, + "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":2606,"end":2612,"loc":{"start":{"line":139,"column":80,"index":2606},"end":{"line":139,"column":86,"index":2612},"identifierName":"parent"}, + "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":2614,"end":2618,"loc":{"start":{"line":139,"column":88,"index":2614},"end":{"line":139,"column":92,"index":2618}} + "start":2559,"end":2563,"loc":{"start":{"line":138,"column":88,"index":2559},"end":{"line":138,"column":92,"index":2563}} } } ] @@ -3042,33 +3077,33 @@ }, { "type": "VariableDeclaration", - "start":2622,"end":2659,"loc":{"start":{"line":140,"column":0,"index":2622},"end":{"line":140,"column":37,"index":2659}}, + "start":2567,"end":2604,"loc":{"start":{"line":139,"column":0,"index":2567},"end":{"line":139,"column":37,"index":2604}}, "declarations": [ { "type": "VariableDeclarator", - "start":2628,"end":2658,"loc":{"start":{"line":140,"column":6,"index":2628},"end":{"line":140,"column":36,"index":2658}}, + "start":2573,"end":2603,"loc":{"start":{"line":139,"column":6,"index":2573},"end":{"line":139,"column":36,"index":2603}}, "id": { "type": "Identifier", - "start":2628,"end":2653,"loc":{"start":{"line":140,"column":6,"index":2628},"end":{"line":140,"column":31,"index":2653},"identifierName":"notString"}, + "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":2637,"end":2653,"loc":{"start":{"line":140,"column":15,"index":2637},"end":{"line":140,"column":31,"index":2653}}, + "start":2582,"end":2598,"loc":{"start":{"line":139,"column":15,"index":2582},"end":{"line":139,"column":31,"index":2598}}, "typeAnnotation": { "type": "TSTypeReference", - "start":2639,"end":2653,"loc":{"start":{"line":140,"column":17,"index":2639},"end":{"line":140,"column":31,"index":2653}}, + "start":2584,"end":2598,"loc":{"start":{"line":139,"column":17,"index":2584},"end":{"line":139,"column":31,"index":2598}}, "typeName": { "type": "Identifier", - "start":2639,"end":2645,"loc":{"start":{"line":140,"column":17,"index":2639},"end":{"line":140,"column":23,"index":2645},"identifierName":"Parent"}, + "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":2645,"end":2653,"loc":{"start":{"line":140,"column":23,"index":2645},"end":{"line":140,"column":31,"index":2653}}, + "start":2590,"end":2598,"loc":{"start":{"line":139,"column":23,"index":2590},"end":{"line":139,"column":31,"index":2598}}, "params": [ { "type": "TSStringKeyword", - "start":2646,"end":2652,"loc":{"start":{"line":140,"column":24,"index":2646},"end":{"line":140,"column":30,"index":2652}} + "start":2591,"end":2597,"loc":{"start":{"line":139,"column":24,"index":2591},"end":{"line":139,"column":30,"index":2597}} } ] } @@ -3077,7 +3112,7 @@ }, "init": { "type": "Identifier", - "start":2656,"end":2658,"loc":{"start":{"line":140,"column":34,"index":2656},"end":{"line":140,"column":36,"index":2658},"identifierName":"pu"}, + "start":2601,"end":2603,"loc":{"start":{"line":139,"column":34,"index":2601},"end":{"line":139,"column":36,"index":2603},"identifierName":"pu"}, "name": "pu" } } @@ -3087,58 +3122,58 @@ { "type": "CommentLine", "value": " Error", - "start":2661,"end":2669,"loc":{"start":{"line":140,"column":39,"index":2661},"end":{"line":140,"column":47,"index":2669}} + "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":2671,"end":2702,"loc":{"start":{"line":142,"column":0,"index":2671},"end":{"line":142,"column":31,"index":2702}} + "start":2616,"end":2647,"loc":{"start":{"line":141,"column":0,"index":2616},"end":{"line":141,"column":31,"index":2647}} } ] }, { "type": "ClassDeclaration", - "start":2704,"end":2880,"loc":{"start":{"line":144,"column":0,"index":2704},"end":{"line":148,"column":1,"index":2880}}, + "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":2718,"end":2727,"loc":{"start":{"line":144,"column":14,"index":2718},"end":{"line":144,"column":23,"index":2727},"identifierName":"StateNode"}, + "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":2727,"end":2777,"loc":{"start":{"line":144,"column":23,"index":2727},"end":{"line":144,"column":73,"index":2777}}, + "start":2672,"end":2722,"loc":{"start":{"line":143,"column":23,"index":2672},"end":{"line":143,"column":73,"index":2722}}, "params": [ { "type": "TSTypeParameter", - "start":2728,"end":2736,"loc":{"start":{"line":144,"column":24,"index":2728},"end":{"line":144,"column":32,"index":2736}}, + "start":2673,"end":2681,"loc":{"start":{"line":143,"column":24,"index":2673},"end":{"line":143,"column":32,"index":2681}}, "name": "TContext" }, { "type": "TSTypeParameter", - "start":2738,"end":2776,"loc":{"start":{"line":144,"column":34,"index":2738},"end":{"line":144,"column":72,"index":2776}}, + "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":2760,"end":2776,"loc":{"start":{"line":144,"column":56,"index":2760},"end":{"line":144,"column":72,"index":2776}}, + "start":2705,"end":2721,"loc":{"start":{"line":143,"column":56,"index":2705},"end":{"line":143,"column":72,"index":2721}}, "members": [ { "type": "TSPropertySignature", - "start":2762,"end":2774,"loc":{"start":{"line":144,"column":58,"index":2762},"end":{"line":144,"column":70,"index":2774}}, + "start":2707,"end":2719,"loc":{"start":{"line":143,"column":58,"index":2707},"end":{"line":143,"column":70,"index":2719}}, "key": { "type": "Identifier", - "start":2762,"end":2766,"loc":{"start":{"line":144,"column":58,"index":2762},"end":{"line":144,"column":62,"index":2766},"identifierName":"type"}, + "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":2766,"end":2774,"loc":{"start":{"line":144,"column":62,"index":2766},"end":{"line":144,"column":70,"index":2774}}, + "start":2711,"end":2719,"loc":{"start":{"line":143,"column":62,"index":2711},"end":{"line":143,"column":70,"index":2719}}, "typeAnnotation": { "type": "TSStringKeyword", - "start":2768,"end":2774,"loc":{"start":{"line":144,"column":64,"index":2768},"end":{"line":144,"column":70,"index":2774}} + "start":2713,"end":2719,"loc":{"start":{"line":143,"column":64,"index":2713},"end":{"line":143,"column":70,"index":2719}} } } } @@ -3150,27 +3185,27 @@ "superClass": null, "body": { "type": "ClassBody", - "start":2778,"end":2880,"loc":{"start":{"line":144,"column":74,"index":2778},"end":{"line":148,"column":1,"index":2880}}, + "start":2723,"end":2825,"loc":{"start":{"line":143,"column":74,"index":2723},"end":{"line":147,"column":1,"index":2825}}, "body": [ { "type": "ClassProperty", - "start":2784,"end":2805,"loc":{"start":{"line":145,"column":4,"index":2784},"end":{"line":145,"column":25,"index":2805}}, + "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":2784,"end":2796,"loc":{"start":{"line":145,"column":4,"index":2784},"end":{"line":145,"column":16,"index":2796},"identifierName":"_storedEvent"}, + "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":2796,"end":2804,"loc":{"start":{"line":145,"column":16,"index":2796},"end":{"line":145,"column":24,"index":2804}}, + "start":2741,"end":2749,"loc":{"start":{"line":144,"column":16,"index":2741},"end":{"line":144,"column":24,"index":2749}}, "typeAnnotation": { "type": "TSTypeReference", - "start":2798,"end":2804,"loc":{"start":{"line":145,"column":18,"index":2798},"end":{"line":145,"column":24,"index":2804}}, + "start":2743,"end":2749,"loc":{"start":{"line":144,"column":18,"index":2743},"end":{"line":144,"column":24,"index":2749}}, "typeName": { "type": "Identifier", - "start":2798,"end":2804,"loc":{"start":{"line":145,"column":18,"index":2798},"end":{"line":145,"column":24,"index":2804},"identifierName":"TEvent"}, + "start":2743,"end":2749,"loc":{"start":{"line":144,"column":18,"index":2743},"end":{"line":144,"column":24,"index":2749},"identifierName":"TEvent"}, "name": "TEvent" } } @@ -3179,35 +3214,35 @@ }, { "type": "ClassProperty", - "start":2810,"end":2840,"loc":{"start":{"line":146,"column":4,"index":2810},"end":{"line":146,"column":34,"index":2840}}, + "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":2810,"end":2817,"loc":{"start":{"line":146,"column":4,"index":2810},"end":{"line":146,"column":11,"index":2817},"identifierName":"_action"}, + "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":2817,"end":2839,"loc":{"start":{"line":146,"column":11,"index":2817},"end":{"line":146,"column":33,"index":2839}}, + "start":2762,"end":2784,"loc":{"start":{"line":145,"column":11,"index":2762},"end":{"line":145,"column":33,"index":2784}}, "typeAnnotation": { "type": "TSTypeReference", - "start":2819,"end":2839,"loc":{"start":{"line":146,"column":13,"index":2819},"end":{"line":146,"column":33,"index":2839}}, + "start":2764,"end":2784,"loc":{"start":{"line":145,"column":13,"index":2764},"end":{"line":145,"column":33,"index":2784}}, "typeName": { "type": "Identifier", - "start":2819,"end":2831,"loc":{"start":{"line":146,"column":13,"index":2819},"end":{"line":146,"column":25,"index":2831},"identifierName":"ActionObject"}, + "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":2831,"end":2839,"loc":{"start":{"line":146,"column":25,"index":2831},"end":{"line":146,"column":33,"index":2839}}, + "start":2776,"end":2784,"loc":{"start":{"line":145,"column":25,"index":2776},"end":{"line":145,"column":33,"index":2784}}, "params": [ { "type": "TSTypeReference", - "start":2832,"end":2838,"loc":{"start":{"line":146,"column":26,"index":2832},"end":{"line":146,"column":32,"index":2838}}, + "start":2777,"end":2783,"loc":{"start":{"line":145,"column":26,"index":2777},"end":{"line":145,"column":32,"index":2783}}, "typeName": { "type": "Identifier", - "start":2832,"end":2838,"loc":{"start":{"line":146,"column":26,"index":2832},"end":{"line":146,"column":32,"index":2838},"identifierName":"TEvent"}, + "start":2777,"end":2783,"loc":{"start":{"line":145,"column":26,"index":2777},"end":{"line":145,"column":32,"index":2783},"identifierName":"TEvent"}, "name": "TEvent" } } @@ -3219,41 +3254,41 @@ }, { "type": "ClassProperty", - "start":2845,"end":2878,"loc":{"start":{"line":147,"column":4,"index":2845},"end":{"line":147,"column":37,"index":2878}}, + "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":2845,"end":2851,"loc":{"start":{"line":147,"column":4,"index":2845},"end":{"line":147,"column":10,"index":2851},"identifierName":"_state"}, + "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":2851,"end":2877,"loc":{"start":{"line":147,"column":10,"index":2851},"end":{"line":147,"column":36,"index":2877}}, + "start":2796,"end":2822,"loc":{"start":{"line":146,"column":10,"index":2796},"end":{"line":146,"column":36,"index":2822}}, "typeAnnotation": { "type": "TSTypeReference", - "start":2853,"end":2877,"loc":{"start":{"line":147,"column":12,"index":2853},"end":{"line":147,"column":36,"index":2877}}, + "start":2798,"end":2822,"loc":{"start":{"line":146,"column":12,"index":2798},"end":{"line":146,"column":36,"index":2822}}, "typeName": { "type": "Identifier", - "start":2853,"end":2862,"loc":{"start":{"line":147,"column":12,"index":2853},"end":{"line":147,"column":21,"index":2862},"identifierName":"StateNode"}, + "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":2862,"end":2877,"loc":{"start":{"line":147,"column":21,"index":2862},"end":{"line":147,"column":36,"index":2877}}, + "start":2807,"end":2822,"loc":{"start":{"line":146,"column":21,"index":2807},"end":{"line":146,"column":36,"index":2822}}, "params": [ { "type": "TSTypeReference", - "start":2863,"end":2871,"loc":{"start":{"line":147,"column":22,"index":2863},"end":{"line":147,"column":30,"index":2871}}, + "start":2808,"end":2816,"loc":{"start":{"line":146,"column":22,"index":2808},"end":{"line":146,"column":30,"index":2816}}, "typeName": { "type": "Identifier", - "start":2863,"end":2871,"loc":{"start":{"line":147,"column":22,"index":2863},"end":{"line":147,"column":30,"index":2871},"identifierName":"TContext"}, + "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":2873,"end":2876,"loc":{"start":{"line":147,"column":32,"index":2873},"end":{"line":147,"column":35,"index":2876}} + "start":2818,"end":2821,"loc":{"start":{"line":146,"column":32,"index":2818},"end":{"line":146,"column":35,"index":2821}} } ] } @@ -3267,50 +3302,50 @@ { "type": "CommentLine", "value": " Error", - "start":2661,"end":2669,"loc":{"start":{"line":140,"column":39,"index":2661},"end":{"line":140,"column":47,"index":2669}} + "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":2671,"end":2702,"loc":{"start":{"line":142,"column":0,"index":2671},"end":{"line":142,"column":31,"index":2702}} + "start":2616,"end":2647,"loc":{"start":{"line":141,"column":0,"index":2616},"end":{"line":141,"column":31,"index":2647}} } ] }, { "type": "TSInterfaceDeclaration", - "start":2882,"end":2991,"loc":{"start":{"line":150,"column":0,"index":2882},"end":{"line":152,"column":1,"index":2991}}, + "start":2827,"end":2936,"loc":{"start":{"line":149,"column":0,"index":2827},"end":{"line":151,"column":1,"index":2936}}, "id": { "type": "Identifier", - "start":2892,"end":2904,"loc":{"start":{"line":150,"column":10,"index":2892},"end":{"line":150,"column":22,"index":2904},"identifierName":"ActionObject"}, + "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":2904,"end":2937,"loc":{"start":{"line":150,"column":22,"index":2904},"end":{"line":150,"column":55,"index":2937}}, + "start":2849,"end":2882,"loc":{"start":{"line":149,"column":22,"index":2849},"end":{"line":149,"column":55,"index":2882}}, "params": [ { "type": "TSTypeParameter", - "start":2905,"end":2936,"loc":{"start":{"line":150,"column":23,"index":2905},"end":{"line":150,"column":54,"index":2936}}, + "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":2920,"end":2936,"loc":{"start":{"line":150,"column":38,"index":2920},"end":{"line":150,"column":54,"index":2936}}, + "start":2865,"end":2881,"loc":{"start":{"line":149,"column":38,"index":2865},"end":{"line":149,"column":54,"index":2881}}, "members": [ { "type": "TSPropertySignature", - "start":2922,"end":2934,"loc":{"start":{"line":150,"column":40,"index":2922},"end":{"line":150,"column":52,"index":2934}}, + "start":2867,"end":2879,"loc":{"start":{"line":149,"column":40,"index":2867},"end":{"line":149,"column":52,"index":2879}}, "key": { "type": "Identifier", - "start":2922,"end":2926,"loc":{"start":{"line":150,"column":40,"index":2922},"end":{"line":150,"column":44,"index":2926},"identifierName":"type"}, + "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":2926,"end":2934,"loc":{"start":{"line":150,"column":44,"index":2926},"end":{"line":150,"column":52,"index":2934}}, + "start":2871,"end":2879,"loc":{"start":{"line":149,"column":44,"index":2871},"end":{"line":149,"column":52,"index":2879}}, "typeAnnotation": { "type": "TSStringKeyword", - "start":2928,"end":2934,"loc":{"start":{"line":150,"column":46,"index":2928},"end":{"line":150,"column":52,"index":2934}} + "start":2873,"end":2879,"loc":{"start":{"line":149,"column":46,"index":2873},"end":{"line":149,"column":52,"index":2879}} } } } @@ -3321,53 +3356,53 @@ }, "body": { "type": "TSInterfaceBody", - "start":2938,"end":2991,"loc":{"start":{"line":150,"column":56,"index":2938},"end":{"line":152,"column":1,"index":2991}}, + "start":2883,"end":2936,"loc":{"start":{"line":149,"column":56,"index":2883},"end":{"line":151,"column":1,"index":2936}}, "body": [ { "type": "TSPropertySignature", - "start":2944,"end":2989,"loc":{"start":{"line":151,"column":4,"index":2944},"end":{"line":151,"column":49,"index":2989}}, + "start":2889,"end":2934,"loc":{"start":{"line":150,"column":4,"index":2889},"end":{"line":150,"column":49,"index":2934}}, "key": { "type": "Identifier", - "start":2944,"end":2948,"loc":{"start":{"line":151,"column":4,"index":2944},"end":{"line":151,"column":8,"index":2948},"identifierName":"exec"}, + "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":2948,"end":2988,"loc":{"start":{"line":151,"column":8,"index":2948},"end":{"line":151,"column":48,"index":2988}}, + "start":2893,"end":2933,"loc":{"start":{"line":150,"column":8,"index":2893},"end":{"line":150,"column":48,"index":2933}}, "typeAnnotation": { "type": "TSFunctionType", - "start":2950,"end":2988,"loc":{"start":{"line":151,"column":10,"index":2950},"end":{"line":151,"column":48,"index":2988}}, + "start":2895,"end":2933,"loc":{"start":{"line":150,"column":10,"index":2895},"end":{"line":150,"column":48,"index":2933}}, "parameters": [ { "type": "Identifier", - "start":2951,"end":2979,"loc":{"start":{"line":151,"column":11,"index":2951},"end":{"line":151,"column":39,"index":2979},"identifierName":"meta"}, + "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":2955,"end":2979,"loc":{"start":{"line":151,"column":15,"index":2955},"end":{"line":151,"column":39,"index":2979}}, + "start":2900,"end":2924,"loc":{"start":{"line":150,"column":15,"index":2900},"end":{"line":150,"column":39,"index":2924}}, "typeAnnotation": { "type": "TSTypeReference", - "start":2957,"end":2979,"loc":{"start":{"line":151,"column":17,"index":2957},"end":{"line":151,"column":39,"index":2979}}, + "start":2902,"end":2924,"loc":{"start":{"line":150,"column":17,"index":2902},"end":{"line":150,"column":39,"index":2924}}, "typeName": { "type": "Identifier", - "start":2957,"end":2966,"loc":{"start":{"line":151,"column":17,"index":2957},"end":{"line":151,"column":26,"index":2966},"identifierName":"StateNode"}, + "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":2966,"end":2979,"loc":{"start":{"line":151,"column":26,"index":2966},"end":{"line":151,"column":39,"index":2979}}, + "start":2911,"end":2924,"loc":{"start":{"line":150,"column":26,"index":2911},"end":{"line":150,"column":39,"index":2924}}, "params": [ { "type": "TSAnyKeyword", - "start":2967,"end":2970,"loc":{"start":{"line":151,"column":27,"index":2967},"end":{"line":151,"column":30,"index":2970}} + "start":2912,"end":2915,"loc":{"start":{"line":150,"column":27,"index":2912},"end":{"line":150,"column":30,"index":2915}} }, { "type": "TSTypeReference", - "start":2972,"end":2978,"loc":{"start":{"line":151,"column":32,"index":2972},"end":{"line":151,"column":38,"index":2978}}, + "start":2917,"end":2923,"loc":{"start":{"line":150,"column":32,"index":2917},"end":{"line":150,"column":38,"index":2923}}, "typeName": { "type": "Identifier", - "start":2972,"end":2978,"loc":{"start":{"line":151,"column":32,"index":2972},"end":{"line":151,"column":38,"index":2978},"identifierName":"TEvent"}, + "start":2917,"end":2923,"loc":{"start":{"line":150,"column":32,"index":2917},"end":{"line":150,"column":38,"index":2923},"identifierName":"TEvent"}, "name": "TEvent" } } @@ -3379,10 +3414,10 @@ ], "typeAnnotation": { "type": "TSTypeAnnotation", - "start":2981,"end":2988,"loc":{"start":{"line":151,"column":41,"index":2981},"end":{"line":151,"column":48,"index":2988}}, + "start":2926,"end":2933,"loc":{"start":{"line":150,"column":41,"index":2926},"end":{"line":150,"column":48,"index":2933}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start":2984,"end":2988,"loc":{"start":{"line":151,"column":44,"index":2984},"end":{"line":151,"column":48,"index":2988}} + "start":2929,"end":2933,"loc":{"start":{"line":150,"column":44,"index":2929},"end":{"line":150,"column":48,"index":2933}} } } } @@ -3393,42 +3428,42 @@ }, { "type": "TSDeclareFunction", - "start":2993,"end":3108,"loc":{"start":{"line":154,"column":0,"index":2993},"end":{"line":154,"column":115,"index":3108}}, + "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":3010,"end":3023,"loc":{"start":{"line":154,"column":17,"index":3010},"end":{"line":154,"column":30,"index":3023},"identifierName":"createMachine"}, + "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":3023,"end":3056,"loc":{"start":{"line":154,"column":30,"index":3023},"end":{"line":154,"column":63,"index":3056}}, + "start":2968,"end":3001,"loc":{"start":{"line":153,"column":30,"index":2968},"end":{"line":153,"column":63,"index":3001}}, "params": [ { "type": "TSTypeParameter", - "start":3024,"end":3055,"loc":{"start":{"line":154,"column":31,"index":3024},"end":{"line":154,"column":62,"index":3055}}, + "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":3039,"end":3055,"loc":{"start":{"line":154,"column":46,"index":3039},"end":{"line":154,"column":62,"index":3055}}, + "start":2984,"end":3000,"loc":{"start":{"line":153,"column":46,"index":2984},"end":{"line":153,"column":62,"index":3000}}, "members": [ { "type": "TSPropertySignature", - "start":3041,"end":3053,"loc":{"start":{"line":154,"column":48,"index":3041},"end":{"line":154,"column":60,"index":3053}}, + "start":2986,"end":2998,"loc":{"start":{"line":153,"column":48,"index":2986},"end":{"line":153,"column":60,"index":2998}}, "key": { "type": "Identifier", - "start":3041,"end":3045,"loc":{"start":{"line":154,"column":48,"index":3041},"end":{"line":154,"column":52,"index":3045},"identifierName":"type"}, + "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":3045,"end":3053,"loc":{"start":{"line":154,"column":52,"index":3045},"end":{"line":154,"column":60,"index":3053}}, + "start":2990,"end":2998,"loc":{"start":{"line":153,"column":52,"index":2990},"end":{"line":153,"column":60,"index":2998}}, "typeAnnotation": { "type": "TSStringKeyword", - "start":3047,"end":3053,"loc":{"start":{"line":154,"column":54,"index":3047},"end":{"line":154,"column":60,"index":3053}} + "start":2992,"end":2998,"loc":{"start":{"line":153,"column":54,"index":2992},"end":{"line":153,"column":60,"index":2998}} } } } @@ -3440,29 +3475,29 @@ "params": [ { "type": "Identifier", - "start":3057,"end":3085,"loc":{"start":{"line":154,"column":64,"index":3057},"end":{"line":154,"column":92,"index":3085},"identifierName":"action"}, + "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":3063,"end":3085,"loc":{"start":{"line":154,"column":70,"index":3063},"end":{"line":154,"column":92,"index":3085}}, + "start":3008,"end":3030,"loc":{"start":{"line":153,"column":70,"index":3008},"end":{"line":153,"column":92,"index":3030}}, "typeAnnotation": { "type": "TSTypeReference", - "start":3065,"end":3085,"loc":{"start":{"line":154,"column":72,"index":3065},"end":{"line":154,"column":92,"index":3085}}, + "start":3010,"end":3030,"loc":{"start":{"line":153,"column":72,"index":3010},"end":{"line":153,"column":92,"index":3030}}, "typeName": { "type": "Identifier", - "start":3065,"end":3077,"loc":{"start":{"line":154,"column":72,"index":3065},"end":{"line":154,"column":84,"index":3077},"identifierName":"ActionObject"}, + "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":3077,"end":3085,"loc":{"start":{"line":154,"column":84,"index":3077},"end":{"line":154,"column":92,"index":3085}}, + "start":3022,"end":3030,"loc":{"start":{"line":153,"column":84,"index":3022},"end":{"line":153,"column":92,"index":3030}}, "params": [ { "type": "TSTypeReference", - "start":3078,"end":3084,"loc":{"start":{"line":154,"column":85,"index":3078},"end":{"line":154,"column":91,"index":3084}}, + "start":3023,"end":3029,"loc":{"start":{"line":153,"column":85,"index":3023},"end":{"line":153,"column":91,"index":3029}}, "typeName": { "type": "Identifier", - "start":3078,"end":3084,"loc":{"start":{"line":154,"column":85,"index":3078},"end":{"line":154,"column":91,"index":3084},"identifierName":"TEvent"}, + "start":3023,"end":3029,"loc":{"start":{"line":153,"column":85,"index":3023},"end":{"line":153,"column":91,"index":3029},"identifierName":"TEvent"}, "name": "TEvent" } } @@ -3474,26 +3509,26 @@ ], "returnType": { "type": "TSTypeAnnotation", - "start":3086,"end":3107,"loc":{"start":{"line":154,"column":93,"index":3086},"end":{"line":154,"column":114,"index":3107}}, + "start":3031,"end":3052,"loc":{"start":{"line":153,"column":93,"index":3031},"end":{"line":153,"column":114,"index":3052}}, "typeAnnotation": { "type": "TSTypeReference", - "start":3088,"end":3107,"loc":{"start":{"line":154,"column":95,"index":3088},"end":{"line":154,"column":114,"index":3107}}, + "start":3033,"end":3052,"loc":{"start":{"line":153,"column":95,"index":3033},"end":{"line":153,"column":114,"index":3052}}, "typeName": { "type": "Identifier", - "start":3088,"end":3097,"loc":{"start":{"line":154,"column":95,"index":3088},"end":{"line":154,"column":104,"index":3097},"identifierName":"StateNode"}, + "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":3097,"end":3107,"loc":{"start":{"line":154,"column":104,"index":3097},"end":{"line":154,"column":114,"index":3107}}, + "start":3042,"end":3052,"loc":{"start":{"line":153,"column":104,"index":3042},"end":{"line":153,"column":114,"index":3052}}, "params": [ { "type": "TSAnyKeyword", - "start":3098,"end":3101,"loc":{"start":{"line":154,"column":105,"index":3098},"end":{"line":154,"column":108,"index":3101}} + "start":3043,"end":3046,"loc":{"start":{"line":153,"column":105,"index":3043},"end":{"line":153,"column":108,"index":3046}} }, { "type": "TSAnyKeyword", - "start":3103,"end":3106,"loc":{"start":{"line":154,"column":110,"index":3103},"end":{"line":154,"column":113,"index":3106}} + "start":3048,"end":3051,"loc":{"start":{"line":153,"column":110,"index":3048},"end":{"line":153,"column":113,"index":3051}} } ] } @@ -3502,22 +3537,22 @@ }, { "type": "TSDeclareFunction", - "start":3110,"end":3188,"loc":{"start":{"line":156,"column":0,"index":3110},"end":{"line":156,"column":78,"index":3188}}, + "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":3127,"end":3136,"loc":{"start":{"line":156,"column":17,"index":3127},"end":{"line":156,"column":26,"index":3136},"identifierName":"interpret"}, + "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":3136,"end":3146,"loc":{"start":{"line":156,"column":26,"index":3136},"end":{"line":156,"column":36,"index":3146}}, + "start":3081,"end":3091,"loc":{"start":{"line":155,"column":26,"index":3081},"end":{"line":155,"column":36,"index":3091}}, "params": [ { "type": "TSTypeParameter", - "start":3137,"end":3145,"loc":{"start":{"line":156,"column":27,"index":3137},"end":{"line":156,"column":35,"index":3145}}, + "start":3082,"end":3090,"loc":{"start":{"line":155,"column":27,"index":3082},"end":{"line":155,"column":35,"index":3090}}, "name": "TContext" } ] @@ -3525,35 +3560,35 @@ "params": [ { "type": "Identifier", - "start":3147,"end":3180,"loc":{"start":{"line":156,"column":37,"index":3147},"end":{"line":156,"column":70,"index":3180},"identifierName":"machine"}, + "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":3154,"end":3180,"loc":{"start":{"line":156,"column":44,"index":3154},"end":{"line":156,"column":70,"index":3180}}, + "start":3099,"end":3125,"loc":{"start":{"line":155,"column":44,"index":3099},"end":{"line":155,"column":70,"index":3125}}, "typeAnnotation": { "type": "TSTypeReference", - "start":3156,"end":3180,"loc":{"start":{"line":156,"column":46,"index":3156},"end":{"line":156,"column":70,"index":3180}}, + "start":3101,"end":3125,"loc":{"start":{"line":155,"column":46,"index":3101},"end":{"line":155,"column":70,"index":3125}}, "typeName": { "type": "Identifier", - "start":3156,"end":3165,"loc":{"start":{"line":156,"column":46,"index":3156},"end":{"line":156,"column":55,"index":3165},"identifierName":"StateNode"}, + "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":3165,"end":3180,"loc":{"start":{"line":156,"column":55,"index":3165},"end":{"line":156,"column":70,"index":3180}}, + "start":3110,"end":3125,"loc":{"start":{"line":155,"column":55,"index":3110},"end":{"line":155,"column":70,"index":3125}}, "params": [ { "type": "TSTypeReference", - "start":3166,"end":3174,"loc":{"start":{"line":156,"column":56,"index":3166},"end":{"line":156,"column":64,"index":3174}}, + "start":3111,"end":3119,"loc":{"start":{"line":155,"column":56,"index":3111},"end":{"line":155,"column":64,"index":3119}}, "typeName": { "type": "Identifier", - "start":3166,"end":3174,"loc":{"start":{"line":156,"column":56,"index":3166},"end":{"line":156,"column":64,"index":3174},"identifierName":"TContext"}, + "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":3176,"end":3179,"loc":{"start":{"line":156,"column":66,"index":3176},"end":{"line":156,"column":69,"index":3179}} + "start":3121,"end":3124,"loc":{"start":{"line":155,"column":66,"index":3121},"end":{"line":155,"column":69,"index":3124}} } ] } @@ -3563,45 +3598,45 @@ ], "returnType": { "type": "TSTypeAnnotation", - "start":3181,"end":3187,"loc":{"start":{"line":156,"column":71,"index":3181},"end":{"line":156,"column":77,"index":3187}}, + "start":3126,"end":3132,"loc":{"start":{"line":155,"column":71,"index":3126},"end":{"line":155,"column":77,"index":3132}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start":3183,"end":3187,"loc":{"start":{"line":156,"column":73,"index":3183},"end":{"line":156,"column":77,"index":3187}} + "start":3128,"end":3132,"loc":{"start":{"line":155,"column":73,"index":3128},"end":{"line":155,"column":77,"index":3132}} } } }, { "type": "VariableDeclaration", - "start":3190,"end":3231,"loc":{"start":{"line":158,"column":0,"index":3190},"end":{"line":158,"column":41,"index":3231}}, + "start":3135,"end":3176,"loc":{"start":{"line":157,"column":0,"index":3135},"end":{"line":157,"column":41,"index":3176}}, "declarations": [ { "type": "VariableDeclarator", - "start":3196,"end":3230,"loc":{"start":{"line":158,"column":6,"index":3196},"end":{"line":158,"column":40,"index":3230}}, + "start":3141,"end":3175,"loc":{"start":{"line":157,"column":6,"index":3141},"end":{"line":157,"column":40,"index":3175}}, "id": { "type": "Identifier", - "start":3196,"end":3203,"loc":{"start":{"line":158,"column":6,"index":3196},"end":{"line":158,"column":13,"index":3203},"identifierName":"machine"}, + "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":3206,"end":3230,"loc":{"start":{"line":158,"column":16,"index":3206},"end":{"line":158,"column":40,"index":3230}}, + "start":3151,"end":3175,"loc":{"start":{"line":157,"column":16,"index":3151},"end":{"line":157,"column":40,"index":3175}}, "callee": { "type": "Identifier", - "start":3206,"end":3219,"loc":{"start":{"line":158,"column":16,"index":3206},"end":{"line":158,"column":29,"index":3219},"identifierName":"createMachine"}, + "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":3220,"end":3229,"loc":{"start":{"line":158,"column":30,"index":3220},"end":{"line":158,"column":39,"index":3229}}, + "start":3165,"end":3174,"loc":{"start":{"line":157,"column":30,"index":3165},"end":{"line":157,"column":39,"index":3174}}, "expression": { "type": "ObjectExpression", - "start":3220,"end":3222,"loc":{"start":{"line":158,"column":30,"index":3220},"end":{"line":158,"column":32,"index":3222}}, + "start":3165,"end":3167,"loc":{"start":{"line":157,"column":30,"index":3165},"end":{"line":157,"column":32,"index":3167}}, "properties": [] }, "typeAnnotation": { "type": "TSAnyKeyword", - "start":3226,"end":3229,"loc":{"start":{"line":158,"column":36,"index":3226},"end":{"line":158,"column":39,"index":3229}} + "start":3171,"end":3174,"loc":{"start":{"line":157,"column":36,"index":3171},"end":{"line":157,"column":39,"index":3174}} } } ] @@ -3612,19 +3647,19 @@ }, { "type": "ExpressionStatement", - "start":3233,"end":3252,"loc":{"start":{"line":160,"column":0,"index":3233},"end":{"line":160,"column":19,"index":3252}}, + "start":3178,"end":3197,"loc":{"start":{"line":159,"column":0,"index":3178},"end":{"line":159,"column":19,"index":3197}}, "expression": { "type": "CallExpression", - "start":3233,"end":3251,"loc":{"start":{"line":160,"column":0,"index":3233},"end":{"line":160,"column":18,"index":3251}}, + "start":3178,"end":3196,"loc":{"start":{"line":159,"column":0,"index":3178},"end":{"line":159,"column":18,"index":3196}}, "callee": { "type": "Identifier", - "start":3233,"end":3242,"loc":{"start":{"line":160,"column":0,"index":3233},"end":{"line":160,"column":9,"index":3242},"identifierName":"interpret"}, + "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":3243,"end":3250,"loc":{"start":{"line":160,"column":10,"index":3243},"end":{"line":160,"column":17,"index":3250},"identifierName":"machine"}, + "start":3188,"end":3195,"loc":{"start":{"line":159,"column":10,"index":3188},"end":{"line":159,"column":17,"index":3195},"identifierName":"machine"}, "name": "machine" } ] @@ -3632,53 +3667,53 @@ }, { "type": "VariableDeclaration", - "start":3254,"end":3318,"loc":{"start":{"line":162,"column":0,"index":3254},"end":{"line":162,"column":64,"index":3318}}, + "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":3268,"end":3317,"loc":{"start":{"line":162,"column":14,"index":3268},"end":{"line":162,"column":63,"index":3317}}, + "start":3213,"end":3262,"loc":{"start":{"line":161,"column":14,"index":3213},"end":{"line":161,"column":63,"index":3262}}, "id": { "type": "Identifier", - "start":3268,"end":3317,"loc":{"start":{"line":162,"column":14,"index":3268},"end":{"line":162,"column":63,"index":3317},"identifierName":"qq"}, + "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":3270,"end":3317,"loc":{"start":{"line":162,"column":16,"index":3270},"end":{"line":162,"column":63,"index":3317}}, + "start":3215,"end":3262,"loc":{"start":{"line":161,"column":16,"index":3215},"end":{"line":161,"column":63,"index":3262}}, "typeAnnotation": { "type": "TSTypeReference", - "start":3272,"end":3317,"loc":{"start":{"line":162,"column":18,"index":3272},"end":{"line":162,"column":63,"index":3317}}, + "start":3217,"end":3262,"loc":{"start":{"line":161,"column":18,"index":3217},"end":{"line":161,"column":63,"index":3262}}, "typeName": { "type": "Identifier", - "start":3272,"end":3284,"loc":{"start":{"line":162,"column":18,"index":3272},"end":{"line":162,"column":30,"index":3284},"identifierName":"ActionObject"}, + "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":3284,"end":3317,"loc":{"start":{"line":162,"column":30,"index":3284},"end":{"line":162,"column":63,"index":3317}}, + "start":3229,"end":3262,"loc":{"start":{"line":161,"column":30,"index":3229},"end":{"line":161,"column":63,"index":3262}}, "params": [ { "type": "TSTypeLiteral", - "start":3285,"end":3316,"loc":{"start":{"line":162,"column":31,"index":3285},"end":{"line":162,"column":62,"index":3316}}, + "start":3230,"end":3261,"loc":{"start":{"line":161,"column":31,"index":3230},"end":{"line":161,"column":62,"index":3261}}, "members": [ { "type": "TSPropertySignature", - "start":3287,"end":3300,"loc":{"start":{"line":162,"column":33,"index":3287},"end":{"line":162,"column":46,"index":3300}}, + "start":3232,"end":3245,"loc":{"start":{"line":161,"column":33,"index":3232},"end":{"line":161,"column":46,"index":3245}}, "key": { "type": "Identifier", - "start":3287,"end":3291,"loc":{"start":{"line":162,"column":33,"index":3287},"end":{"line":162,"column":37,"index":3291},"identifierName":"type"}, + "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":3291,"end":3299,"loc":{"start":{"line":162,"column":37,"index":3291},"end":{"line":162,"column":45,"index":3299}}, + "start":3236,"end":3244,"loc":{"start":{"line":161,"column":37,"index":3236},"end":{"line":161,"column":45,"index":3244}}, "typeAnnotation": { "type": "TSLiteralType", - "start":3293,"end":3299,"loc":{"start":{"line":162,"column":39,"index":3293},"end":{"line":162,"column":45,"index":3299}}, + "start":3238,"end":3244,"loc":{"start":{"line":161,"column":39,"index":3238},"end":{"line":161,"column":45,"index":3244}}, "literal": { "type": "StringLiteral", - "start":3293,"end":3299,"loc":{"start":{"line":162,"column":39,"index":3293},"end":{"line":162,"column":45,"index":3299}}, + "start":3238,"end":3244,"loc":{"start":{"line":161,"column":39,"index":3238},"end":{"line":161,"column":45,"index":3244}}, "extra": { "rawValue": "PLAY", "raw": "\"PLAY\"" @@ -3690,19 +3725,19 @@ }, { "type": "TSPropertySignature", - "start":3301,"end":3314,"loc":{"start":{"line":162,"column":47,"index":3301},"end":{"line":162,"column":60,"index":3314}}, + "start":3246,"end":3259,"loc":{"start":{"line":161,"column":47,"index":3246},"end":{"line":161,"column":60,"index":3259}}, "key": { "type": "Identifier", - "start":3301,"end":3306,"loc":{"start":{"line":162,"column":47,"index":3301},"end":{"line":162,"column":52,"index":3306},"identifierName":"value"}, + "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":3306,"end":3314,"loc":{"start":{"line":162,"column":52,"index":3306},"end":{"line":162,"column":60,"index":3314}}, + "start":3251,"end":3259,"loc":{"start":{"line":161,"column":52,"index":3251},"end":{"line":161,"column":60,"index":3259}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start":3308,"end":3314,"loc":{"start":{"line":162,"column":54,"index":3308},"end":{"line":162,"column":60,"index":3314}} + "start":3253,"end":3259,"loc":{"start":{"line":161,"column":54,"index":3253},"end":{"line":161,"column":60,"index":3259}} } } } @@ -3720,52 +3755,52 @@ }, { "type": "ExpressionStatement", - "start":3320,"end":3391,"loc":{"start":{"line":164,"column":0,"index":3320},"end":{"line":164,"column":71,"index":3391}}, + "start":3265,"end":3336,"loc":{"start":{"line":163,"column":0,"index":3265},"end":{"line":163,"column":71,"index":3336}}, "expression": { "type": "CallExpression", - "start":3320,"end":3390,"loc":{"start":{"line":164,"column":0,"index":3320},"end":{"line":164,"column":70,"index":3390}}, + "start":3265,"end":3335,"loc":{"start":{"line":163,"column":0,"index":3265},"end":{"line":163,"column":70,"index":3335}}, "callee": { "type": "Identifier", - "start":3320,"end":3333,"loc":{"start":{"line":164,"column":0,"index":3320},"end":{"line":164,"column":13,"index":3333},"identifierName":"createMachine"}, + "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":3387,"end":3389,"loc":{"start":{"line":164,"column":67,"index":3387},"end":{"line":164,"column":69,"index":3389},"identifierName":"qq"}, + "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":3333,"end":3386,"loc":{"start":{"line":164,"column":13,"index":3333},"end":{"line":164,"column":66,"index":3386}}, + "start":3278,"end":3331,"loc":{"start":{"line":163,"column":13,"index":3278},"end":{"line":163,"column":66,"index":3331}}, "params": [ { "type": "TSUnionType", - "start":3334,"end":3385,"loc":{"start":{"line":164,"column":14,"index":3334},"end":{"line":164,"column":65,"index":3385}}, + "start":3279,"end":3330,"loc":{"start":{"line":163,"column":14,"index":3279},"end":{"line":163,"column":65,"index":3330}}, "types": [ { "type": "TSTypeLiteral", - "start":3334,"end":3365,"loc":{"start":{"line":164,"column":14,"index":3334},"end":{"line":164,"column":45,"index":3365}}, + "start":3279,"end":3310,"loc":{"start":{"line":163,"column":14,"index":3279},"end":{"line":163,"column":45,"index":3310}}, "members": [ { "type": "TSPropertySignature", - "start":3336,"end":3349,"loc":{"start":{"line":164,"column":16,"index":3336},"end":{"line":164,"column":29,"index":3349}}, + "start":3281,"end":3294,"loc":{"start":{"line":163,"column":16,"index":3281},"end":{"line":163,"column":29,"index":3294}}, "key": { "type": "Identifier", - "start":3336,"end":3340,"loc":{"start":{"line":164,"column":16,"index":3336},"end":{"line":164,"column":20,"index":3340},"identifierName":"type"}, + "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":3340,"end":3348,"loc":{"start":{"line":164,"column":20,"index":3340},"end":{"line":164,"column":28,"index":3348}}, + "start":3285,"end":3293,"loc":{"start":{"line":163,"column":20,"index":3285},"end":{"line":163,"column":28,"index":3293}}, "typeAnnotation": { "type": "TSLiteralType", - "start":3342,"end":3348,"loc":{"start":{"line":164,"column":22,"index":3342},"end":{"line":164,"column":28,"index":3348}}, + "start":3287,"end":3293,"loc":{"start":{"line":163,"column":22,"index":3287},"end":{"line":163,"column":28,"index":3293}}, "literal": { "type": "StringLiteral", - "start":3342,"end":3348,"loc":{"start":{"line":164,"column":22,"index":3342},"end":{"line":164,"column":28,"index":3348}}, + "start":3287,"end":3293,"loc":{"start":{"line":163,"column":22,"index":3287},"end":{"line":163,"column":28,"index":3293}}, "extra": { "rawValue": "PLAY", "raw": "\"PLAY\"" @@ -3777,19 +3812,19 @@ }, { "type": "TSPropertySignature", - "start":3350,"end":3363,"loc":{"start":{"line":164,"column":30,"index":3350},"end":{"line":164,"column":43,"index":3363}}, + "start":3295,"end":3308,"loc":{"start":{"line":163,"column":30,"index":3295},"end":{"line":163,"column":43,"index":3308}}, "key": { "type": "Identifier", - "start":3350,"end":3355,"loc":{"start":{"line":164,"column":30,"index":3350},"end":{"line":164,"column":35,"index":3355},"identifierName":"value"}, + "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":3355,"end":3363,"loc":{"start":{"line":164,"column":35,"index":3355},"end":{"line":164,"column":43,"index":3363}}, + "start":3300,"end":3308,"loc":{"start":{"line":163,"column":35,"index":3300},"end":{"line":163,"column":43,"index":3308}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start":3357,"end":3363,"loc":{"start":{"line":164,"column":37,"index":3357},"end":{"line":164,"column":43,"index":3363}} + "start":3302,"end":3308,"loc":{"start":{"line":163,"column":37,"index":3302},"end":{"line":163,"column":43,"index":3308}} } } } @@ -3797,26 +3832,26 @@ }, { "type": "TSTypeLiteral", - "start":3368,"end":3385,"loc":{"start":{"line":164,"column":48,"index":3368},"end":{"line":164,"column":65,"index":3385}}, + "start":3313,"end":3330,"loc":{"start":{"line":163,"column":48,"index":3313},"end":{"line":163,"column":65,"index":3330}}, "members": [ { "type": "TSPropertySignature", - "start":3370,"end":3383,"loc":{"start":{"line":164,"column":50,"index":3370},"end":{"line":164,"column":63,"index":3383}}, + "start":3315,"end":3328,"loc":{"start":{"line":163,"column":50,"index":3315},"end":{"line":163,"column":63,"index":3328}}, "key": { "type": "Identifier", - "start":3370,"end":3374,"loc":{"start":{"line":164,"column":50,"index":3370},"end":{"line":164,"column":54,"index":3374},"identifierName":"type"}, + "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":3374,"end":3383,"loc":{"start":{"line":164,"column":54,"index":3374},"end":{"line":164,"column":63,"index":3383}}, + "start":3319,"end":3328,"loc":{"start":{"line":163,"column":54,"index":3319},"end":{"line":163,"column":63,"index":3328}}, "typeAnnotation": { "type": "TSLiteralType", - "start":3376,"end":3383,"loc":{"start":{"line":164,"column":56,"index":3376},"end":{"line":164,"column":63,"index":3383}}, + "start":3321,"end":3328,"loc":{"start":{"line":163,"column":56,"index":3321},"end":{"line":163,"column":63,"index":3328}}, "literal": { "type": "StringLiteral", - "start":3376,"end":3383,"loc":{"start":{"line":164,"column":56,"index":3376},"end":{"line":164,"column":63,"index":3383}}, + "start":3321,"end":3328,"loc":{"start":{"line":163,"column":56,"index":3321},"end":{"line":163,"column":63,"index":3328}}, "extra": { "rawValue": "RESET", "raw": "\"RESET\"" @@ -3837,7 +3872,7 @@ { "type": "CommentLine", "value": " Error", - "start":3393,"end":3401,"loc":{"start":{"line":164,"column":73,"index":3393},"end":{"line":164,"column":81,"index":3401}} + "start":3338,"end":3346,"loc":{"start":{"line":163,"column":73,"index":3338},"end":{"line":163,"column":81,"index":3346}} } ] } @@ -3957,63 +3992,48 @@ }, { "type": "CommentLine", - "value": " FIXME: this should be recoverable error", - "start":1956,"end":1998,"loc":{"start":{"line":106,"column":0,"index":1956},"end":{"line":106,"column":42,"index":1998}} - }, - { - "type": "CommentLine", - "value": " class C {", - "start":1999,"end":2011,"loc":{"start":{"line":107,"column":0,"index":1999},"end":{"line":107,"column":12,"index":2011}} - }, - { - "type": "CommentLine", - "value": " in a = 0; // Error", - "start":2012,"end":2038,"loc":{"start":{"line":108,"column":0,"index":2012},"end":{"line":108,"column":26,"index":2038}} - }, - { - "type": "CommentLine", - "value": " out b = 0; // Error", - "start":2039,"end":2066,"loc":{"start":{"line":109,"column":0,"index":2039},"end":{"line":109,"column":27,"index":2066}} + "value": " Error", + "start":1981,"end":1989,"loc":{"start":{"line":107,"column":15,"index":1981},"end":{"line":107,"column":23,"index":1989}} }, { "type": "CommentLine", - "value": " }", - "start":2067,"end":2071,"loc":{"start":{"line":110,"column":0,"index":2067},"end":{"line":110,"column":4,"index":2071}} + "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":2073,"end":2093,"loc":{"start":{"line":112,"column":0,"index":2073},"end":{"line":112,"column":20,"index":2093}} + "start":2018,"end":2038,"loc":{"start":{"line":111,"column":0,"index":2018},"end":{"line":111,"column":20,"index":2038}} }, { "type": "CommentLine", "value": " Error", - "start":2221,"end":2229,"loc":{"start":{"line":120,"column":14,"index":2221},"end":{"line":120,"column":22,"index":2229}} + "start":2166,"end":2174,"loc":{"start":{"line":119,"column":14,"index":2166},"end":{"line":119,"column":22,"index":2174}} }, { "type": "CommentLine", "value": " Error", - "start":2244,"end":2252,"loc":{"start":{"line":121,"column":14,"index":2244},"end":{"line":121,"column":22,"index":2252}} + "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":2254,"end":2274,"loc":{"start":{"line":123,"column":0,"index":2254},"end":{"line":123,"column":20,"index":2274}} + "start":2199,"end":2219,"loc":{"start":{"line":122,"column":0,"index":2199},"end":{"line":122,"column":20,"index":2219}} }, { "type": "CommentLine", "value": " Error", - "start":2661,"end":2669,"loc":{"start":{"line":140,"column":39,"index":2661},"end":{"line":140,"column":47,"index":2669}} + "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":2671,"end":2702,"loc":{"start":{"line":142,"column":0,"index":2671},"end":{"line":142,"column":31,"index":2702}} + "start":2616,"end":2647,"loc":{"start":{"line":141,"column":0,"index":2616},"end":{"line":141,"column":31,"index":2647}} }, { "type": "CommentLine", "value": " Error", - "start":3393,"end":3401,"loc":{"start":{"line":164,"column":73,"index":3393},"end":{"line":164,"column":81,"index":3401}} + "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/input.ts b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations/input.ts index ce573862a9e1..cd6e150b5be6 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations/input.ts +++ b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations/input.ts @@ -100,11 +100,10 @@ type T23 = T; // Error declare function f1(x: T): void; // Error declare function f2(): T; // Error -// FIXME: this should be recoverable error -// class C { -// in a = 0; // Error -// out b = 0; // Error -// } +class C { + in a = 0; // Error + out b = 0; // Error +} // Interface merging From 9aa70e250ee0f298924e9bfc69ee97323330681e Mon Sep 17 00:00:00 2001 From: magic-akari Date: Sun, 3 Apr 2022 19:00:41 +0800 Subject: [PATCH 7/8] fix: flowjs type --- packages/babel-parser/src/plugins/typescript/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js index 95f8d1a9e949..7afe6270b9e8 100644 --- a/packages/babel-parser/src/plugins/typescript/index.js +++ b/packages/babel-parser/src/plugins/typescript/index.js @@ -665,7 +665,7 @@ export default (superClass: Class): Class => } tsParseTypeParameter( - parseModifiers: ?( + parseModifiers: ( node: N.TsTypeParameter, ) => void = this.tsParseNoneModifiers.bind(this), ): N.TsTypeParameter { From 13cd9454dd0b20450084dbf8ecee249d0716d18e Mon Sep 17 00:00:00 2001 From: magic-akari Date: Sun, 3 Apr 2022 19:06:15 +0800 Subject: [PATCH 8/8] chore: update babel 8 test case --- .../types/variance-annotations/output.json | 3972 ++++++++++++++++- 1 file changed, 3935 insertions(+), 37 deletions(-) diff --git a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations/output.json b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations/output.json index 74dbd690bedb..4335a2fb0c0b 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/variance-annotations/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/variance-annotations/output.json @@ -1,9 +1,20 @@ { "type": "File", - "start":0,"end":144,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":11,"column":1,"index":144}}, + "start":0,"end":3311,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":160,"column":81,"index":3311}}, + "errors": [ + "SyntaxError: 'public' modifier cannot appear on a type parameter. (95:9)", + "SyntaxError: Duplicate modifier: 'in'. (96:16)", + "SyntaxError: 'in' modifier must precede 'out' modifier. (96:16)", + "SyntaxError: Duplicate modifier: 'out'. (97:16)", + "SyntaxError: 'in' modifier must precede 'out' modifier. (98:13)", + "SyntaxError: 'in' modifier can only appear on a type parameter of a class, interface or type alias. (100:20)", + "SyntaxError: 'out' modifier can only appear on a type parameter of a class, interface or type alias. (101:20)", + "SyntaxError: 'in' modifier can only appear on a type parameter of a class, interface or type alias. (104:4)", + "SyntaxError: 'out' modifier can only appear on a type parameter of a class, interface or type alias. (105:4)" + ], "program": { "type": "Program", - "start":0,"end":144,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":11,"column":1,"index":144}}, + "start":0,"end":3311,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":160,"column":81,"index":3311}}, "sourceType": "module", "interpreter": null, "body": [ @@ -61,25 +72,152 @@ ] } }, + { + "type": "VariableDeclaration", + "start":39,"end":87,"loc":{"start":{"line":5,"column":0,"index":39},"end":{"line":5,"column":48,"index":87}}, + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "start":51,"end":86,"loc":{"start":{"line":5,"column":12,"index":51},"end":{"line":5,"column":47,"index":86}}, + "id": { + "type": "Identifier", + "start":51,"end":86,"loc":{"start":{"line":5,"column":12,"index":51},"end":{"line":5,"column":47,"index":86},"identifierName":"super_covariant"}, + "name": "super_covariant", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":66,"end":86,"loc":{"start":{"line":5,"column":27,"index":66},"end":{"line":5,"column":47,"index":86}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":68,"end":86,"loc":{"start":{"line":5,"column":29,"index":68},"end":{"line":5,"column":47,"index":86}}, + "typeName": { + "type": "Identifier", + "start":68,"end":77,"loc":{"start":{"line":5,"column":29,"index":68},"end":{"line":5,"column":38,"index":77},"identifierName":"Covariant"}, + "name": "Covariant" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":77,"end":86,"loc":{"start":{"line":5,"column":38,"index":77},"end":{"line":5,"column":47,"index":86}}, + "params": [ + { + "type": "TSUnknownKeyword", + "start":78,"end":85,"loc":{"start":{"line":5,"column":39,"index":78},"end":{"line":5,"column":46,"index":85}} + } + ] + } + } + } + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "VariableDeclaration", + "start":88,"end":133,"loc":{"start":{"line":6,"column":0,"index":88},"end":{"line":6,"column":45,"index":133}}, + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "start":100,"end":132,"loc":{"start":{"line":6,"column":12,"index":100},"end":{"line":6,"column":44,"index":132}}, + "id": { + "type": "Identifier", + "start":100,"end":132,"loc":{"start":{"line":6,"column":12,"index":100},"end":{"line":6,"column":44,"index":132},"identifierName":"sub_covariant"}, + "name": "sub_covariant", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":113,"end":132,"loc":{"start":{"line":6,"column":25,"index":113},"end":{"line":6,"column":44,"index":132}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":115,"end":132,"loc":{"start":{"line":6,"column":27,"index":115},"end":{"line":6,"column":44,"index":132}}, + "typeName": { + "type": "Identifier", + "start":115,"end":124,"loc":{"start":{"line":6,"column":27,"index":115},"end":{"line":6,"column":36,"index":124},"identifierName":"Covariant"}, + "name": "Covariant" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":124,"end":132,"loc":{"start":{"line":6,"column":36,"index":124},"end":{"line":6,"column":44,"index":132}}, + "params": [ + { + "type": "TSStringKeyword", + "start":125,"end":131,"loc":{"start":{"line":6,"column":37,"index":125},"end":{"line":6,"column":43,"index":131}} + } + ] + } + } + } + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "ExpressionStatement", + "start":135,"end":167,"loc":{"start":{"line":8,"column":0,"index":135},"end":{"line":8,"column":32,"index":167}}, + "expression": { + "type": "AssignmentExpression", + "start":135,"end":166,"loc":{"start":{"line":8,"column":0,"index":135},"end":{"line":8,"column":31,"index":166}}, + "operator": "=", + "left": { + "type": "Identifier", + "start":135,"end":150,"loc":{"start":{"line":8,"column":0,"index":135},"end":{"line":8,"column":15,"index":150},"identifierName":"super_covariant"}, + "name": "super_covariant" + }, + "right": { + "type": "Identifier", + "start":153,"end":166,"loc":{"start":{"line":8,"column":18,"index":153},"end":{"line":8,"column":31,"index":166},"identifierName":"sub_covariant"}, + "name": "sub_covariant" + } + } + }, + { + "type": "ExpressionStatement", + "start":168,"end":200,"loc":{"start":{"line":9,"column":0,"index":168},"end":{"line":9,"column":32,"index":200}}, + "expression": { + "type": "AssignmentExpression", + "start":168,"end":199,"loc":{"start":{"line":9,"column":0,"index":168},"end":{"line":9,"column":31,"index":199}}, + "operator": "=", + "left": { + "type": "Identifier", + "start":168,"end":181,"loc":{"start":{"line":9,"column":0,"index":168},"end":{"line":9,"column":13,"index":181},"identifierName":"sub_covariant"}, + "name": "sub_covariant" + }, + "right": { + "type": "Identifier", + "start":184,"end":199,"loc":{"start":{"line":9,"column":16,"index":184},"end":{"line":9,"column":31,"index":199},"identifierName":"super_covariant"}, + "name": "super_covariant" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":202,"end":210,"loc":{"start":{"line":9,"column":34,"index":202},"end":{"line":9,"column":42,"index":210}} + } + ] + }, { "type": "TSTypeAliasDeclaration", - "start":39,"end":92,"loc":{"start":{"line":5,"column":0,"index":39},"end":{"line":7,"column":1,"index":92}}, + "start":212,"end":265,"loc":{"start":{"line":11,"column":0,"index":212},"end":{"line":13,"column":1,"index":265}}, "id": { "type": "Identifier", - "start":44,"end":57,"loc":{"start":{"line":5,"column":5,"index":44},"end":{"line":5,"column":18,"index":57},"identifierName":"Contravariant"}, + "start":217,"end":230,"loc":{"start":{"line":11,"column":5,"index":217},"end":{"line":11,"column":18,"index":230},"identifierName":"Contravariant"}, "name": "Contravariant" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":57,"end":63,"loc":{"start":{"line":5,"column":18,"index":57},"end":{"line":5,"column":24,"index":63}}, + "start":230,"end":236,"loc":{"start":{"line":11,"column":18,"index":230},"end":{"line":11,"column":24,"index":236}}, "params": [ { "type": "TSTypeParameter", - "start":58,"end":62,"loc":{"start":{"line":5,"column":19,"index":58},"end":{"line":5,"column":23,"index":62}}, + "start":231,"end":235,"loc":{"start":{"line":11,"column":19,"index":231},"end":{"line":11,"column":23,"index":235}}, "in": true, "name": { "type": "Identifier", - "start":61,"end":62,"loc":{"start":{"line":5,"column":22,"index":61},"end":{"line":5,"column":23,"index":62},"identifierName":"T"}, + "start":234,"end":235,"loc":{"start":{"line":11,"column":22,"index":234},"end":{"line":11,"column":23,"index":235},"identifierName":"T"}, "name": "T" } } @@ -87,37 +225,37 @@ }, "typeAnnotation": { "type": "TSTypeLiteral", - "start":66,"end":92,"loc":{"start":{"line":5,"column":27,"index":66},"end":{"line":7,"column":1,"index":92}}, + "start":239,"end":265,"loc":{"start":{"line":11,"column":27,"index":239},"end":{"line":13,"column":1,"index":265}}, "members": [ { "type": "TSPropertySignature", - "start":72,"end":90,"loc":{"start":{"line":6,"column":4,"index":72},"end":{"line":6,"column":22,"index":90}}, + "start":245,"end":263,"loc":{"start":{"line":12,"column":4,"index":245},"end":{"line":12,"column":22,"index":263}}, "key": { "type": "Identifier", - "start":72,"end":73,"loc":{"start":{"line":6,"column":4,"index":72},"end":{"line":6,"column":5,"index":73},"identifierName":"f"}, + "start":245,"end":246,"loc":{"start":{"line":12,"column":4,"index":245},"end":{"line":12,"column":5,"index":246},"identifierName":"f"}, "name": "f" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start":73,"end":89,"loc":{"start":{"line":6,"column":5,"index":73},"end":{"line":6,"column":21,"index":89}}, + "start":246,"end":262,"loc":{"start":{"line":12,"column":5,"index":246},"end":{"line":12,"column":21,"index":262}}, "typeAnnotation": { "type": "TSFunctionType", - "start":75,"end":89,"loc":{"start":{"line":6,"column":7,"index":75},"end":{"line":6,"column":21,"index":89}}, + "start":248,"end":262,"loc":{"start":{"line":12,"column":7,"index":248},"end":{"line":12,"column":21,"index":262}}, "params": [ { "type": "Identifier", - "start":76,"end":80,"loc":{"start":{"line":6,"column":8,"index":76},"end":{"line":6,"column":12,"index":80},"identifierName":"x"}, + "start":249,"end":253,"loc":{"start":{"line":12,"column":8,"index":249},"end":{"line":12,"column":12,"index":253},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start":77,"end":80,"loc":{"start":{"line":6,"column":9,"index":77},"end":{"line":6,"column":12,"index":80}}, + "start":250,"end":253,"loc":{"start":{"line":12,"column":9,"index":250},"end":{"line":12,"column":12,"index":253}}, "typeAnnotation": { "type": "TSTypeReference", - "start":79,"end":80,"loc":{"start":{"line":6,"column":11,"index":79},"end":{"line":6,"column":12,"index":80}}, + "start":252,"end":253,"loc":{"start":{"line":12,"column":11,"index":252},"end":{"line":12,"column":12,"index":253}}, "typeName": { "type": "Identifier", - "start":79,"end":80,"loc":{"start":{"line":6,"column":11,"index":79},"end":{"line":6,"column":12,"index":80},"identifierName":"T"}, + "start":252,"end":253,"loc":{"start":{"line":12,"column":11,"index":252},"end":{"line":12,"column":12,"index":253},"identifierName":"T"}, "name": "T" } } @@ -126,38 +264,179 @@ ], "returnType": { "type": "TSTypeAnnotation", - "start":82,"end":89,"loc":{"start":{"line":6,"column":14,"index":82},"end":{"line":6,"column":21,"index":89}}, + "start":255,"end":262,"loc":{"start":{"line":12,"column":14,"index":255},"end":{"line":12,"column":21,"index":262}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start":85,"end":89,"loc":{"start":{"line":6,"column":17,"index":85},"end":{"line":6,"column":21,"index":89}} + "start":258,"end":262,"loc":{"start":{"line":12,"column":17,"index":258},"end":{"line":12,"column":21,"index":262}} } } } } } ] - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":202,"end":210,"loc":{"start":{"line":9,"column":34,"index":202},"end":{"line":9,"column":42,"index":210}} + } + ] + }, + { + "type": "VariableDeclaration", + "start":267,"end":323,"loc":{"start":{"line":15,"column":0,"index":267},"end":{"line":15,"column":56,"index":323}}, + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "start":279,"end":322,"loc":{"start":{"line":15,"column":12,"index":279},"end":{"line":15,"column":55,"index":322}}, + "id": { + "type": "Identifier", + "start":279,"end":322,"loc":{"start":{"line":15,"column":12,"index":279},"end":{"line":15,"column":55,"index":322},"identifierName":"super_contravariant"}, + "name": "super_contravariant", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":298,"end":322,"loc":{"start":{"line":15,"column":31,"index":298},"end":{"line":15,"column":55,"index":322}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":300,"end":322,"loc":{"start":{"line":15,"column":33,"index":300},"end":{"line":15,"column":55,"index":322}}, + "typeName": { + "type": "Identifier", + "start":300,"end":313,"loc":{"start":{"line":15,"column":33,"index":300},"end":{"line":15,"column":46,"index":313},"identifierName":"Contravariant"}, + "name": "Contravariant" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":313,"end":322,"loc":{"start":{"line":15,"column":46,"index":313},"end":{"line":15,"column":55,"index":322}}, + "params": [ + { + "type": "TSUnknownKeyword", + "start":314,"end":321,"loc":{"start":{"line":15,"column":47,"index":314},"end":{"line":15,"column":54,"index":321}} + } + ] + } + } + } + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "VariableDeclaration", + "start":324,"end":377,"loc":{"start":{"line":16,"column":0,"index":324},"end":{"line":16,"column":53,"index":377}}, + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "start":336,"end":376,"loc":{"start":{"line":16,"column":12,"index":336},"end":{"line":16,"column":52,"index":376}}, + "id": { + "type": "Identifier", + "start":336,"end":376,"loc":{"start":{"line":16,"column":12,"index":336},"end":{"line":16,"column":52,"index":376},"identifierName":"sub_contravariant"}, + "name": "sub_contravariant", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":353,"end":376,"loc":{"start":{"line":16,"column":29,"index":353},"end":{"line":16,"column":52,"index":376}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":355,"end":376,"loc":{"start":{"line":16,"column":31,"index":355},"end":{"line":16,"column":52,"index":376}}, + "typeName": { + "type": "Identifier", + "start":355,"end":368,"loc":{"start":{"line":16,"column":31,"index":355},"end":{"line":16,"column":44,"index":368},"identifierName":"Contravariant"}, + "name": "Contravariant" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":368,"end":376,"loc":{"start":{"line":16,"column":44,"index":368},"end":{"line":16,"column":52,"index":376}}, + "params": [ + { + "type": "TSStringKeyword", + "start":369,"end":375,"loc":{"start":{"line":16,"column":45,"index":369},"end":{"line":16,"column":51,"index":375}} + } + ] + } + } + } + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "ExpressionStatement", + "start":379,"end":419,"loc":{"start":{"line":18,"column":0,"index":379},"end":{"line":18,"column":40,"index":419}}, + "expression": { + "type": "AssignmentExpression", + "start":379,"end":418,"loc":{"start":{"line":18,"column":0,"index":379},"end":{"line":18,"column":39,"index":418}}, + "operator": "=", + "left": { + "type": "Identifier", + "start":379,"end":398,"loc":{"start":{"line":18,"column":0,"index":379},"end":{"line":18,"column":19,"index":398},"identifierName":"super_contravariant"}, + "name": "super_contravariant" + }, + "right": { + "type": "Identifier", + "start":401,"end":418,"loc":{"start":{"line":18,"column":22,"index":401},"end":{"line":18,"column":39,"index":418},"identifierName":"sub_contravariant"}, + "name": "sub_contravariant" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":421,"end":429,"loc":{"start":{"line":18,"column":42,"index":421},"end":{"line":18,"column":50,"index":429}} + } + ] + }, + { + "type": "ExpressionStatement", + "start":430,"end":470,"loc":{"start":{"line":19,"column":0,"index":430},"end":{"line":19,"column":40,"index":470}}, + "expression": { + "type": "AssignmentExpression", + "start":430,"end":469,"loc":{"start":{"line":19,"column":0,"index":430},"end":{"line":19,"column":39,"index":469}}, + "operator": "=", + "left": { + "type": "Identifier", + "start":430,"end":447,"loc":{"start":{"line":19,"column":0,"index":430},"end":{"line":19,"column":17,"index":447},"identifierName":"sub_contravariant"}, + "name": "sub_contravariant" + }, + "right": { + "type": "Identifier", + "start":450,"end":469,"loc":{"start":{"line":19,"column":20,"index":450},"end":{"line":19,"column":39,"index":469},"identifierName":"super_contravariant"}, + "name": "super_contravariant" + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":421,"end":429,"loc":{"start":{"line":18,"column":42,"index":421},"end":{"line":18,"column":50,"index":429}} + } + ] }, { "type": "TSTypeAliasDeclaration", - "start":94,"end":144,"loc":{"start":{"line":9,"column":0,"index":94},"end":{"line":11,"column":1,"index":144}}, + "start":472,"end":522,"loc":{"start":{"line":21,"column":0,"index":472},"end":{"line":23,"column":1,"index":522}}, "id": { "type": "Identifier", - "start":99,"end":108,"loc":{"start":{"line":9,"column":5,"index":99},"end":{"line":9,"column":14,"index":108},"identifierName":"Invariant"}, + "start":477,"end":486,"loc":{"start":{"line":21,"column":5,"index":477},"end":{"line":21,"column":14,"index":486},"identifierName":"Invariant"}, "name": "Invariant" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start":108,"end":118,"loc":{"start":{"line":9,"column":14,"index":108},"end":{"line":9,"column":24,"index":118}}, + "start":486,"end":496,"loc":{"start":{"line":21,"column":14,"index":486},"end":{"line":21,"column":24,"index":496}}, "params": [ { "type": "TSTypeParameter", - "start":109,"end":117,"loc":{"start":{"line":9,"column":15,"index":109},"end":{"line":9,"column":23,"index":117}}, + "start":487,"end":495,"loc":{"start":{"line":21,"column":15,"index":487},"end":{"line":21,"column":23,"index":495}}, "in": true, "out": true, "name": { "type": "Identifier", - "start":116,"end":117,"loc":{"start":{"line":9,"column":22,"index":116},"end":{"line":9,"column":23,"index":117},"identifierName":"T"}, + "start":494,"end":495,"loc":{"start":{"line":21,"column":22,"index":494},"end":{"line":21,"column":23,"index":495},"identifierName":"T"}, "name": "T" } } @@ -165,37 +444,37 @@ }, "typeAnnotation": { "type": "TSTypeLiteral", - "start":121,"end":144,"loc":{"start":{"line":9,"column":27,"index":121},"end":{"line":11,"column":1,"index":144}}, + "start":499,"end":522,"loc":{"start":{"line":21,"column":27,"index":499},"end":{"line":23,"column":1,"index":522}}, "members": [ { "type": "TSPropertySignature", - "start":127,"end":142,"loc":{"start":{"line":10,"column":4,"index":127},"end":{"line":10,"column":19,"index":142}}, + "start":505,"end":520,"loc":{"start":{"line":22,"column":4,"index":505},"end":{"line":22,"column":19,"index":520}}, "key": { "type": "Identifier", - "start":127,"end":128,"loc":{"start":{"line":10,"column":4,"index":127},"end":{"line":10,"column":5,"index":128},"identifierName":"f"}, + "start":505,"end":506,"loc":{"start":{"line":22,"column":4,"index":505},"end":{"line":22,"column":5,"index":506},"identifierName":"f"}, "name": "f" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start":128,"end":141,"loc":{"start":{"line":10,"column":5,"index":128},"end":{"line":10,"column":18,"index":141}}, + "start":506,"end":519,"loc":{"start":{"line":22,"column":5,"index":506},"end":{"line":22,"column":18,"index":519}}, "typeAnnotation": { "type": "TSFunctionType", - "start":130,"end":141,"loc":{"start":{"line":10,"column":7,"index":130},"end":{"line":10,"column":18,"index":141}}, + "start":508,"end":519,"loc":{"start":{"line":22,"column":7,"index":508},"end":{"line":22,"column":18,"index":519}}, "params": [ { "type": "Identifier", - "start":131,"end":135,"loc":{"start":{"line":10,"column":8,"index":131},"end":{"line":10,"column":12,"index":135},"identifierName":"x"}, + "start":509,"end":513,"loc":{"start":{"line":22,"column":8,"index":509},"end":{"line":22,"column":12,"index":513},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start":132,"end":135,"loc":{"start":{"line":10,"column":9,"index":132},"end":{"line":10,"column":12,"index":135}}, + "start":510,"end":513,"loc":{"start":{"line":22,"column":9,"index":510},"end":{"line":22,"column":12,"index":513}}, "typeAnnotation": { "type": "TSTypeReference", - "start":134,"end":135,"loc":{"start":{"line":10,"column":11,"index":134},"end":{"line":10,"column":12,"index":135}}, + "start":512,"end":513,"loc":{"start":{"line":22,"column":11,"index":512},"end":{"line":22,"column":12,"index":513}}, "typeName": { "type": "Identifier", - "start":134,"end":135,"loc":{"start":{"line":10,"column":11,"index":134},"end":{"line":10,"column":12,"index":135},"identifierName":"T"}, + "start":512,"end":513,"loc":{"start":{"line":22,"column":11,"index":512},"end":{"line":22,"column":12,"index":513},"identifierName":"T"}, "name": "T" } } @@ -204,13 +483,13 @@ ], "returnType": { "type": "TSTypeAnnotation", - "start":137,"end":141,"loc":{"start":{"line":10,"column":14,"index":137},"end":{"line":10,"column":18,"index":141}}, + "start":515,"end":519,"loc":{"start":{"line":22,"column":14,"index":515},"end":{"line":22,"column":18,"index":519}}, "typeAnnotation": { "type": "TSTypeReference", - "start":140,"end":141,"loc":{"start":{"line":10,"column":17,"index":140},"end":{"line":10,"column":18,"index":141}}, + "start":518,"end":519,"loc":{"start":{"line":22,"column":17,"index":518},"end":{"line":22,"column":18,"index":519}}, "typeName": { "type": "Identifier", - "start":140,"end":141,"loc":{"start":{"line":10,"column":17,"index":140},"end":{"line":10,"column":18,"index":141},"identifierName":"T"}, + "start":518,"end":519,"loc":{"start":{"line":22,"column":17,"index":518},"end":{"line":22,"column":18,"index":519},"identifierName":"T"}, "name": "T" } } @@ -220,8 +499,3627 @@ } ] } + }, + { + "type": "VariableDeclaration", + "start":524,"end":572,"loc":{"start":{"line":25,"column":0,"index":524},"end":{"line":25,"column":48,"index":572}}, + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "start":536,"end":571,"loc":{"start":{"line":25,"column":12,"index":536},"end":{"line":25,"column":47,"index":571}}, + "id": { + "type": "Identifier", + "start":536,"end":571,"loc":{"start":{"line":25,"column":12,"index":536},"end":{"line":25,"column":47,"index":571},"identifierName":"super_invariant"}, + "name": "super_invariant", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":551,"end":571,"loc":{"start":{"line":25,"column":27,"index":551},"end":{"line":25,"column":47,"index":571}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":553,"end":571,"loc":{"start":{"line":25,"column":29,"index":553},"end":{"line":25,"column":47,"index":571}}, + "typeName": { + "type": "Identifier", + "start":553,"end":562,"loc":{"start":{"line":25,"column":29,"index":553},"end":{"line":25,"column":38,"index":562},"identifierName":"Invariant"}, + "name": "Invariant" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":562,"end":571,"loc":{"start":{"line":25,"column":38,"index":562},"end":{"line":25,"column":47,"index":571}}, + "params": [ + { + "type": "TSUnknownKeyword", + "start":563,"end":570,"loc":{"start":{"line":25,"column":39,"index":563},"end":{"line":25,"column":46,"index":570}} + } + ] + } + } + } + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "VariableDeclaration", + "start":573,"end":618,"loc":{"start":{"line":26,"column":0,"index":573},"end":{"line":26,"column":45,"index":618}}, + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "start":585,"end":617,"loc":{"start":{"line":26,"column":12,"index":585},"end":{"line":26,"column":44,"index":617}}, + "id": { + "type": "Identifier", + "start":585,"end":617,"loc":{"start":{"line":26,"column":12,"index":585},"end":{"line":26,"column":44,"index":617},"identifierName":"sub_invariant"}, + "name": "sub_invariant", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":598,"end":617,"loc":{"start":{"line":26,"column":25,"index":598},"end":{"line":26,"column":44,"index":617}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":600,"end":617,"loc":{"start":{"line":26,"column":27,"index":600},"end":{"line":26,"column":44,"index":617}}, + "typeName": { + "type": "Identifier", + "start":600,"end":609,"loc":{"start":{"line":26,"column":27,"index":600},"end":{"line":26,"column":36,"index":609},"identifierName":"Invariant"}, + "name": "Invariant" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":609,"end":617,"loc":{"start":{"line":26,"column":36,"index":609},"end":{"line":26,"column":44,"index":617}}, + "params": [ + { + "type": "TSStringKeyword", + "start":610,"end":616,"loc":{"start":{"line":26,"column":37,"index":610},"end":{"line":26,"column":43,"index":616}} + } + ] + } + } + } + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "ExpressionStatement", + "start":620,"end":652,"loc":{"start":{"line":28,"column":0,"index":620},"end":{"line":28,"column":32,"index":652}}, + "expression": { + "type": "AssignmentExpression", + "start":620,"end":651,"loc":{"start":{"line":28,"column":0,"index":620},"end":{"line":28,"column":31,"index":651}}, + "operator": "=", + "left": { + "type": "Identifier", + "start":620,"end":635,"loc":{"start":{"line":28,"column":0,"index":620},"end":{"line":28,"column":15,"index":635},"identifierName":"super_invariant"}, + "name": "super_invariant" + }, + "right": { + "type": "Identifier", + "start":638,"end":651,"loc":{"start":{"line":28,"column":18,"index":638},"end":{"line":28,"column":31,"index":651},"identifierName":"sub_invariant"}, + "name": "sub_invariant" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":654,"end":662,"loc":{"start":{"line":28,"column":34,"index":654},"end":{"line":28,"column":42,"index":662}} + } + ] + }, + { + "type": "ExpressionStatement", + "start":663,"end":695,"loc":{"start":{"line":29,"column":0,"index":663},"end":{"line":29,"column":32,"index":695}}, + "expression": { + "type": "AssignmentExpression", + "start":663,"end":694,"loc":{"start":{"line":29,"column":0,"index":663},"end":{"line":29,"column":31,"index":694}}, + "operator": "=", + "left": { + "type": "Identifier", + "start":663,"end":676,"loc":{"start":{"line":29,"column":0,"index":663},"end":{"line":29,"column":13,"index":676},"identifierName":"sub_invariant"}, + "name": "sub_invariant" + }, + "right": { + "type": "Identifier", + "start":679,"end":694,"loc":{"start":{"line":29,"column":16,"index":679},"end":{"line":29,"column":31,"index":694},"identifierName":"super_invariant"}, + "name": "super_invariant" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":697,"end":705,"loc":{"start":{"line":29,"column":34,"index":697},"end":{"line":29,"column":42,"index":705}} + }, + { + "type": "CommentLine", + "value": " Variance of various type constructors", + "start":707,"end":747,"loc":{"start":{"line":31,"column":0,"index":707},"end":{"line":31,"column":40,"index":747}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":654,"end":662,"loc":{"start":{"line":28,"column":34,"index":654},"end":{"line":28,"column":42,"index":662}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":749,"end":769,"loc":{"start":{"line":33,"column":0,"index":749},"end":{"line":33,"column":20,"index":769}}, + "id": { + "type": "Identifier", + "start":754,"end":757,"loc":{"start":{"line":33,"column":5,"index":754},"end":{"line":33,"column":8,"index":757},"identifierName":"T10"}, + "name": "T10" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":757,"end":764,"loc":{"start":{"line":33,"column":8,"index":757},"end":{"line":33,"column":15,"index":764}}, + "params": [ + { + "type": "TSTypeParameter", + "start":758,"end":763,"loc":{"start":{"line":33,"column":9,"index":758},"end":{"line":33,"column":14,"index":763}}, + "out": true, + "name": { + "type": "Identifier", + "start":762,"end":763,"loc":{"start":{"line":33,"column":13,"index":762},"end":{"line":33,"column":14,"index":763},"identifierName":"T"}, + "name": "T" + } + } + ] + }, + "typeAnnotation": { + "type": "TSTypeReference", + "start":767,"end":768,"loc":{"start":{"line":33,"column":18,"index":767},"end":{"line":33,"column":19,"index":768}}, + "typeName": { + "type": "Identifier", + "start":767,"end":768,"loc":{"start":{"line":33,"column":18,"index":767},"end":{"line":33,"column":19,"index":768},"identifierName":"T"}, + "name": "T" + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":697,"end":705,"loc":{"start":{"line":29,"column":34,"index":697},"end":{"line":29,"column":42,"index":705}} + }, + { + "type": "CommentLine", + "value": " Variance of various type constructors", + "start":707,"end":747,"loc":{"start":{"line":31,"column":0,"index":707},"end":{"line":31,"column":40,"index":747}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":770,"end":795,"loc":{"start":{"line":34,"column":0,"index":770},"end":{"line":34,"column":25,"index":795}}, + "id": { + "type": "Identifier", + "start":775,"end":778,"loc":{"start":{"line":34,"column":5,"index":775},"end":{"line":34,"column":8,"index":778},"identifierName":"T11"}, + "name": "T11" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":778,"end":784,"loc":{"start":{"line":34,"column":8,"index":778},"end":{"line":34,"column":14,"index":784}}, + "params": [ + { + "type": "TSTypeParameter", + "start":779,"end":783,"loc":{"start":{"line":34,"column":9,"index":779},"end":{"line":34,"column":13,"index":783}}, + "in": true, + "name": { + "type": "Identifier", + "start":782,"end":783,"loc":{"start":{"line":34,"column":12,"index":782},"end":{"line":34,"column":13,"index":783},"identifierName":"T"}, + "name": "T" + } + } + ] + }, + "typeAnnotation": { + "type": "TSTypeOperator", + "start":787,"end":794,"loc":{"start":{"line":34,"column":17,"index":787},"end":{"line":34,"column":24,"index":794}}, + "operator": "keyof", + "typeAnnotation": { + "type": "TSTypeReference", + "start":793,"end":794,"loc":{"start":{"line":34,"column":23,"index":793},"end":{"line":34,"column":24,"index":794}}, + "typeName": { + "type": "Identifier", + "start":793,"end":794,"loc":{"start":{"line":34,"column":23,"index":793},"end":{"line":34,"column":24,"index":794},"identifierName":"T"}, + "name": "T" + } + } + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":796,"end":842,"loc":{"start":{"line":35,"column":0,"index":796},"end":{"line":35,"column":46,"index":842}}, + "id": { + "type": "Identifier", + "start":801,"end":804,"loc":{"start":{"line":35,"column":5,"index":801},"end":{"line":35,"column":8,"index":804},"identifierName":"T12"}, + "name": "T12" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":804,"end":834,"loc":{"start":{"line":35,"column":8,"index":804},"end":{"line":35,"column":38,"index":834}}, + "params": [ + { + "type": "TSTypeParameter", + "start":805,"end":810,"loc":{"start":{"line":35,"column":9,"index":805},"end":{"line":35,"column":14,"index":810}}, + "out": true, + "name": { + "type": "Identifier", + "start":809,"end":810,"loc":{"start":{"line":35,"column":13,"index":809},"end":{"line":35,"column":14,"index":810},"identifierName":"T"}, + "name": "T" + } + }, + { + "type": "TSTypeParameter", + "start":812,"end":833,"loc":{"start":{"line":35,"column":16,"index":812},"end":{"line":35,"column":37,"index":833}}, + "out": true, + "name": { + "type": "Identifier", + "start":816,"end":817,"loc":{"start":{"line":35,"column":20,"index":816},"end":{"line":35,"column":21,"index":817},"identifierName":"K"}, + "name": "K" + }, + "constraint": { + "type": "TSTypeOperator", + "start":826,"end":833,"loc":{"start":{"line":35,"column":30,"index":826},"end":{"line":35,"column":37,"index":833}}, + "operator": "keyof", + "typeAnnotation": { + "type": "TSTypeReference", + "start":832,"end":833,"loc":{"start":{"line":35,"column":36,"index":832},"end":{"line":35,"column":37,"index":833}}, + "typeName": { + "type": "Identifier", + "start":832,"end":833,"loc":{"start":{"line":35,"column":36,"index":832},"end":{"line":35,"column":37,"index":833},"identifierName":"T"}, + "name": "T" + } + } + } + } + ] + }, + "typeAnnotation": { + "type": "TSIndexedAccessType", + "start":837,"end":841,"loc":{"start":{"line":35,"column":41,"index":837},"end":{"line":35,"column":45,"index":841}}, + "objectType": { + "type": "TSTypeReference", + "start":837,"end":838,"loc":{"start":{"line":35,"column":41,"index":837},"end":{"line":35,"column":42,"index":838}}, + "typeName": { + "type": "Identifier", + "start":837,"end":838,"loc":{"start":{"line":35,"column":41,"index":837},"end":{"line":35,"column":42,"index":838},"identifierName":"T"}, + "name": "T" + } + }, + "indexType": { + "type": "TSTypeReference", + "start":839,"end":840,"loc":{"start":{"line":35,"column":43,"index":839},"end":{"line":35,"column":44,"index":840}}, + "typeName": { + "type": "Identifier", + "start":839,"end":840,"loc":{"start":{"line":35,"column":43,"index":839},"end":{"line":35,"column":44,"index":840},"identifierName":"K"}, + "name": "K" + } + } + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":843,"end":875,"loc":{"start":{"line":36,"column":0,"index":843},"end":{"line":36,"column":32,"index":875}}, + "id": { + "type": "Identifier", + "start":848,"end":851,"loc":{"start":{"line":36,"column":5,"index":848},"end":{"line":36,"column":8,"index":851},"identifierName":"T13"}, + "name": "T13" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":851,"end":861,"loc":{"start":{"line":36,"column":8,"index":851},"end":{"line":36,"column":18,"index":861}}, + "params": [ + { + "type": "TSTypeParameter", + "start":852,"end":860,"loc":{"start":{"line":36,"column":9,"index":852},"end":{"line":36,"column":17,"index":860}}, + "in": true, + "out": true, + "name": { + "type": "Identifier", + "start":859,"end":860,"loc":{"start":{"line":36,"column":16,"index":859},"end":{"line":36,"column":17,"index":860},"identifierName":"T"}, + "name": "T" + } + } + ] + }, + "typeAnnotation": { + "type": "TSIndexedAccessType", + "start":864,"end":874,"loc":{"start":{"line":36,"column":21,"index":864},"end":{"line":36,"column":31,"index":874}}, + "objectType": { + "type": "TSTypeReference", + "start":864,"end":865,"loc":{"start":{"line":36,"column":21,"index":864},"end":{"line":36,"column":22,"index":865}}, + "typeName": { + "type": "Identifier", + "start":864,"end":865,"loc":{"start":{"line":36,"column":21,"index":864},"end":{"line":36,"column":22,"index":865},"identifierName":"T"}, + "name": "T" + } + }, + "indexType": { + "type": "TSTypeOperator", + "start":866,"end":873,"loc":{"start":{"line":36,"column":23,"index":866},"end":{"line":36,"column":30,"index":873}}, + "operator": "keyof", + "typeAnnotation": { + "type": "TSTypeReference", + "start":872,"end":873,"loc":{"start":{"line":36,"column":29,"index":872},"end":{"line":36,"column":30,"index":873}}, + "typeName": { + "type": "Identifier", + "start":872,"end":873,"loc":{"start":{"line":36,"column":29,"index":872},"end":{"line":36,"column":30,"index":873},"identifierName":"T"}, + "name": "T" + } + } + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Variance annotation errors", + "start":877,"end":906,"loc":{"start":{"line":38,"column":0,"index":877},"end":{"line":38,"column":29,"index":906}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":908,"end":955,"loc":{"start":{"line":40,"column":0,"index":908},"end":{"line":42,"column":1,"index":955}}, + "id": { + "type": "Identifier", + "start":913,"end":923,"loc":{"start":{"line":40,"column":5,"index":913},"end":{"line":40,"column":15,"index":923},"identifierName":"Covariant1"}, + "name": "Covariant1" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":923,"end":929,"loc":{"start":{"line":40,"column":15,"index":923},"end":{"line":40,"column":21,"index":929}}, + "params": [ + { + "type": "TSTypeParameter", + "start":924,"end":928,"loc":{"start":{"line":40,"column":16,"index":924},"end":{"line":40,"column":20,"index":928}}, + "in": true, + "name": { + "type": "Identifier", + "start":927,"end":928,"loc":{"start":{"line":40,"column":19,"index":927},"end":{"line":40,"column":20,"index":928},"identifierName":"T"}, + "name": "T" + } + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":932,"end":955,"loc":{"start":{"line":40,"column":24,"index":932},"end":{"line":42,"column":1,"index":955}}, + "members": [ + { + "type": "TSPropertySignature", + "start":948,"end":953,"loc":{"start":{"line":41,"column":4,"index":948},"end":{"line":41,"column":9,"index":953}}, + "key": { + "type": "Identifier", + "start":948,"end":949,"loc":{"start":{"line":41,"column":4,"index":948},"end":{"line":41,"column":5,"index":949},"identifierName":"x"}, + "name": "x" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":949,"end":952,"loc":{"start":{"line":41,"column":5,"index":949},"end":{"line":41,"column":8,"index":952}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":951,"end":952,"loc":{"start":{"line":41,"column":7,"index":951},"end":{"line":41,"column":8,"index":952}}, + "typeName": { + "type": "Identifier", + "start":951,"end":952,"loc":{"start":{"line":41,"column":7,"index":951},"end":{"line":41,"column":8,"index":952},"identifierName":"T"}, + "name": "T" + } + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":935,"end":943,"loc":{"start":{"line":40,"column":27,"index":935},"end":{"line":40,"column":35,"index":943}} + } + ] + } + ] + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Variance annotation errors", + "start":877,"end":906,"loc":{"start":{"line":38,"column":0,"index":877},"end":{"line":38,"column":29,"index":906}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":957,"end":994,"loc":{"start":{"line":44,"column":0,"index":957},"end":{"line":44,"column":37,"index":994}}, + "id": { + "type": "Identifier", + "start":962,"end":976,"loc":{"start":{"line":44,"column":5,"index":962},"end":{"line":44,"column":19,"index":976},"identifierName":"Contravariant1"}, + "name": "Contravariant1" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":976,"end":983,"loc":{"start":{"line":44,"column":19,"index":976},"end":{"line":44,"column":26,"index":983}}, + "params": [ + { + "type": "TSTypeParameter", + "start":977,"end":982,"loc":{"start":{"line":44,"column":20,"index":977},"end":{"line":44,"column":25,"index":982}}, + "out": true, + "name": { + "type": "Identifier", + "start":981,"end":982,"loc":{"start":{"line":44,"column":24,"index":981},"end":{"line":44,"column":25,"index":982},"identifierName":"T"}, + "name": "T" + } + } + ] + }, + "typeAnnotation": { + "type": "TSTypeOperator", + "start":986,"end":993,"loc":{"start":{"line":44,"column":29,"index":986},"end":{"line":44,"column":36,"index":993}}, + "operator": "keyof", + "typeAnnotation": { + "type": "TSTypeReference", + "start":992,"end":993,"loc":{"start":{"line":44,"column":35,"index":992},"end":{"line":44,"column":36,"index":993}}, + "typeName": { + "type": "Identifier", + "start":992,"end":993,"loc":{"start":{"line":44,"column":35,"index":992},"end":{"line":44,"column":36,"index":993},"identifierName":"T"}, + "name": "T" + } + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":996,"end":1004,"loc":{"start":{"line":44,"column":39,"index":996},"end":{"line":44,"column":47,"index":1004}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":1006,"end":1071,"loc":{"start":{"line":46,"column":0,"index":1006},"end":{"line":48,"column":1,"index":1071}}, + "id": { + "type": "Identifier", + "start":1011,"end":1025,"loc":{"start":{"line":46,"column":5,"index":1011},"end":{"line":46,"column":19,"index":1025},"identifierName":"Contravariant2"}, + "name": "Contravariant2" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1025,"end":1032,"loc":{"start":{"line":46,"column":19,"index":1025},"end":{"line":46,"column":26,"index":1032}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1026,"end":1031,"loc":{"start":{"line":46,"column":20,"index":1026},"end":{"line":46,"column":25,"index":1031}}, + "out": true, + "name": { + "type": "Identifier", + "start":1030,"end":1031,"loc":{"start":{"line":46,"column":24,"index":1030},"end":{"line":46,"column":25,"index":1031},"identifierName":"T"}, + "name": "T" + } + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":1035,"end":1071,"loc":{"start":{"line":46,"column":29,"index":1035},"end":{"line":48,"column":1,"index":1071}}, + "members": [ + { + "type": "TSPropertySignature", + "start":1051,"end":1069,"loc":{"start":{"line":47,"column":4,"index":1051},"end":{"line":47,"column":22,"index":1069}}, + "key": { + "type": "Identifier", + "start":1051,"end":1052,"loc":{"start":{"line":47,"column":4,"index":1051},"end":{"line":47,"column":5,"index":1052},"identifierName":"f"}, + "name": "f" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1052,"end":1068,"loc":{"start":{"line":47,"column":5,"index":1052},"end":{"line":47,"column":21,"index":1068}}, + "typeAnnotation": { + "type": "TSFunctionType", + "start":1054,"end":1068,"loc":{"start":{"line":47,"column":7,"index":1054},"end":{"line":47,"column":21,"index":1068}}, + "params": [ + { + "type": "Identifier", + "start":1055,"end":1059,"loc":{"start":{"line":47,"column":8,"index":1055},"end":{"line":47,"column":12,"index":1059},"identifierName":"x"}, + "name": "x", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1056,"end":1059,"loc":{"start":{"line":47,"column":9,"index":1056},"end":{"line":47,"column":12,"index":1059}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1058,"end":1059,"loc":{"start":{"line":47,"column":11,"index":1058},"end":{"line":47,"column":12,"index":1059}}, + "typeName": { + "type": "Identifier", + "start":1058,"end":1059,"loc":{"start":{"line":47,"column":11,"index":1058},"end":{"line":47,"column":12,"index":1059},"identifierName":"T"}, + "name": "T" + } + } + } + } + ], + "returnType": { + "type": "TSTypeAnnotation", + "start":1061,"end":1068,"loc":{"start":{"line":47,"column":14,"index":1061},"end":{"line":47,"column":21,"index":1068}}, + "typeAnnotation": { + "type": "TSVoidKeyword", + "start":1064,"end":1068,"loc":{"start":{"line":47,"column":17,"index":1064},"end":{"line":47,"column":21,"index":1068}} + } + } + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1038,"end":1046,"loc":{"start":{"line":46,"column":32,"index":1038},"end":{"line":46,"column":40,"index":1046}} + } + ] + } + ] + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":996,"end":1004,"loc":{"start":{"line":44,"column":39,"index":996},"end":{"line":44,"column":47,"index":1004}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":1073,"end":1130,"loc":{"start":{"line":50,"column":0,"index":1073},"end":{"line":52,"column":1,"index":1130}}, + "id": { + "type": "Identifier", + "start":1078,"end":1088,"loc":{"start":{"line":50,"column":5,"index":1078},"end":{"line":50,"column":15,"index":1088},"identifierName":"Invariant1"}, + "name": "Invariant1" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1088,"end":1094,"loc":{"start":{"line":50,"column":15,"index":1088},"end":{"line":50,"column":21,"index":1094}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1089,"end":1093,"loc":{"start":{"line":50,"column":16,"index":1089},"end":{"line":50,"column":20,"index":1093}}, + "in": true, + "name": { + "type": "Identifier", + "start":1092,"end":1093,"loc":{"start":{"line":50,"column":19,"index":1092},"end":{"line":50,"column":20,"index":1093},"identifierName":"T"}, + "name": "T" + } + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":1097,"end":1130,"loc":{"start":{"line":50,"column":24,"index":1097},"end":{"line":52,"column":1,"index":1130}}, + "members": [ + { + "type": "TSPropertySignature", + "start":1113,"end":1128,"loc":{"start":{"line":51,"column":4,"index":1113},"end":{"line":51,"column":19,"index":1128}}, + "key": { + "type": "Identifier", + "start":1113,"end":1114,"loc":{"start":{"line":51,"column":4,"index":1113},"end":{"line":51,"column":5,"index":1114},"identifierName":"f"}, + "name": "f" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1114,"end":1127,"loc":{"start":{"line":51,"column":5,"index":1114},"end":{"line":51,"column":18,"index":1127}}, + "typeAnnotation": { + "type": "TSFunctionType", + "start":1116,"end":1127,"loc":{"start":{"line":51,"column":7,"index":1116},"end":{"line":51,"column":18,"index":1127}}, + "params": [ + { + "type": "Identifier", + "start":1117,"end":1121,"loc":{"start":{"line":51,"column":8,"index":1117},"end":{"line":51,"column":12,"index":1121},"identifierName":"x"}, + "name": "x", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1118,"end":1121,"loc":{"start":{"line":51,"column":9,"index":1118},"end":{"line":51,"column":12,"index":1121}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1120,"end":1121,"loc":{"start":{"line":51,"column":11,"index":1120},"end":{"line":51,"column":12,"index":1121}}, + "typeName": { + "type": "Identifier", + "start":1120,"end":1121,"loc":{"start":{"line":51,"column":11,"index":1120},"end":{"line":51,"column":12,"index":1121},"identifierName":"T"}, + "name": "T" + } + } + } + } + ], + "returnType": { + "type": "TSTypeAnnotation", + "start":1123,"end":1127,"loc":{"start":{"line":51,"column":14,"index":1123},"end":{"line":51,"column":18,"index":1127}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1126,"end":1127,"loc":{"start":{"line":51,"column":17,"index":1126},"end":{"line":51,"column":18,"index":1127}}, + "typeName": { + "type": "Identifier", + "start":1126,"end":1127,"loc":{"start":{"line":51,"column":17,"index":1126},"end":{"line":51,"column":18,"index":1127},"identifierName":"T"}, + "name": "T" + } + } + } + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1100,"end":1108,"loc":{"start":{"line":50,"column":27,"index":1100},"end":{"line":50,"column":35,"index":1108}} + } + ] + } + ] + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":1132,"end":1190,"loc":{"start":{"line":54,"column":0,"index":1132},"end":{"line":56,"column":1,"index":1190}}, + "id": { + "type": "Identifier", + "start":1137,"end":1147,"loc":{"start":{"line":54,"column":5,"index":1137},"end":{"line":54,"column":15,"index":1147},"identifierName":"Invariant2"}, + "name": "Invariant2" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1147,"end":1154,"loc":{"start":{"line":54,"column":15,"index":1147},"end":{"line":54,"column":22,"index":1154}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1148,"end":1153,"loc":{"start":{"line":54,"column":16,"index":1148},"end":{"line":54,"column":21,"index":1153}}, + "out": true, + "name": { + "type": "Identifier", + "start":1152,"end":1153,"loc":{"start":{"line":54,"column":20,"index":1152},"end":{"line":54,"column":21,"index":1153},"identifierName":"T"}, + "name": "T" + } + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":1157,"end":1190,"loc":{"start":{"line":54,"column":25,"index":1157},"end":{"line":56,"column":1,"index":1190}}, + "members": [ + { + "type": "TSPropertySignature", + "start":1173,"end":1188,"loc":{"start":{"line":55,"column":4,"index":1173},"end":{"line":55,"column":19,"index":1188}}, + "key": { + "type": "Identifier", + "start":1173,"end":1174,"loc":{"start":{"line":55,"column":4,"index":1173},"end":{"line":55,"column":5,"index":1174},"identifierName":"f"}, + "name": "f" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1174,"end":1187,"loc":{"start":{"line":55,"column":5,"index":1174},"end":{"line":55,"column":18,"index":1187}}, + "typeAnnotation": { + "type": "TSFunctionType", + "start":1176,"end":1187,"loc":{"start":{"line":55,"column":7,"index":1176},"end":{"line":55,"column":18,"index":1187}}, + "params": [ + { + "type": "Identifier", + "start":1177,"end":1181,"loc":{"start":{"line":55,"column":8,"index":1177},"end":{"line":55,"column":12,"index":1181},"identifierName":"x"}, + "name": "x", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1178,"end":1181,"loc":{"start":{"line":55,"column":9,"index":1178},"end":{"line":55,"column":12,"index":1181}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1180,"end":1181,"loc":{"start":{"line":55,"column":11,"index":1180},"end":{"line":55,"column":12,"index":1181}}, + "typeName": { + "type": "Identifier", + "start":1180,"end":1181,"loc":{"start":{"line":55,"column":11,"index":1180},"end":{"line":55,"column":12,"index":1181},"identifierName":"T"}, + "name": "T" + } + } + } + } + ], + "returnType": { + "type": "TSTypeAnnotation", + "start":1183,"end":1187,"loc":{"start":{"line":55,"column":14,"index":1183},"end":{"line":55,"column":18,"index":1187}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1186,"end":1187,"loc":{"start":{"line":55,"column":17,"index":1186},"end":{"line":55,"column":18,"index":1187}}, + "typeName": { + "type": "Identifier", + "start":1186,"end":1187,"loc":{"start":{"line":55,"column":17,"index":1186},"end":{"line":55,"column":18,"index":1187},"identifierName":"T"}, + "name": "T" + } + } + } + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1160,"end":1168,"loc":{"start":{"line":54,"column":28,"index":1160},"end":{"line":54,"column":36,"index":1168}} + } + ] + } + ] + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Variance in circular types", + "start":1192,"end":1221,"loc":{"start":{"line":58,"column":0,"index":1192},"end":{"line":58,"column":29,"index":1221}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":1223,"end":1282,"loc":{"start":{"line":60,"column":0,"index":1223},"end":{"line":63,"column":1,"index":1282}}, + "id": { + "type": "Identifier", + "start":1228,"end":1232,"loc":{"start":{"line":60,"column":5,"index":1228},"end":{"line":60,"column":9,"index":1232},"identifierName":"Foo1"}, + "name": "Foo1" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1232,"end":1238,"loc":{"start":{"line":60,"column":9,"index":1232},"end":{"line":60,"column":15,"index":1238}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1233,"end":1237,"loc":{"start":{"line":60,"column":10,"index":1233},"end":{"line":60,"column":14,"index":1237}}, + "in": true, + "name": { + "type": "Identifier", + "start":1236,"end":1237,"loc":{"start":{"line":60,"column":13,"index":1236},"end":{"line":60,"column":14,"index":1237},"identifierName":"T"}, + "name": "T" + } + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":1241,"end":1282,"loc":{"start":{"line":60,"column":18,"index":1241},"end":{"line":63,"column":1,"index":1282}}, + "members": [ + { + "type": "TSPropertySignature", + "start":1257,"end":1262,"loc":{"start":{"line":61,"column":4,"index":1257},"end":{"line":61,"column":9,"index":1262}}, + "key": { + "type": "Identifier", + "start":1257,"end":1258,"loc":{"start":{"line":61,"column":4,"index":1257},"end":{"line":61,"column":5,"index":1258},"identifierName":"x"}, + "name": "x" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1258,"end":1261,"loc":{"start":{"line":61,"column":5,"index":1258},"end":{"line":61,"column":8,"index":1261}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1260,"end":1261,"loc":{"start":{"line":61,"column":7,"index":1260},"end":{"line":61,"column":8,"index":1261}}, + "typeName": { + "type": "Identifier", + "start":1260,"end":1261,"loc":{"start":{"line":61,"column":7,"index":1260},"end":{"line":61,"column":8,"index":1261},"identifierName":"T"}, + "name": "T" + } + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1244,"end":1252,"loc":{"start":{"line":60,"column":21,"index":1244},"end":{"line":60,"column":29,"index":1252}} + } + ] + }, + { + "type": "TSPropertySignature", + "start":1267,"end":1280,"loc":{"start":{"line":62,"column":4,"index":1267},"end":{"line":62,"column":17,"index":1280}}, + "key": { + "type": "Identifier", + "start":1267,"end":1268,"loc":{"start":{"line":62,"column":4,"index":1267},"end":{"line":62,"column":5,"index":1268},"identifierName":"f"}, + "name": "f" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1268,"end":1279,"loc":{"start":{"line":62,"column":5,"index":1268},"end":{"line":62,"column":16,"index":1279}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1270,"end":1279,"loc":{"start":{"line":62,"column":7,"index":1270},"end":{"line":62,"column":16,"index":1279}}, + "typeName": { + "type": "Identifier", + "start":1270,"end":1276,"loc":{"start":{"line":62,"column":7,"index":1270},"end":{"line":62,"column":13,"index":1276},"identifierName":"FooFn1"}, + "name": "FooFn1" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":1276,"end":1279,"loc":{"start":{"line":62,"column":13,"index":1276},"end":{"line":62,"column":16,"index":1279}}, + "params": [ + { + "type": "TSTypeReference", + "start":1277,"end":1278,"loc":{"start":{"line":62,"column":14,"index":1277},"end":{"line":62,"column":15,"index":1278}}, + "typeName": { + "type": "Identifier", + "start":1277,"end":1278,"loc":{"start":{"line":62,"column":14,"index":1277},"end":{"line":62,"column":15,"index":1278},"identifierName":"T"}, + "name": "T" + } + } + ] + } + } + } + } + ] + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Variance in circular types", + "start":1192,"end":1221,"loc":{"start":{"line":58,"column":0,"index":1192},"end":{"line":58,"column":29,"index":1221}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":1284,"end":1326,"loc":{"start":{"line":65,"column":0,"index":1284},"end":{"line":65,"column":42,"index":1326}}, + "id": { + "type": "Identifier", + "start":1289,"end":1295,"loc":{"start":{"line":65,"column":5,"index":1289},"end":{"line":65,"column":11,"index":1295},"identifierName":"FooFn1"}, + "name": "FooFn1" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1295,"end":1298,"loc":{"start":{"line":65,"column":11,"index":1295},"end":{"line":65,"column":14,"index":1298}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1296,"end":1297,"loc":{"start":{"line":65,"column":12,"index":1296},"end":{"line":65,"column":13,"index":1297}}, + "name": { + "type": "Identifier", + "start":1296,"end":1297,"loc":{"start":{"line":65,"column":12,"index":1296},"end":{"line":65,"column":13,"index":1297},"identifierName":"T"}, + "name": "T" + } + } + ] + }, + "typeAnnotation": { + "type": "TSFunctionType", + "start":1301,"end":1325,"loc":{"start":{"line":65,"column":17,"index":1301},"end":{"line":65,"column":41,"index":1325}}, + "params": [ + { + "type": "Identifier", + "start":1302,"end":1316,"loc":{"start":{"line":65,"column":18,"index":1302},"end":{"line":65,"column":32,"index":1316},"identifierName":"foo"}, + "name": "foo", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1305,"end":1316,"loc":{"start":{"line":65,"column":21,"index":1305},"end":{"line":65,"column":32,"index":1316}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1307,"end":1316,"loc":{"start":{"line":65,"column":23,"index":1307},"end":{"line":65,"column":32,"index":1316}}, + "typeName": { + "type": "Identifier", + "start":1307,"end":1311,"loc":{"start":{"line":65,"column":23,"index":1307},"end":{"line":65,"column":27,"index":1311},"identifierName":"Bar1"}, + "name": "Bar1" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":1311,"end":1316,"loc":{"start":{"line":65,"column":27,"index":1311},"end":{"line":65,"column":32,"index":1316}}, + "params": [ + { + "type": "TSArrayType", + "start":1312,"end":1315,"loc":{"start":{"line":65,"column":28,"index":1312},"end":{"line":65,"column":31,"index":1315}}, + "elementType": { + "type": "TSTypeReference", + "start":1312,"end":1313,"loc":{"start":{"line":65,"column":28,"index":1312},"end":{"line":65,"column":29,"index":1313}}, + "typeName": { + "type": "Identifier", + "start":1312,"end":1313,"loc":{"start":{"line":65,"column":28,"index":1312},"end":{"line":65,"column":29,"index":1313},"identifierName":"T"}, + "name": "T" + } + } + } + ] + } + } + } + } + ], + "returnType": { + "type": "TSTypeAnnotation", + "start":1318,"end":1325,"loc":{"start":{"line":65,"column":34,"index":1318},"end":{"line":65,"column":41,"index":1325}}, + "typeAnnotation": { + "type": "TSVoidKeyword", + "start":1321,"end":1325,"loc":{"start":{"line":65,"column":37,"index":1321},"end":{"line":65,"column":41,"index":1325}} + } + } + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":1328,"end":1368,"loc":{"start":{"line":67,"column":0,"index":1328},"end":{"line":69,"column":1,"index":1368}}, + "id": { + "type": "Identifier", + "start":1333,"end":1337,"loc":{"start":{"line":67,"column":5,"index":1333},"end":{"line":67,"column":9,"index":1337},"identifierName":"Bar1"}, + "name": "Bar1" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1337,"end":1340,"loc":{"start":{"line":67,"column":9,"index":1337},"end":{"line":67,"column":12,"index":1340}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1338,"end":1339,"loc":{"start":{"line":67,"column":10,"index":1338},"end":{"line":67,"column":11,"index":1339}}, + "name": { + "type": "Identifier", + "start":1338,"end":1339,"loc":{"start":{"line":67,"column":10,"index":1338},"end":{"line":67,"column":11,"index":1339},"identifierName":"T"}, + "name": "T" + } + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":1343,"end":1368,"loc":{"start":{"line":67,"column":15,"index":1343},"end":{"line":69,"column":1,"index":1368}}, + "members": [ + { + "type": "TSPropertySignature", + "start":1349,"end":1366,"loc":{"start":{"line":68,"column":4,"index":1349},"end":{"line":68,"column":21,"index":1366}}, + "key": { + "type": "Identifier", + "start":1349,"end":1354,"loc":{"start":{"line":68,"column":4,"index":1349},"end":{"line":68,"column":9,"index":1354},"identifierName":"value"}, + "name": "value" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1354,"end":1365,"loc":{"start":{"line":68,"column":9,"index":1354},"end":{"line":68,"column":20,"index":1365}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1356,"end":1365,"loc":{"start":{"line":68,"column":11,"index":1356},"end":{"line":68,"column":20,"index":1365}}, + "typeName": { + "type": "Identifier", + "start":1356,"end":1360,"loc":{"start":{"line":68,"column":11,"index":1356},"end":{"line":68,"column":15,"index":1360},"identifierName":"Foo1"}, + "name": "Foo1" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":1360,"end":1365,"loc":{"start":{"line":68,"column":15,"index":1360},"end":{"line":68,"column":20,"index":1365}}, + "params": [ + { + "type": "TSArrayType", + "start":1361,"end":1364,"loc":{"start":{"line":68,"column":16,"index":1361},"end":{"line":68,"column":19,"index":1364}}, + "elementType": { + "type": "TSTypeReference", + "start":1361,"end":1362,"loc":{"start":{"line":68,"column":16,"index":1361},"end":{"line":68,"column":17,"index":1362}}, + "typeName": { + "type": "Identifier", + "start":1361,"end":1362,"loc":{"start":{"line":68,"column":16,"index":1361},"end":{"line":68,"column":17,"index":1362},"identifierName":"T"}, + "name": "T" + } + } + } + ] + } + } + } + } + ] + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":1370,"end":1430,"loc":{"start":{"line":71,"column":0,"index":1370},"end":{"line":74,"column":1,"index":1430}}, + "id": { + "type": "Identifier", + "start":1375,"end":1379,"loc":{"start":{"line":71,"column":5,"index":1375},"end":{"line":71,"column":9,"index":1379},"identifierName":"Foo2"}, + "name": "Foo2" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1379,"end":1386,"loc":{"start":{"line":71,"column":9,"index":1379},"end":{"line":71,"column":16,"index":1386}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1380,"end":1385,"loc":{"start":{"line":71,"column":10,"index":1380},"end":{"line":71,"column":15,"index":1385}}, + "out": true, + "name": { + "type": "Identifier", + "start":1384,"end":1385,"loc":{"start":{"line":71,"column":14,"index":1384},"end":{"line":71,"column":15,"index":1385},"identifierName":"T"}, + "name": "T" + } + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":1389,"end":1430,"loc":{"start":{"line":71,"column":19,"index":1389},"end":{"line":74,"column":1,"index":1430}}, + "members": [ + { + "type": "TSPropertySignature", + "start":1405,"end":1410,"loc":{"start":{"line":72,"column":4,"index":1405},"end":{"line":72,"column":9,"index":1410}}, + "key": { + "type": "Identifier", + "start":1405,"end":1406,"loc":{"start":{"line":72,"column":4,"index":1405},"end":{"line":72,"column":5,"index":1406},"identifierName":"x"}, + "name": "x" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1406,"end":1409,"loc":{"start":{"line":72,"column":5,"index":1406},"end":{"line":72,"column":8,"index":1409}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1408,"end":1409,"loc":{"start":{"line":72,"column":7,"index":1408},"end":{"line":72,"column":8,"index":1409}}, + "typeName": { + "type": "Identifier", + "start":1408,"end":1409,"loc":{"start":{"line":72,"column":7,"index":1408},"end":{"line":72,"column":8,"index":1409},"identifierName":"T"}, + "name": "T" + } + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1392,"end":1400,"loc":{"start":{"line":71,"column":22,"index":1392},"end":{"line":71,"column":30,"index":1400}} + } + ] + }, + { + "type": "TSPropertySignature", + "start":1415,"end":1428,"loc":{"start":{"line":73,"column":4,"index":1415},"end":{"line":73,"column":17,"index":1428}}, + "key": { + "type": "Identifier", + "start":1415,"end":1416,"loc":{"start":{"line":73,"column":4,"index":1415},"end":{"line":73,"column":5,"index":1416},"identifierName":"f"}, + "name": "f" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1416,"end":1427,"loc":{"start":{"line":73,"column":5,"index":1416},"end":{"line":73,"column":16,"index":1427}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1418,"end":1427,"loc":{"start":{"line":73,"column":7,"index":1418},"end":{"line":73,"column":16,"index":1427}}, + "typeName": { + "type": "Identifier", + "start":1418,"end":1424,"loc":{"start":{"line":73,"column":7,"index":1418},"end":{"line":73,"column":13,"index":1424},"identifierName":"FooFn2"}, + "name": "FooFn2" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":1424,"end":1427,"loc":{"start":{"line":73,"column":13,"index":1424},"end":{"line":73,"column":16,"index":1427}}, + "params": [ + { + "type": "TSTypeReference", + "start":1425,"end":1426,"loc":{"start":{"line":73,"column":14,"index":1425},"end":{"line":73,"column":15,"index":1426}}, + "typeName": { + "type": "Identifier", + "start":1425,"end":1426,"loc":{"start":{"line":73,"column":14,"index":1425},"end":{"line":73,"column":15,"index":1426},"identifierName":"T"}, + "name": "T" + } + } + ] + } + } + } + } + ] + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":1432,"end":1474,"loc":{"start":{"line":76,"column":0,"index":1432},"end":{"line":76,"column":42,"index":1474}}, + "id": { + "type": "Identifier", + "start":1437,"end":1443,"loc":{"start":{"line":76,"column":5,"index":1437},"end":{"line":76,"column":11,"index":1443},"identifierName":"FooFn2"}, + "name": "FooFn2" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1443,"end":1446,"loc":{"start":{"line":76,"column":11,"index":1443},"end":{"line":76,"column":14,"index":1446}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1444,"end":1445,"loc":{"start":{"line":76,"column":12,"index":1444},"end":{"line":76,"column":13,"index":1445}}, + "name": { + "type": "Identifier", + "start":1444,"end":1445,"loc":{"start":{"line":76,"column":12,"index":1444},"end":{"line":76,"column":13,"index":1445},"identifierName":"T"}, + "name": "T" + } + } + ] + }, + "typeAnnotation": { + "type": "TSFunctionType", + "start":1449,"end":1473,"loc":{"start":{"line":76,"column":17,"index":1449},"end":{"line":76,"column":41,"index":1473}}, + "params": [ + { + "type": "Identifier", + "start":1450,"end":1464,"loc":{"start":{"line":76,"column":18,"index":1450},"end":{"line":76,"column":32,"index":1464},"identifierName":"foo"}, + "name": "foo", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1453,"end":1464,"loc":{"start":{"line":76,"column":21,"index":1453},"end":{"line":76,"column":32,"index":1464}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1455,"end":1464,"loc":{"start":{"line":76,"column":23,"index":1455},"end":{"line":76,"column":32,"index":1464}}, + "typeName": { + "type": "Identifier", + "start":1455,"end":1459,"loc":{"start":{"line":76,"column":23,"index":1455},"end":{"line":76,"column":27,"index":1459},"identifierName":"Bar2"}, + "name": "Bar2" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":1459,"end":1464,"loc":{"start":{"line":76,"column":27,"index":1459},"end":{"line":76,"column":32,"index":1464}}, + "params": [ + { + "type": "TSArrayType", + "start":1460,"end":1463,"loc":{"start":{"line":76,"column":28,"index":1460},"end":{"line":76,"column":31,"index":1463}}, + "elementType": { + "type": "TSTypeReference", + "start":1460,"end":1461,"loc":{"start":{"line":76,"column":28,"index":1460},"end":{"line":76,"column":29,"index":1461}}, + "typeName": { + "type": "Identifier", + "start":1460,"end":1461,"loc":{"start":{"line":76,"column":28,"index":1460},"end":{"line":76,"column":29,"index":1461},"identifierName":"T"}, + "name": "T" + } + } + } + ] + } + } + } + } + ], + "returnType": { + "type": "TSTypeAnnotation", + "start":1466,"end":1473,"loc":{"start":{"line":76,"column":34,"index":1466},"end":{"line":76,"column":41,"index":1473}}, + "typeAnnotation": { + "type": "TSVoidKeyword", + "start":1469,"end":1473,"loc":{"start":{"line":76,"column":37,"index":1469},"end":{"line":76,"column":41,"index":1473}} + } + } + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":1476,"end":1516,"loc":{"start":{"line":78,"column":0,"index":1476},"end":{"line":80,"column":1,"index":1516}}, + "id": { + "type": "Identifier", + "start":1481,"end":1485,"loc":{"start":{"line":78,"column":5,"index":1481},"end":{"line":78,"column":9,"index":1485},"identifierName":"Bar2"}, + "name": "Bar2" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1485,"end":1488,"loc":{"start":{"line":78,"column":9,"index":1485},"end":{"line":78,"column":12,"index":1488}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1486,"end":1487,"loc":{"start":{"line":78,"column":10,"index":1486},"end":{"line":78,"column":11,"index":1487}}, + "name": { + "type": "Identifier", + "start":1486,"end":1487,"loc":{"start":{"line":78,"column":10,"index":1486},"end":{"line":78,"column":11,"index":1487},"identifierName":"T"}, + "name": "T" + } + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":1491,"end":1516,"loc":{"start":{"line":78,"column":15,"index":1491},"end":{"line":80,"column":1,"index":1516}}, + "members": [ + { + "type": "TSPropertySignature", + "start":1497,"end":1514,"loc":{"start":{"line":79,"column":4,"index":1497},"end":{"line":79,"column":21,"index":1514}}, + "key": { + "type": "Identifier", + "start":1497,"end":1502,"loc":{"start":{"line":79,"column":4,"index":1497},"end":{"line":79,"column":9,"index":1502},"identifierName":"value"}, + "name": "value" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1502,"end":1513,"loc":{"start":{"line":79,"column":9,"index":1502},"end":{"line":79,"column":20,"index":1513}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1504,"end":1513,"loc":{"start":{"line":79,"column":11,"index":1504},"end":{"line":79,"column":20,"index":1513}}, + "typeName": { + "type": "Identifier", + "start":1504,"end":1508,"loc":{"start":{"line":79,"column":11,"index":1504},"end":{"line":79,"column":15,"index":1508},"identifierName":"Foo2"}, + "name": "Foo2" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":1508,"end":1513,"loc":{"start":{"line":79,"column":15,"index":1508},"end":{"line":79,"column":20,"index":1513}}, + "params": [ + { + "type": "TSArrayType", + "start":1509,"end":1512,"loc":{"start":{"line":79,"column":16,"index":1509},"end":{"line":79,"column":19,"index":1512}}, + "elementType": { + "type": "TSTypeReference", + "start":1509,"end":1510,"loc":{"start":{"line":79,"column":16,"index":1509},"end":{"line":79,"column":17,"index":1510}}, + "typeName": { + "type": "Identifier", + "start":1509,"end":1510,"loc":{"start":{"line":79,"column":16,"index":1509},"end":{"line":79,"column":17,"index":1510},"identifierName":"T"}, + "name": "T" + } + } + } + ] + } + } + } + } + ] + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":1518,"end":1571,"loc":{"start":{"line":82,"column":0,"index":1518},"end":{"line":85,"column":1,"index":1571}}, + "id": { + "type": "Identifier", + "start":1523,"end":1527,"loc":{"start":{"line":82,"column":5,"index":1523},"end":{"line":82,"column":9,"index":1527},"identifierName":"Foo3"}, + "name": "Foo3" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1527,"end":1537,"loc":{"start":{"line":82,"column":9,"index":1527},"end":{"line":82,"column":19,"index":1537}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1528,"end":1536,"loc":{"start":{"line":82,"column":10,"index":1528},"end":{"line":82,"column":18,"index":1536}}, + "in": true, + "out": true, + "name": { + "type": "Identifier", + "start":1535,"end":1536,"loc":{"start":{"line":82,"column":17,"index":1535},"end":{"line":82,"column":18,"index":1536},"identifierName":"T"}, + "name": "T" + } + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":1540,"end":1571,"loc":{"start":{"line":82,"column":22,"index":1540},"end":{"line":85,"column":1,"index":1571}}, + "members": [ + { + "type": "TSPropertySignature", + "start":1546,"end":1551,"loc":{"start":{"line":83,"column":4,"index":1546},"end":{"line":83,"column":9,"index":1551}}, + "key": { + "type": "Identifier", + "start":1546,"end":1547,"loc":{"start":{"line":83,"column":4,"index":1546},"end":{"line":83,"column":5,"index":1547},"identifierName":"x"}, + "name": "x" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1547,"end":1550,"loc":{"start":{"line":83,"column":5,"index":1547},"end":{"line":83,"column":8,"index":1550}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1549,"end":1550,"loc":{"start":{"line":83,"column":7,"index":1549},"end":{"line":83,"column":8,"index":1550}}, + "typeName": { + "type": "Identifier", + "start":1549,"end":1550,"loc":{"start":{"line":83,"column":7,"index":1549},"end":{"line":83,"column":8,"index":1550},"identifierName":"T"}, + "name": "T" + } + } + } + }, + { + "type": "TSPropertySignature", + "start":1556,"end":1569,"loc":{"start":{"line":84,"column":4,"index":1556},"end":{"line":84,"column":17,"index":1569}}, + "key": { + "type": "Identifier", + "start":1556,"end":1557,"loc":{"start":{"line":84,"column":4,"index":1556},"end":{"line":84,"column":5,"index":1557},"identifierName":"f"}, + "name": "f" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1557,"end":1568,"loc":{"start":{"line":84,"column":5,"index":1557},"end":{"line":84,"column":16,"index":1568}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1559,"end":1568,"loc":{"start":{"line":84,"column":7,"index":1559},"end":{"line":84,"column":16,"index":1568}}, + "typeName": { + "type": "Identifier", + "start":1559,"end":1565,"loc":{"start":{"line":84,"column":7,"index":1559},"end":{"line":84,"column":13,"index":1565},"identifierName":"FooFn3"}, + "name": "FooFn3" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":1565,"end":1568,"loc":{"start":{"line":84,"column":13,"index":1565},"end":{"line":84,"column":16,"index":1568}}, + "params": [ + { + "type": "TSTypeReference", + "start":1566,"end":1567,"loc":{"start":{"line":84,"column":14,"index":1566},"end":{"line":84,"column":15,"index":1567}}, + "typeName": { + "type": "Identifier", + "start":1566,"end":1567,"loc":{"start":{"line":84,"column":14,"index":1566},"end":{"line":84,"column":15,"index":1567},"identifierName":"T"}, + "name": "T" + } + } + ] + } + } + } + } + ] + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":1573,"end":1615,"loc":{"start":{"line":87,"column":0,"index":1573},"end":{"line":87,"column":42,"index":1615}}, + "id": { + "type": "Identifier", + "start":1578,"end":1584,"loc":{"start":{"line":87,"column":5,"index":1578},"end":{"line":87,"column":11,"index":1584},"identifierName":"FooFn3"}, + "name": "FooFn3" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1584,"end":1587,"loc":{"start":{"line":87,"column":11,"index":1584},"end":{"line":87,"column":14,"index":1587}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1585,"end":1586,"loc":{"start":{"line":87,"column":12,"index":1585},"end":{"line":87,"column":13,"index":1586}}, + "name": { + "type": "Identifier", + "start":1585,"end":1586,"loc":{"start":{"line":87,"column":12,"index":1585},"end":{"line":87,"column":13,"index":1586},"identifierName":"T"}, + "name": "T" + } + } + ] + }, + "typeAnnotation": { + "type": "TSFunctionType", + "start":1590,"end":1614,"loc":{"start":{"line":87,"column":17,"index":1590},"end":{"line":87,"column":41,"index":1614}}, + "params": [ + { + "type": "Identifier", + "start":1591,"end":1605,"loc":{"start":{"line":87,"column":18,"index":1591},"end":{"line":87,"column":32,"index":1605},"identifierName":"foo"}, + "name": "foo", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1594,"end":1605,"loc":{"start":{"line":87,"column":21,"index":1594},"end":{"line":87,"column":32,"index":1605}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1596,"end":1605,"loc":{"start":{"line":87,"column":23,"index":1596},"end":{"line":87,"column":32,"index":1605}}, + "typeName": { + "type": "Identifier", + "start":1596,"end":1600,"loc":{"start":{"line":87,"column":23,"index":1596},"end":{"line":87,"column":27,"index":1600},"identifierName":"Bar3"}, + "name": "Bar3" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":1600,"end":1605,"loc":{"start":{"line":87,"column":27,"index":1600},"end":{"line":87,"column":32,"index":1605}}, + "params": [ + { + "type": "TSArrayType", + "start":1601,"end":1604,"loc":{"start":{"line":87,"column":28,"index":1601},"end":{"line":87,"column":31,"index":1604}}, + "elementType": { + "type": "TSTypeReference", + "start":1601,"end":1602,"loc":{"start":{"line":87,"column":28,"index":1601},"end":{"line":87,"column":29,"index":1602}}, + "typeName": { + "type": "Identifier", + "start":1601,"end":1602,"loc":{"start":{"line":87,"column":28,"index":1601},"end":{"line":87,"column":29,"index":1602},"identifierName":"T"}, + "name": "T" + } + } + } + ] + } + } + } + } + ], + "returnType": { + "type": "TSTypeAnnotation", + "start":1607,"end":1614,"loc":{"start":{"line":87,"column":34,"index":1607},"end":{"line":87,"column":41,"index":1614}}, + "typeAnnotation": { + "type": "TSVoidKeyword", + "start":1610,"end":1614,"loc":{"start":{"line":87,"column":37,"index":1610},"end":{"line":87,"column":41,"index":1614}} + } + } + } + }, + { + "type": "TSTypeAliasDeclaration", + "start":1617,"end":1657,"loc":{"start":{"line":89,"column":0,"index":1617},"end":{"line":91,"column":1,"index":1657}}, + "id": { + "type": "Identifier", + "start":1622,"end":1626,"loc":{"start":{"line":89,"column":5,"index":1622},"end":{"line":89,"column":9,"index":1626},"identifierName":"Bar3"}, + "name": "Bar3" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1626,"end":1629,"loc":{"start":{"line":89,"column":9,"index":1626},"end":{"line":89,"column":12,"index":1629}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1627,"end":1628,"loc":{"start":{"line":89,"column":10,"index":1627},"end":{"line":89,"column":11,"index":1628}}, + "name": { + "type": "Identifier", + "start":1627,"end":1628,"loc":{"start":{"line":89,"column":10,"index":1627},"end":{"line":89,"column":11,"index":1628},"identifierName":"T"}, + "name": "T" + } + } + ] + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":1632,"end":1657,"loc":{"start":{"line":89,"column":15,"index":1632},"end":{"line":91,"column":1,"index":1657}}, + "members": [ + { + "type": "TSPropertySignature", + "start":1638,"end":1655,"loc":{"start":{"line":90,"column":4,"index":1638},"end":{"line":90,"column":21,"index":1655}}, + "key": { + "type": "Identifier", + "start":1638,"end":1643,"loc":{"start":{"line":90,"column":4,"index":1638},"end":{"line":90,"column":9,"index":1643},"identifierName":"value"}, + "name": "value" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1643,"end":1654,"loc":{"start":{"line":90,"column":9,"index":1643},"end":{"line":90,"column":20,"index":1654}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1645,"end":1654,"loc":{"start":{"line":90,"column":11,"index":1645},"end":{"line":90,"column":20,"index":1654}}, + "typeName": { + "type": "Identifier", + "start":1645,"end":1649,"loc":{"start":{"line":90,"column":11,"index":1645},"end":{"line":90,"column":15,"index":1649},"identifierName":"Foo3"}, + "name": "Foo3" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":1649,"end":1654,"loc":{"start":{"line":90,"column":15,"index":1649},"end":{"line":90,"column":20,"index":1654}}, + "params": [ + { + "type": "TSArrayType", + "start":1650,"end":1653,"loc":{"start":{"line":90,"column":16,"index":1650},"end":{"line":90,"column":19,"index":1653}}, + "elementType": { + "type": "TSTypeReference", + "start":1650,"end":1651,"loc":{"start":{"line":90,"column":16,"index":1650},"end":{"line":90,"column":17,"index":1651}}, + "typeName": { + "type": "Identifier", + "start":1650,"end":1651,"loc":{"start":{"line":90,"column":16,"index":1650},"end":{"line":90,"column":17,"index":1651},"identifierName":"T"}, + "name": "T" + } + } + } + ] + } + } + } + } + ] + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Wrong modifier usage", + "start":1659,"end":1682,"loc":{"start":{"line":93,"column":0,"index":1659},"end":{"line":93,"column":23,"index":1682}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":1684,"end":1707,"loc":{"start":{"line":95,"column":0,"index":1684},"end":{"line":95,"column":23,"index":1707}}, + "id": { + "type": "Identifier", + "start":1689,"end":1692,"loc":{"start":{"line":95,"column":5,"index":1689},"end":{"line":95,"column":8,"index":1692},"identifierName":"T20"}, + "name": "T20" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1692,"end":1702,"loc":{"start":{"line":95,"column":8,"index":1692},"end":{"line":95,"column":18,"index":1702}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1693,"end":1701,"loc":{"start":{"line":95,"column":9,"index":1693},"end":{"line":95,"column":17,"index":1701}}, + "accessibility": "public", + "name": { + "type": "Identifier", + "start":1700,"end":1701,"loc":{"start":{"line":95,"column":16,"index":1700},"end":{"line":95,"column":17,"index":1701},"identifierName":"T"}, + "name": "T" + } + } + ] + }, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1705,"end":1706,"loc":{"start":{"line":95,"column":21,"index":1705},"end":{"line":95,"column":22,"index":1706}}, + "typeName": { + "type": "Identifier", + "start":1705,"end":1706,"loc":{"start":{"line":95,"column":21,"index":1705},"end":{"line":95,"column":22,"index":1706},"identifierName":"T"}, + "name": "T" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1709,"end":1717,"loc":{"start":{"line":95,"column":25,"index":1709},"end":{"line":95,"column":33,"index":1717}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Wrong modifier usage", + "start":1659,"end":1682,"loc":{"start":{"line":93,"column":0,"index":1659},"end":{"line":93,"column":23,"index":1682}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":1718,"end":1744,"loc":{"start":{"line":96,"column":0,"index":1718},"end":{"line":96,"column":26,"index":1744}}, + "id": { + "type": "Identifier", + "start":1723,"end":1726,"loc":{"start":{"line":96,"column":5,"index":1723},"end":{"line":96,"column":8,"index":1726},"identifierName":"T21"}, + "name": "T21" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1726,"end":1739,"loc":{"start":{"line":96,"column":8,"index":1726},"end":{"line":96,"column":21,"index":1739}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1727,"end":1738,"loc":{"start":{"line":96,"column":9,"index":1727},"end":{"line":96,"column":20,"index":1738}}, + "in": true, + "out": true, + "name": { + "type": "Identifier", + "start":1737,"end":1738,"loc":{"start":{"line":96,"column":19,"index":1737},"end":{"line":96,"column":20,"index":1738},"identifierName":"T"}, + "name": "T" + } + } + ] + }, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1742,"end":1743,"loc":{"start":{"line":96,"column":24,"index":1742},"end":{"line":96,"column":25,"index":1743}}, + "typeName": { + "type": "Identifier", + "start":1742,"end":1743,"loc":{"start":{"line":96,"column":24,"index":1742},"end":{"line":96,"column":25,"index":1743},"identifierName":"T"}, + "name": "T" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1746,"end":1754,"loc":{"start":{"line":96,"column":28,"index":1746},"end":{"line":96,"column":36,"index":1754}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1709,"end":1717,"loc":{"start":{"line":95,"column":25,"index":1709},"end":{"line":95,"column":33,"index":1717}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":1755,"end":1782,"loc":{"start":{"line":97,"column":0,"index":1755},"end":{"line":97,"column":27,"index":1782}}, + "id": { + "type": "Identifier", + "start":1760,"end":1763,"loc":{"start":{"line":97,"column":5,"index":1760},"end":{"line":97,"column":8,"index":1763},"identifierName":"T22"}, + "name": "T22" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1763,"end":1777,"loc":{"start":{"line":97,"column":8,"index":1763},"end":{"line":97,"column":22,"index":1777}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1764,"end":1776,"loc":{"start":{"line":97,"column":9,"index":1764},"end":{"line":97,"column":21,"index":1776}}, + "in": true, + "out": true, + "name": { + "type": "Identifier", + "start":1775,"end":1776,"loc":{"start":{"line":97,"column":20,"index":1775},"end":{"line":97,"column":21,"index":1776},"identifierName":"T"}, + "name": "T" + } + } + ] + }, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1780,"end":1781,"loc":{"start":{"line":97,"column":25,"index":1780},"end":{"line":97,"column":26,"index":1781}}, + "typeName": { + "type": "Identifier", + "start":1780,"end":1781,"loc":{"start":{"line":97,"column":25,"index":1780},"end":{"line":97,"column":26,"index":1781},"identifierName":"T"}, + "name": "T" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1784,"end":1792,"loc":{"start":{"line":97,"column":29,"index":1784},"end":{"line":97,"column":37,"index":1792}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1746,"end":1754,"loc":{"start":{"line":96,"column":28,"index":1746},"end":{"line":96,"column":36,"index":1754}} + } + ] + }, + { + "type": "TSTypeAliasDeclaration", + "start":1793,"end":1816,"loc":{"start":{"line":98,"column":0,"index":1793},"end":{"line":98,"column":23,"index":1816}}, + "id": { + "type": "Identifier", + "start":1798,"end":1801,"loc":{"start":{"line":98,"column":5,"index":1798},"end":{"line":98,"column":8,"index":1801},"identifierName":"T23"}, + "name": "T23" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1801,"end":1811,"loc":{"start":{"line":98,"column":8,"index":1801},"end":{"line":98,"column":18,"index":1811}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1802,"end":1810,"loc":{"start":{"line":98,"column":9,"index":1802},"end":{"line":98,"column":17,"index":1810}}, + "out": true, + "in": true, + "name": { + "type": "Identifier", + "start":1809,"end":1810,"loc":{"start":{"line":98,"column":16,"index":1809},"end":{"line":98,"column":17,"index":1810},"identifierName":"T"}, + "name": "T" + } + } + ] + }, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1814,"end":1815,"loc":{"start":{"line":98,"column":21,"index":1814},"end":{"line":98,"column":22,"index":1815}}, + "typeName": { + "type": "Identifier", + "start":1814,"end":1815,"loc":{"start":{"line":98,"column":21,"index":1814},"end":{"line":98,"column":22,"index":1815},"identifierName":"T"}, + "name": "T" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1818,"end":1826,"loc":{"start":{"line":98,"column":25,"index":1818},"end":{"line":98,"column":33,"index":1826}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1784,"end":1792,"loc":{"start":{"line":97,"column":29,"index":1784},"end":{"line":97,"column":37,"index":1792}} + } + ] + }, + { + "type": "TSDeclareFunction", + "start":1828,"end":1866,"loc":{"start":{"line":100,"column":0,"index":1828},"end":{"line":100,"column":38,"index":1866}}, + "declare": true, + "id": { + "type": "Identifier", + "start":1845,"end":1847,"loc":{"start":{"line":100,"column":17,"index":1845},"end":{"line":100,"column":19,"index":1847},"identifierName":"f1"}, + "name": "f1" + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1847,"end":1853,"loc":{"start":{"line":100,"column":19,"index":1847},"end":{"line":100,"column":25,"index":1853}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1848,"end":1852,"loc":{"start":{"line":100,"column":20,"index":1848},"end":{"line":100,"column":24,"index":1852}}, + "in": true, + "name": { + "type": "Identifier", + "start":1851,"end":1852,"loc":{"start":{"line":100,"column":23,"index":1851},"end":{"line":100,"column":24,"index":1852},"identifierName":"T"}, + "name": "T" + } + } + ] + }, + "params": [ + { + "type": "Identifier", + "start":1854,"end":1858,"loc":{"start":{"line":100,"column":26,"index":1854},"end":{"line":100,"column":30,"index":1858},"identifierName":"x"}, + "name": "x", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":1855,"end":1858,"loc":{"start":{"line":100,"column":27,"index":1855},"end":{"line":100,"column":30,"index":1858}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1857,"end":1858,"loc":{"start":{"line":100,"column":29,"index":1857},"end":{"line":100,"column":30,"index":1858}}, + "typeName": { + "type": "Identifier", + "start":1857,"end":1858,"loc":{"start":{"line":100,"column":29,"index":1857},"end":{"line":100,"column":30,"index":1858},"identifierName":"T"}, + "name": "T" + } + } + } + } + ], + "returnType": { + "type": "TSTypeAnnotation", + "start":1859,"end":1865,"loc":{"start":{"line":100,"column":31,"index":1859},"end":{"line":100,"column":37,"index":1865}}, + "typeAnnotation": { + "type": "TSVoidKeyword", + "start":1861,"end":1865,"loc":{"start":{"line":100,"column":33,"index":1861},"end":{"line":100,"column":37,"index":1865}} + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1868,"end":1876,"loc":{"start":{"line":100,"column":40,"index":1868},"end":{"line":100,"column":48,"index":1876}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1818,"end":1826,"loc":{"start":{"line":98,"column":25,"index":1818},"end":{"line":98,"column":33,"index":1826}} + } + ] + }, + { + "type": "TSDeclareFunction", + "start":1877,"end":1909,"loc":{"start":{"line":101,"column":0,"index":1877},"end":{"line":101,"column":32,"index":1909}}, + "declare": true, + "id": { + "type": "Identifier", + "start":1894,"end":1896,"loc":{"start":{"line":101,"column":17,"index":1894},"end":{"line":101,"column":19,"index":1896},"identifierName":"f2"}, + "name": "f2" + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":1896,"end":1903,"loc":{"start":{"line":101,"column":19,"index":1896},"end":{"line":101,"column":26,"index":1903}}, + "params": [ + { + "type": "TSTypeParameter", + "start":1897,"end":1902,"loc":{"start":{"line":101,"column":20,"index":1897},"end":{"line":101,"column":25,"index":1902}}, + "out": true, + "name": { + "type": "Identifier", + "start":1901,"end":1902,"loc":{"start":{"line":101,"column":24,"index":1901},"end":{"line":101,"column":25,"index":1902},"identifierName":"T"}, + "name": "T" + } + } + ] + }, + "params": [], + "returnType": { + "type": "TSTypeAnnotation", + "start":1905,"end":1908,"loc":{"start":{"line":101,"column":28,"index":1905},"end":{"line":101,"column":31,"index":1908}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":1907,"end":1908,"loc":{"start":{"line":101,"column":30,"index":1907},"end":{"line":101,"column":31,"index":1908}}, + "typeName": { + "type": "Identifier", + "start":1907,"end":1908,"loc":{"start":{"line":101,"column":30,"index":1907},"end":{"line":101,"column":31,"index":1908},"identifierName":"T"}, + "name": "T" + } + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1911,"end":1919,"loc":{"start":{"line":101,"column":34,"index":1911},"end":{"line":101,"column":42,"index":1919}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1868,"end":1876,"loc":{"start":{"line":100,"column":40,"index":1868},"end":{"line":100,"column":48,"index":1876}} + } + ] + }, + { + "type": "ClassDeclaration", + "start":1921,"end":1981,"loc":{"start":{"line":103,"column":0,"index":1921},"end":{"line":106,"column":1,"index":1981}}, + "id": { + "type": "Identifier", + "start":1927,"end":1928,"loc":{"start":{"line":103,"column":6,"index":1927},"end":{"line":103,"column":7,"index":1928},"identifierName":"C"}, + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start":1929,"end":1981,"loc":{"start":{"line":103,"column":8,"index":1929},"end":{"line":106,"column":1,"index":1981}}, + "body": [ + { + "type": "ClassProperty", + "start":1935,"end":1944,"loc":{"start":{"line":104,"column":4,"index":1935},"end":{"line":104,"column":13,"index":1944}}, + "in": true, + "static": false, + "key": { + "type": "Identifier", + "start":1938,"end":1939,"loc":{"start":{"line":104,"column":7,"index":1938},"end":{"line":104,"column":8,"index":1939},"identifierName":"a"}, + "name": "a" + }, + "computed": false, + "value": { + "type": "NumericLiteral", + "start":1942,"end":1943,"loc":{"start":{"line":104,"column":11,"index":1942},"end":{"line":104,"column":12,"index":1943}}, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1946,"end":1954,"loc":{"start":{"line":104,"column":15,"index":1946},"end":{"line":104,"column":23,"index":1954}} + } + ] + }, + { + "type": "ClassProperty", + "start":1959,"end":1969,"loc":{"start":{"line":105,"column":4,"index":1959},"end":{"line":105,"column":14,"index":1969}}, + "out": true, + "static": false, + "key": { + "type": "Identifier", + "start":1963,"end":1964,"loc":{"start":{"line":105,"column":8,"index":1963},"end":{"line":105,"column":9,"index":1964},"identifierName":"b"}, + "name": "b" + }, + "computed": false, + "value": { + "type": "NumericLiteral", + "start":1967,"end":1968,"loc":{"start":{"line":105,"column":12,"index":1967},"end":{"line":105,"column":13,"index":1968}}, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1971,"end":1979,"loc":{"start":{"line":105,"column":16,"index":1971},"end":{"line":105,"column":24,"index":1979}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1946,"end":1954,"loc":{"start":{"line":104,"column":15,"index":1946},"end":{"line":104,"column":23,"index":1954}} + } + ] + } + ] + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Interface merging", + "start":1983,"end":2003,"loc":{"start":{"line":108,"column":0,"index":1983},"end":{"line":108,"column":20,"index":2003}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":1911,"end":1919,"loc":{"start":{"line":101,"column":34,"index":1911},"end":{"line":101,"column":42,"index":1919}} + } + ] + }, + { + "type": "TSInterfaceDeclaration", + "start":2005,"end":2028,"loc":{"start":{"line":110,"column":0,"index":2005},"end":{"line":110,"column":23,"index":2028}}, + "id": { + "type": "Identifier", + "start":2015,"end":2018,"loc":{"start":{"line":110,"column":10,"index":2015},"end":{"line":110,"column":13,"index":2018},"identifierName":"Baz"}, + "name": "Baz" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":2018,"end":2025,"loc":{"start":{"line":110,"column":13,"index":2018},"end":{"line":110,"column":20,"index":2025}}, + "params": [ + { + "type": "TSTypeParameter", + "start":2019,"end":2024,"loc":{"start":{"line":110,"column":14,"index":2019},"end":{"line":110,"column":19,"index":2024}}, + "out": true, + "name": { + "type": "Identifier", + "start":2023,"end":2024,"loc":{"start":{"line":110,"column":18,"index":2023},"end":{"line":110,"column":19,"index":2024},"identifierName":"T"}, + "name": "T" + } + } + ] + }, + "body": { + "type": "TSInterfaceBody", + "start":2026,"end":2028,"loc":{"start":{"line":110,"column":21,"index":2026},"end":{"line":110,"column":23,"index":2028}}, + "body": [] + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Interface merging", + "start":1983,"end":2003,"loc":{"start":{"line":108,"column":0,"index":1983},"end":{"line":108,"column":20,"index":2003}} + } + ] + }, + { + "type": "TSInterfaceDeclaration", + "start":2029,"end":2051,"loc":{"start":{"line":111,"column":0,"index":2029},"end":{"line":111,"column":22,"index":2051}}, + "id": { + "type": "Identifier", + "start":2039,"end":2042,"loc":{"start":{"line":111,"column":10,"index":2039},"end":{"line":111,"column":13,"index":2042},"identifierName":"Baz"}, + "name": "Baz" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":2042,"end":2048,"loc":{"start":{"line":111,"column":13,"index":2042},"end":{"line":111,"column":19,"index":2048}}, + "params": [ + { + "type": "TSTypeParameter", + "start":2043,"end":2047,"loc":{"start":{"line":111,"column":14,"index":2043},"end":{"line":111,"column":18,"index":2047}}, + "in": true, + "name": { + "type": "Identifier", + "start":2046,"end":2047,"loc":{"start":{"line":111,"column":17,"index":2046},"end":{"line":111,"column":18,"index":2047},"identifierName":"T"}, + "name": "T" + } + } + ] + }, + "body": { + "type": "TSInterfaceBody", + "start":2049,"end":2051,"loc":{"start":{"line":111,"column":20,"index":2049},"end":{"line":111,"column":22,"index":2051}}, + "body": [] + } + }, + { + "type": "VariableDeclaration", + "start":2053,"end":2084,"loc":{"start":{"line":113,"column":0,"index":2053},"end":{"line":113,"column":31,"index":2084}}, + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "start":2065,"end":2083,"loc":{"start":{"line":113,"column":12,"index":2065},"end":{"line":113,"column":30,"index":2083}}, + "id": { + "type": "Identifier", + "start":2065,"end":2083,"loc":{"start":{"line":113,"column":12,"index":2065},"end":{"line":113,"column":30,"index":2083},"identifierName":"baz1"}, + "name": "baz1", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2069,"end":2083,"loc":{"start":{"line":113,"column":16,"index":2069},"end":{"line":113,"column":30,"index":2083}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2071,"end":2083,"loc":{"start":{"line":113,"column":18,"index":2071},"end":{"line":113,"column":30,"index":2083}}, + "typeName": { + "type": "Identifier", + "start":2071,"end":2074,"loc":{"start":{"line":113,"column":18,"index":2071},"end":{"line":113,"column":21,"index":2074},"identifierName":"Baz"}, + "name": "Baz" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2074,"end":2083,"loc":{"start":{"line":113,"column":21,"index":2074},"end":{"line":113,"column":30,"index":2083}}, + "params": [ + { + "type": "TSUnknownKeyword", + "start":2075,"end":2082,"loc":{"start":{"line":113,"column":22,"index":2075},"end":{"line":113,"column":29,"index":2082}} + } + ] + } + } + } + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "VariableDeclaration", + "start":2085,"end":2115,"loc":{"start":{"line":114,"column":0,"index":2085},"end":{"line":114,"column":30,"index":2115}}, + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "start":2097,"end":2114,"loc":{"start":{"line":114,"column":12,"index":2097},"end":{"line":114,"column":29,"index":2114}}, + "id": { + "type": "Identifier", + "start":2097,"end":2114,"loc":{"start":{"line":114,"column":12,"index":2097},"end":{"line":114,"column":29,"index":2114},"identifierName":"baz2"}, + "name": "baz2", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2101,"end":2114,"loc":{"start":{"line":114,"column":16,"index":2101},"end":{"line":114,"column":29,"index":2114}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2103,"end":2114,"loc":{"start":{"line":114,"column":18,"index":2103},"end":{"line":114,"column":29,"index":2114}}, + "typeName": { + "type": "Identifier", + "start":2103,"end":2106,"loc":{"start":{"line":114,"column":18,"index":2103},"end":{"line":114,"column":21,"index":2106},"identifierName":"Baz"}, + "name": "Baz" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2106,"end":2114,"loc":{"start":{"line":114,"column":21,"index":2106},"end":{"line":114,"column":29,"index":2114}}, + "params": [ + { + "type": "TSStringKeyword", + "start":2107,"end":2113,"loc":{"start":{"line":114,"column":22,"index":2107},"end":{"line":114,"column":28,"index":2113}} + } + ] + } + } + } + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "ExpressionStatement", + "start":2117,"end":2129,"loc":{"start":{"line":116,"column":0,"index":2117},"end":{"line":116,"column":12,"index":2129}}, + "expression": { + "type": "AssignmentExpression", + "start":2117,"end":2128,"loc":{"start":{"line":116,"column":0,"index":2117},"end":{"line":116,"column":11,"index":2128}}, + "operator": "=", + "left": { + "type": "Identifier", + "start":2117,"end":2121,"loc":{"start":{"line":116,"column":0,"index":2117},"end":{"line":116,"column":4,"index":2121},"identifierName":"baz1"}, + "name": "baz1" + }, + "right": { + "type": "Identifier", + "start":2124,"end":2128,"loc":{"start":{"line":116,"column":7,"index":2124},"end":{"line":116,"column":11,"index":2128},"identifierName":"baz2"}, + "name": "baz2" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":2131,"end":2139,"loc":{"start":{"line":116,"column":14,"index":2131},"end":{"line":116,"column":22,"index":2139}} + } + ] + }, + { + "type": "ExpressionStatement", + "start":2140,"end":2152,"loc":{"start":{"line":117,"column":0,"index":2140},"end":{"line":117,"column":12,"index":2152}}, + "expression": { + "type": "AssignmentExpression", + "start":2140,"end":2151,"loc":{"start":{"line":117,"column":0,"index":2140},"end":{"line":117,"column":11,"index":2151}}, + "operator": "=", + "left": { + "type": "Identifier", + "start":2140,"end":2144,"loc":{"start":{"line":117,"column":0,"index":2140},"end":{"line":117,"column":4,"index":2144},"identifierName":"baz2"}, + "name": "baz2" + }, + "right": { + "type": "Identifier", + "start":2147,"end":2151,"loc":{"start":{"line":117,"column":7,"index":2147},"end":{"line":117,"column":11,"index":2151},"identifierName":"baz1"}, + "name": "baz1" + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":2154,"end":2162,"loc":{"start":{"line":117,"column":14,"index":2154},"end":{"line":117,"column":22,"index":2162}} + }, + { + "type": "CommentLine", + "value": " Repro from #44572", + "start":2164,"end":2184,"loc":{"start":{"line":119,"column":0,"index":2164},"end":{"line":119,"column":20,"index":2184}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":2131,"end":2139,"loc":{"start":{"line":116,"column":14,"index":2131},"end":{"line":116,"column":22,"index":2139}} + } + ] + }, + { + "type": "TSInterfaceDeclaration", + "start":2186,"end":2271,"loc":{"start":{"line":121,"column":0,"index":2186},"end":{"line":124,"column":1,"index":2271}}, + "id": { + "type": "Identifier", + "start":2196,"end":2202,"loc":{"start":{"line":121,"column":10,"index":2196},"end":{"line":121,"column":16,"index":2202},"identifierName":"Parent"}, + "name": "Parent" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":2202,"end":2209,"loc":{"start":{"line":121,"column":16,"index":2202},"end":{"line":121,"column":23,"index":2209}}, + "params": [ + { + "type": "TSTypeParameter", + "start":2203,"end":2208,"loc":{"start":{"line":121,"column":17,"index":2203},"end":{"line":121,"column":22,"index":2208}}, + "out": true, + "name": { + "type": "Identifier", + "start":2207,"end":2208,"loc":{"start":{"line":121,"column":21,"index":2207},"end":{"line":121,"column":22,"index":2208},"identifierName":"A"}, + "name": "A" + } + } + ] + }, + "body": { + "type": "TSInterfaceBody", + "start":2210,"end":2271,"loc":{"start":{"line":121,"column":24,"index":2210},"end":{"line":124,"column":1,"index":2271}}, + "body": [ + { + "type": "TSPropertySignature", + "start":2216,"end":2239,"loc":{"start":{"line":122,"column":4,"index":2216},"end":{"line":122,"column":27,"index":2239}}, + "key": { + "type": "Identifier", + "start":2216,"end":2221,"loc":{"start":{"line":122,"column":4,"index":2216},"end":{"line":122,"column":9,"index":2221},"identifierName":"child"}, + "name": "child" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2221,"end":2238,"loc":{"start":{"line":122,"column":9,"index":2221},"end":{"line":122,"column":26,"index":2238}}, + "typeAnnotation": { + "type": "TSUnionType", + "start":2223,"end":2238,"loc":{"start":{"line":122,"column":11,"index":2223},"end":{"line":122,"column":26,"index":2238}}, + "types": [ + { + "type": "TSTypeReference", + "start":2223,"end":2231,"loc":{"start":{"line":122,"column":11,"index":2223},"end":{"line":122,"column":19,"index":2231}}, + "typeName": { + "type": "Identifier", + "start":2223,"end":2228,"loc":{"start":{"line":122,"column":11,"index":2223},"end":{"line":122,"column":16,"index":2228},"identifierName":"Child"}, + "name": "Child" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2228,"end":2231,"loc":{"start":{"line":122,"column":16,"index":2228},"end":{"line":122,"column":19,"index":2231}}, + "params": [ + { + "type": "TSTypeReference", + "start":2229,"end":2230,"loc":{"start":{"line":122,"column":17,"index":2229},"end":{"line":122,"column":18,"index":2230}}, + "typeName": { + "type": "Identifier", + "start":2229,"end":2230,"loc":{"start":{"line":122,"column":17,"index":2229},"end":{"line":122,"column":18,"index":2230},"identifierName":"A"}, + "name": "A" + } + } + ] + } + }, + { + "type": "TSNullKeyword", + "start":2234,"end":2238,"loc":{"start":{"line":122,"column":22,"index":2234},"end":{"line":122,"column":26,"index":2238}} + } + ] + } + } + }, + { + "type": "TSPropertySignature", + "start":2244,"end":2269,"loc":{"start":{"line":123,"column":4,"index":2244},"end":{"line":123,"column":29,"index":2269}}, + "key": { + "type": "Identifier", + "start":2244,"end":2250,"loc":{"start":{"line":123,"column":4,"index":2244},"end":{"line":123,"column":10,"index":2250},"identifierName":"parent"}, + "name": "parent" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2250,"end":2268,"loc":{"start":{"line":123,"column":10,"index":2250},"end":{"line":123,"column":28,"index":2268}}, + "typeAnnotation": { + "type": "TSUnionType", + "start":2252,"end":2268,"loc":{"start":{"line":123,"column":12,"index":2252},"end":{"line":123,"column":28,"index":2268}}, + "types": [ + { + "type": "TSTypeReference", + "start":2252,"end":2261,"loc":{"start":{"line":123,"column":12,"index":2252},"end":{"line":123,"column":21,"index":2261}}, + "typeName": { + "type": "Identifier", + "start":2252,"end":2258,"loc":{"start":{"line":123,"column":12,"index":2252},"end":{"line":123,"column":18,"index":2258},"identifierName":"Parent"}, + "name": "Parent" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2258,"end":2261,"loc":{"start":{"line":123,"column":18,"index":2258},"end":{"line":123,"column":21,"index":2261}}, + "params": [ + { + "type": "TSTypeReference", + "start":2259,"end":2260,"loc":{"start":{"line":123,"column":19,"index":2259},"end":{"line":123,"column":20,"index":2260}}, + "typeName": { + "type": "Identifier", + "start":2259,"end":2260,"loc":{"start":{"line":123,"column":19,"index":2259},"end":{"line":123,"column":20,"index":2260},"identifierName":"A"}, + "name": "A" + } + } + ] + } + }, + { + "type": "TSNullKeyword", + "start":2264,"end":2268,"loc":{"start":{"line":123,"column":24,"index":2264},"end":{"line":123,"column":28,"index":2268}} + } + ] + } + } + } + ] + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":2154,"end":2162,"loc":{"start":{"line":117,"column":14,"index":2154},"end":{"line":117,"column":22,"index":2162}} + }, + { + "type": "CommentLine", + "value": " Repro from #44572", + "start":2164,"end":2184,"loc":{"start":{"line":119,"column":0,"index":2164},"end":{"line":119,"column":20,"index":2184}} + } + ] + }, + { + "type": "TSInterfaceDeclaration", + "start":2273,"end":2364,"loc":{"start":{"line":126,"column":0,"index":2273},"end":{"line":129,"column":1,"index":2364}}, + "id": { + "type": "Identifier", + "start":2283,"end":2288,"loc":{"start":{"line":126,"column":10,"index":2283},"end":{"line":126,"column":15,"index":2288},"identifierName":"Child"}, + "name": "Child" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":2288,"end":2304,"loc":{"start":{"line":126,"column":15,"index":2288},"end":{"line":126,"column":31,"index":2304}}, + "params": [ + { + "type": "TSTypeParameter", + "start":2289,"end":2290,"loc":{"start":{"line":126,"column":16,"index":2289},"end":{"line":126,"column":17,"index":2290}}, + "name": { + "type": "Identifier", + "start":2289,"end":2290,"loc":{"start":{"line":126,"column":16,"index":2289},"end":{"line":126,"column":17,"index":2290},"identifierName":"A"}, + "name": "A" + } + }, + { + "type": "TSTypeParameter", + "start":2292,"end":2303,"loc":{"start":{"line":126,"column":19,"index":2292},"end":{"line":126,"column":30,"index":2303}}, + "name": { + "type": "Identifier", + "start":2292,"end":2293,"loc":{"start":{"line":126,"column":19,"index":2292},"end":{"line":126,"column":20,"index":2293},"identifierName":"B"}, + "name": "B" + }, + "default": { + "type": "TSUnknownKeyword", + "start":2296,"end":2303,"loc":{"start":{"line":126,"column":23,"index":2296},"end":{"line":126,"column":30,"index":2303}} + } + } + ] + }, + "extends": [ + { + "type": "TSExpressionWithTypeArguments", + "start":2313,"end":2322,"loc":{"start":{"line":126,"column":40,"index":2313},"end":{"line":126,"column":49,"index":2322}}, + "expression": { + "type": "Identifier", + "start":2313,"end":2319,"loc":{"start":{"line":126,"column":40,"index":2313},"end":{"line":126,"column":46,"index":2319},"identifierName":"Parent"}, + "name": "Parent" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2319,"end":2322,"loc":{"start":{"line":126,"column":46,"index":2319},"end":{"line":126,"column":49,"index":2322}}, + "params": [ + { + "type": "TSTypeReference", + "start":2320,"end":2321,"loc":{"start":{"line":126,"column":47,"index":2320},"end":{"line":126,"column":48,"index":2321}}, + "typeName": { + "type": "Identifier", + "start":2320,"end":2321,"loc":{"start":{"line":126,"column":47,"index":2320},"end":{"line":126,"column":48,"index":2321},"identifierName":"A"}, + "name": "A" + } + } + ] + } + } + ], + "body": { + "type": "TSInterfaceBody", + "start":2323,"end":2364,"loc":{"start":{"line":126,"column":50,"index":2323},"end":{"line":129,"column":1,"index":2364}}, + "body": [ + { + "type": "TSPropertySignature", + "start":2329,"end":2343,"loc":{"start":{"line":127,"column":4,"index":2329},"end":{"line":127,"column":18,"index":2343}}, + "readonly": true, + "key": { + "type": "Identifier", + "start":2338,"end":2339,"loc":{"start":{"line":127,"column":13,"index":2338},"end":{"line":127,"column":14,"index":2339},"identifierName":"a"}, + "name": "a" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2339,"end":2342,"loc":{"start":{"line":127,"column":14,"index":2339},"end":{"line":127,"column":17,"index":2342}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2341,"end":2342,"loc":{"start":{"line":127,"column":16,"index":2341},"end":{"line":127,"column":17,"index":2342}}, + "typeName": { + "type": "Identifier", + "start":2341,"end":2342,"loc":{"start":{"line":127,"column":16,"index":2341},"end":{"line":127,"column":17,"index":2342},"identifierName":"A"}, + "name": "A" + } + } + } + }, + { + "type": "TSPropertySignature", + "start":2348,"end":2362,"loc":{"start":{"line":128,"column":4,"index":2348},"end":{"line":128,"column":18,"index":2362}}, + "readonly": true, + "key": { + "type": "Identifier", + "start":2357,"end":2358,"loc":{"start":{"line":128,"column":13,"index":2357},"end":{"line":128,"column":14,"index":2358},"identifierName":"b"}, + "name": "b" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2358,"end":2361,"loc":{"start":{"line":128,"column":14,"index":2358},"end":{"line":128,"column":17,"index":2361}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2360,"end":2361,"loc":{"start":{"line":128,"column":16,"index":2360},"end":{"line":128,"column":17,"index":2361}}, + "typeName": { + "type": "Identifier", + "start":2360,"end":2361,"loc":{"start":{"line":128,"column":16,"index":2360},"end":{"line":128,"column":17,"index":2361},"identifierName":"B"}, + "name": "B" + } + } + } + } + ] + } + }, + { + "type": "FunctionDeclaration", + "start":2366,"end":2434,"loc":{"start":{"line":131,"column":0,"index":2366},"end":{"line":133,"column":1,"index":2434}}, + "id": { + "type": "Identifier", + "start":2375,"end":2377,"loc":{"start":{"line":131,"column":9,"index":2375},"end":{"line":131,"column":11,"index":2377},"identifierName":"fn"}, + "name": "fn" + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":2377,"end":2380,"loc":{"start":{"line":131,"column":11,"index":2377},"end":{"line":131,"column":14,"index":2380}}, + "params": [ + { + "type": "TSTypeParameter", + "start":2378,"end":2379,"loc":{"start":{"line":131,"column":12,"index":2378},"end":{"line":131,"column":13,"index":2379}}, + "name": { + "type": "Identifier", + "start":2378,"end":2379,"loc":{"start":{"line":131,"column":12,"index":2378},"end":{"line":131,"column":13,"index":2379},"identifierName":"A"}, + "name": "A" + } + } + ] + }, + "params": [ + { + "type": "Identifier", + "start":2381,"end":2394,"loc":{"start":{"line":131,"column":15,"index":2381},"end":{"line":131,"column":28,"index":2394},"identifierName":"inp"}, + "name": "inp", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2384,"end":2394,"loc":{"start":{"line":131,"column":18,"index":2384},"end":{"line":131,"column":28,"index":2394}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2386,"end":2394,"loc":{"start":{"line":131,"column":20,"index":2386},"end":{"line":131,"column":28,"index":2394}}, + "typeName": { + "type": "Identifier", + "start":2386,"end":2391,"loc":{"start":{"line":131,"column":20,"index":2386},"end":{"line":131,"column":25,"index":2391},"identifierName":"Child"}, + "name": "Child" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2391,"end":2394,"loc":{"start":{"line":131,"column":25,"index":2391},"end":{"line":131,"column":28,"index":2394}}, + "params": [ + { + "type": "TSTypeReference", + "start":2392,"end":2393,"loc":{"start":{"line":131,"column":26,"index":2392},"end":{"line":131,"column":27,"index":2393}}, + "typeName": { + "type": "Identifier", + "start":2392,"end":2393,"loc":{"start":{"line":131,"column":26,"index":2392},"end":{"line":131,"column":27,"index":2393},"identifierName":"A"}, + "name": "A" + } + } + ] + } + } + } + } + ], + "body": { + "type": "BlockStatement", + "start":2396,"end":2434,"loc":{"start":{"line":131,"column":30,"index":2396},"end":{"line":133,"column":1,"index":2434}}, + "body": [ + { + "type": "VariableDeclaration", + "start":2402,"end":2432,"loc":{"start":{"line":132,"column":4,"index":2402},"end":{"line":132,"column":34,"index":2432}}, + "declarations": [ + { + "type": "VariableDeclarator", + "start":2408,"end":2431,"loc":{"start":{"line":132,"column":10,"index":2408},"end":{"line":132,"column":33,"index":2431}}, + "id": { + "type": "Identifier", + "start":2408,"end":2425,"loc":{"start":{"line":132,"column":10,"index":2408},"end":{"line":132,"column":27,"index":2425},"identifierName":"a"}, + "name": "a", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2409,"end":2425,"loc":{"start":{"line":132,"column":11,"index":2409},"end":{"line":132,"column":27,"index":2425}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2411,"end":2425,"loc":{"start":{"line":132,"column":13,"index":2411},"end":{"line":132,"column":27,"index":2425}}, + "typeName": { + "type": "Identifier", + "start":2411,"end":2416,"loc":{"start":{"line":132,"column":13,"index":2411},"end":{"line":132,"column":18,"index":2416},"identifierName":"Child"}, + "name": "Child" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2416,"end":2425,"loc":{"start":{"line":132,"column":18,"index":2416},"end":{"line":132,"column":27,"index":2425}}, + "params": [ + { + "type": "TSUnknownKeyword", + "start":2417,"end":2424,"loc":{"start":{"line":132,"column":19,"index":2417},"end":{"line":132,"column":26,"index":2424}} + } + ] + } + } + } + }, + "init": { + "type": "Identifier", + "start":2428,"end":2431,"loc":{"start":{"line":132,"column":30,"index":2428},"end":{"line":132,"column":33,"index":2431},"identifierName":"inp"}, + "name": "inp" + } + } + ], + "kind": "const" + } + ], + "directives": [] + } + }, + { + "type": "VariableDeclaration", + "start":2436,"end":2531,"loc":{"start":{"line":135,"column":0,"index":2436},"end":{"line":135,"column":95,"index":2531}}, + "declarations": [ + { + "type": "VariableDeclarator", + "start":2442,"end":2530,"loc":{"start":{"line":135,"column":6,"index":2442},"end":{"line":135,"column":94,"index":2530}}, + "id": { + "type": "Identifier", + "start":2442,"end":2461,"loc":{"start":{"line":135,"column":6,"index":2442},"end":{"line":135,"column":25,"index":2461},"identifierName":"pu"}, + "name": "pu", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2444,"end":2461,"loc":{"start":{"line":135,"column":8,"index":2444},"end":{"line":135,"column":25,"index":2461}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2446,"end":2461,"loc":{"start":{"line":135,"column":10,"index":2446},"end":{"line":135,"column":25,"index":2461}}, + "typeName": { + "type": "Identifier", + "start":2446,"end":2452,"loc":{"start":{"line":135,"column":10,"index":2446},"end":{"line":135,"column":16,"index":2452},"identifierName":"Parent"}, + "name": "Parent" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2452,"end":2461,"loc":{"start":{"line":135,"column":16,"index":2452},"end":{"line":135,"column":25,"index":2461}}, + "params": [ + { + "type": "TSUnknownKeyword", + "start":2453,"end":2460,"loc":{"start":{"line":135,"column":17,"index":2453},"end":{"line":135,"column":24,"index":2460}} + } + ] + } + } + } + }, + "init": { + "type": "ObjectExpression", + "start":2464,"end":2530,"loc":{"start":{"line":135,"column":28,"index":2464},"end":{"line":135,"column":94,"index":2530}}, + "properties": [ + { + "type": "ObjectProperty", + "start":2466,"end":2514,"loc":{"start":{"line":135,"column":30,"index":2466},"end":{"line":135,"column":78,"index":2514}}, + "method": false, + "key": { + "type": "Identifier", + "start":2466,"end":2471,"loc":{"start":{"line":135,"column":30,"index":2466},"end":{"line":135,"column":35,"index":2471},"identifierName":"child"}, + "name": "child" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "ObjectExpression", + "start":2473,"end":2514,"loc":{"start":{"line":135,"column":37,"index":2473},"end":{"line":135,"column":78,"index":2514}}, + "properties": [ + { + "type": "ObjectProperty", + "start":2475,"end":2479,"loc":{"start":{"line":135,"column":39,"index":2475},"end":{"line":135,"column":43,"index":2479}}, + "method": false, + "key": { + "type": "Identifier", + "start":2475,"end":2476,"loc":{"start":{"line":135,"column":39,"index":2475},"end":{"line":135,"column":40,"index":2476},"identifierName":"a"}, + "name": "a" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NumericLiteral", + "start":2478,"end":2479,"loc":{"start":{"line":135,"column":42,"index":2478},"end":{"line":135,"column":43,"index":2479}}, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + { + "type": "ObjectProperty", + "start":2481,"end":2485,"loc":{"start":{"line":135,"column":45,"index":2481},"end":{"line":135,"column":49,"index":2485}}, + "method": false, + "key": { + "type": "Identifier", + "start":2481,"end":2482,"loc":{"start":{"line":135,"column":45,"index":2481},"end":{"line":135,"column":46,"index":2482},"identifierName":"b"}, + "name": "b" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NumericLiteral", + "start":2484,"end":2485,"loc":{"start":{"line":135,"column":48,"index":2484},"end":{"line":135,"column":49,"index":2485}}, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + { + "type": "ObjectProperty", + "start":2487,"end":2498,"loc":{"start":{"line":135,"column":51,"index":2487},"end":{"line":135,"column":62,"index":2498}}, + "method": false, + "key": { + "type": "Identifier", + "start":2487,"end":2492,"loc":{"start":{"line":135,"column":51,"index":2487},"end":{"line":135,"column":56,"index":2492},"identifierName":"child"}, + "name": "child" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NullLiteral", + "start":2494,"end":2498,"loc":{"start":{"line":135,"column":58,"index":2494},"end":{"line":135,"column":62,"index":2498}} + } + }, + { + "type": "ObjectProperty", + "start":2500,"end":2512,"loc":{"start":{"line":135,"column":64,"index":2500},"end":{"line":135,"column":76,"index":2512}}, + "method": false, + "key": { + "type": "Identifier", + "start":2500,"end":2506,"loc":{"start":{"line":135,"column":64,"index":2500},"end":{"line":135,"column":70,"index":2506},"identifierName":"parent"}, + "name": "parent" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NullLiteral", + "start":2508,"end":2512,"loc":{"start":{"line":135,"column":72,"index":2508},"end":{"line":135,"column":76,"index":2512}} + } + } + ] + } + }, + { + "type": "ObjectProperty", + "start":2516,"end":2528,"loc":{"start":{"line":135,"column":80,"index":2516},"end":{"line":135,"column":92,"index":2528}}, + "method": false, + "key": { + "type": "Identifier", + "start":2516,"end":2522,"loc":{"start":{"line":135,"column":80,"index":2516},"end":{"line":135,"column":86,"index":2522},"identifierName":"parent"}, + "name": "parent" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NullLiteral", + "start":2524,"end":2528,"loc":{"start":{"line":135,"column":88,"index":2524},"end":{"line":135,"column":92,"index":2528}} + } + } + ] + } + } + ], + "kind": "const" + }, + { + "type": "VariableDeclaration", + "start":2532,"end":2569,"loc":{"start":{"line":136,"column":0,"index":2532},"end":{"line":136,"column":37,"index":2569}}, + "declarations": [ + { + "type": "VariableDeclarator", + "start":2538,"end":2568,"loc":{"start":{"line":136,"column":6,"index":2538},"end":{"line":136,"column":36,"index":2568}}, + "id": { + "type": "Identifier", + "start":2538,"end":2563,"loc":{"start":{"line":136,"column":6,"index":2538},"end":{"line":136,"column":31,"index":2563},"identifierName":"notString"}, + "name": "notString", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2547,"end":2563,"loc":{"start":{"line":136,"column":15,"index":2547},"end":{"line":136,"column":31,"index":2563}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2549,"end":2563,"loc":{"start":{"line":136,"column":17,"index":2549},"end":{"line":136,"column":31,"index":2563}}, + "typeName": { + "type": "Identifier", + "start":2549,"end":2555,"loc":{"start":{"line":136,"column":17,"index":2549},"end":{"line":136,"column":23,"index":2555},"identifierName":"Parent"}, + "name": "Parent" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2555,"end":2563,"loc":{"start":{"line":136,"column":23,"index":2555},"end":{"line":136,"column":31,"index":2563}}, + "params": [ + { + "type": "TSStringKeyword", + "start":2556,"end":2562,"loc":{"start":{"line":136,"column":24,"index":2556},"end":{"line":136,"column":30,"index":2562}} + } + ] + } + } + } + }, + "init": { + "type": "Identifier", + "start":2566,"end":2568,"loc":{"start":{"line":136,"column":34,"index":2566},"end":{"line":136,"column":36,"index":2568},"identifierName":"pu"}, + "name": "pu" + } + } + ], + "kind": "const", + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":2571,"end":2579,"loc":{"start":{"line":136,"column":39,"index":2571},"end":{"line":136,"column":47,"index":2579}} + }, + { + "type": "CommentLine", + "value": " Repro from comment in #44572", + "start":2581,"end":2612,"loc":{"start":{"line":138,"column":0,"index":2581},"end":{"line":138,"column":31,"index":2612}} + } + ] + }, + { + "type": "ClassDeclaration", + "start":2614,"end":2790,"loc":{"start":{"line":140,"column":0,"index":2614},"end":{"line":144,"column":1,"index":2790}}, + "declare": true, + "id": { + "type": "Identifier", + "start":2628,"end":2637,"loc":{"start":{"line":140,"column":14,"index":2628},"end":{"line":140,"column":23,"index":2637},"identifierName":"StateNode"}, + "name": "StateNode" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":2637,"end":2687,"loc":{"start":{"line":140,"column":23,"index":2637},"end":{"line":140,"column":73,"index":2687}}, + "params": [ + { + "type": "TSTypeParameter", + "start":2638,"end":2646,"loc":{"start":{"line":140,"column":24,"index":2638},"end":{"line":140,"column":32,"index":2646}}, + "name": { + "type": "Identifier", + "start":2638,"end":2646,"loc":{"start":{"line":140,"column":24,"index":2638},"end":{"line":140,"column":32,"index":2646},"identifierName":"TContext"}, + "name": "TContext" + } + }, + { + "type": "TSTypeParameter", + "start":2648,"end":2686,"loc":{"start":{"line":140,"column":34,"index":2648},"end":{"line":140,"column":72,"index":2686}}, + "in": true, + "out": true, + "name": { + "type": "Identifier", + "start":2655,"end":2661,"loc":{"start":{"line":140,"column":41,"index":2655},"end":{"line":140,"column":47,"index":2661},"identifierName":"TEvent"}, + "name": "TEvent" + }, + "constraint": { + "type": "TSTypeLiteral", + "start":2670,"end":2686,"loc":{"start":{"line":140,"column":56,"index":2670},"end":{"line":140,"column":72,"index":2686}}, + "members": [ + { + "type": "TSPropertySignature", + "start":2672,"end":2684,"loc":{"start":{"line":140,"column":58,"index":2672},"end":{"line":140,"column":70,"index":2684}}, + "key": { + "type": "Identifier", + "start":2672,"end":2676,"loc":{"start":{"line":140,"column":58,"index":2672},"end":{"line":140,"column":62,"index":2676},"identifierName":"type"}, + "name": "type" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2676,"end":2684,"loc":{"start":{"line":140,"column":62,"index":2676},"end":{"line":140,"column":70,"index":2684}}, + "typeAnnotation": { + "type": "TSStringKeyword", + "start":2678,"end":2684,"loc":{"start":{"line":140,"column":64,"index":2678},"end":{"line":140,"column":70,"index":2684}} + } + } + } + ] + } + } + ] + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start":2688,"end":2790,"loc":{"start":{"line":140,"column":74,"index":2688},"end":{"line":144,"column":1,"index":2790}}, + "body": [ + { + "type": "ClassProperty", + "start":2694,"end":2715,"loc":{"start":{"line":141,"column":4,"index":2694},"end":{"line":141,"column":25,"index":2715}}, + "static": false, + "key": { + "type": "Identifier", + "start":2694,"end":2706,"loc":{"start":{"line":141,"column":4,"index":2694},"end":{"line":141,"column":16,"index":2706},"identifierName":"_storedEvent"}, + "name": "_storedEvent" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2706,"end":2714,"loc":{"start":{"line":141,"column":16,"index":2706},"end":{"line":141,"column":24,"index":2714}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2708,"end":2714,"loc":{"start":{"line":141,"column":18,"index":2708},"end":{"line":141,"column":24,"index":2714}}, + "typeName": { + "type": "Identifier", + "start":2708,"end":2714,"loc":{"start":{"line":141,"column":18,"index":2708},"end":{"line":141,"column":24,"index":2714},"identifierName":"TEvent"}, + "name": "TEvent" + } + } + }, + "value": null + }, + { + "type": "ClassProperty", + "start":2720,"end":2750,"loc":{"start":{"line":142,"column":4,"index":2720},"end":{"line":142,"column":34,"index":2750}}, + "static": false, + "key": { + "type": "Identifier", + "start":2720,"end":2727,"loc":{"start":{"line":142,"column":4,"index":2720},"end":{"line":142,"column":11,"index":2727},"identifierName":"_action"}, + "name": "_action" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2727,"end":2749,"loc":{"start":{"line":142,"column":11,"index":2727},"end":{"line":142,"column":33,"index":2749}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2729,"end":2749,"loc":{"start":{"line":142,"column":13,"index":2729},"end":{"line":142,"column":33,"index":2749}}, + "typeName": { + "type": "Identifier", + "start":2729,"end":2741,"loc":{"start":{"line":142,"column":13,"index":2729},"end":{"line":142,"column":25,"index":2741},"identifierName":"ActionObject"}, + "name": "ActionObject" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2741,"end":2749,"loc":{"start":{"line":142,"column":25,"index":2741},"end":{"line":142,"column":33,"index":2749}}, + "params": [ + { + "type": "TSTypeReference", + "start":2742,"end":2748,"loc":{"start":{"line":142,"column":26,"index":2742},"end":{"line":142,"column":32,"index":2748}}, + "typeName": { + "type": "Identifier", + "start":2742,"end":2748,"loc":{"start":{"line":142,"column":26,"index":2742},"end":{"line":142,"column":32,"index":2748},"identifierName":"TEvent"}, + "name": "TEvent" + } + } + ] + } + } + }, + "value": null + }, + { + "type": "ClassProperty", + "start":2755,"end":2788,"loc":{"start":{"line":143,"column":4,"index":2755},"end":{"line":143,"column":37,"index":2788}}, + "static": false, + "key": { + "type": "Identifier", + "start":2755,"end":2761,"loc":{"start":{"line":143,"column":4,"index":2755},"end":{"line":143,"column":10,"index":2761},"identifierName":"_state"}, + "name": "_state" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2761,"end":2787,"loc":{"start":{"line":143,"column":10,"index":2761},"end":{"line":143,"column":36,"index":2787}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2763,"end":2787,"loc":{"start":{"line":143,"column":12,"index":2763},"end":{"line":143,"column":36,"index":2787}}, + "typeName": { + "type": "Identifier", + "start":2763,"end":2772,"loc":{"start":{"line":143,"column":12,"index":2763},"end":{"line":143,"column":21,"index":2772},"identifierName":"StateNode"}, + "name": "StateNode" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2772,"end":2787,"loc":{"start":{"line":143,"column":21,"index":2772},"end":{"line":143,"column":36,"index":2787}}, + "params": [ + { + "type": "TSTypeReference", + "start":2773,"end":2781,"loc":{"start":{"line":143,"column":22,"index":2773},"end":{"line":143,"column":30,"index":2781}}, + "typeName": { + "type": "Identifier", + "start":2773,"end":2781,"loc":{"start":{"line":143,"column":22,"index":2773},"end":{"line":143,"column":30,"index":2781},"identifierName":"TContext"}, + "name": "TContext" + } + }, + { + "type": "TSAnyKeyword", + "start":2783,"end":2786,"loc":{"start":{"line":143,"column":32,"index":2783},"end":{"line":143,"column":35,"index":2786}} + } + ] + } + } + }, + "value": null + } + ] + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":2571,"end":2579,"loc":{"start":{"line":136,"column":39,"index":2571},"end":{"line":136,"column":47,"index":2579}} + }, + { + "type": "CommentLine", + "value": " Repro from comment in #44572", + "start":2581,"end":2612,"loc":{"start":{"line":138,"column":0,"index":2581},"end":{"line":138,"column":31,"index":2612}} + } + ] + }, + { + "type": "TSInterfaceDeclaration", + "start":2792,"end":2901,"loc":{"start":{"line":146,"column":0,"index":2792},"end":{"line":148,"column":1,"index":2901}}, + "id": { + "type": "Identifier", + "start":2802,"end":2814,"loc":{"start":{"line":146,"column":10,"index":2802},"end":{"line":146,"column":22,"index":2814},"identifierName":"ActionObject"}, + "name": "ActionObject" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":2814,"end":2847,"loc":{"start":{"line":146,"column":22,"index":2814},"end":{"line":146,"column":55,"index":2847}}, + "params": [ + { + "type": "TSTypeParameter", + "start":2815,"end":2846,"loc":{"start":{"line":146,"column":23,"index":2815},"end":{"line":146,"column":54,"index":2846}}, + "name": { + "type": "Identifier", + "start":2815,"end":2821,"loc":{"start":{"line":146,"column":23,"index":2815},"end":{"line":146,"column":29,"index":2821},"identifierName":"TEvent"}, + "name": "TEvent" + }, + "constraint": { + "type": "TSTypeLiteral", + "start":2830,"end":2846,"loc":{"start":{"line":146,"column":38,"index":2830},"end":{"line":146,"column":54,"index":2846}}, + "members": [ + { + "type": "TSPropertySignature", + "start":2832,"end":2844,"loc":{"start":{"line":146,"column":40,"index":2832},"end":{"line":146,"column":52,"index":2844}}, + "key": { + "type": "Identifier", + "start":2832,"end":2836,"loc":{"start":{"line":146,"column":40,"index":2832},"end":{"line":146,"column":44,"index":2836},"identifierName":"type"}, + "name": "type" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2836,"end":2844,"loc":{"start":{"line":146,"column":44,"index":2836},"end":{"line":146,"column":52,"index":2844}}, + "typeAnnotation": { + "type": "TSStringKeyword", + "start":2838,"end":2844,"loc":{"start":{"line":146,"column":46,"index":2838},"end":{"line":146,"column":52,"index":2844}} + } + } + } + ] + } + } + ] + }, + "body": { + "type": "TSInterfaceBody", + "start":2848,"end":2901,"loc":{"start":{"line":146,"column":56,"index":2848},"end":{"line":148,"column":1,"index":2901}}, + "body": [ + { + "type": "TSPropertySignature", + "start":2854,"end":2899,"loc":{"start":{"line":147,"column":4,"index":2854},"end":{"line":147,"column":49,"index":2899}}, + "key": { + "type": "Identifier", + "start":2854,"end":2858,"loc":{"start":{"line":147,"column":4,"index":2854},"end":{"line":147,"column":8,"index":2858},"identifierName":"exec"}, + "name": "exec" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2858,"end":2898,"loc":{"start":{"line":147,"column":8,"index":2858},"end":{"line":147,"column":48,"index":2898}}, + "typeAnnotation": { + "type": "TSFunctionType", + "start":2860,"end":2898,"loc":{"start":{"line":147,"column":10,"index":2860},"end":{"line":147,"column":48,"index":2898}}, + "params": [ + { + "type": "Identifier", + "start":2861,"end":2889,"loc":{"start":{"line":147,"column":11,"index":2861},"end":{"line":147,"column":39,"index":2889},"identifierName":"meta"}, + "name": "meta", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2865,"end":2889,"loc":{"start":{"line":147,"column":15,"index":2865},"end":{"line":147,"column":39,"index":2889}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2867,"end":2889,"loc":{"start":{"line":147,"column":17,"index":2867},"end":{"line":147,"column":39,"index":2889}}, + "typeName": { + "type": "Identifier", + "start":2867,"end":2876,"loc":{"start":{"line":147,"column":17,"index":2867},"end":{"line":147,"column":26,"index":2876},"identifierName":"StateNode"}, + "name": "StateNode" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2876,"end":2889,"loc":{"start":{"line":147,"column":26,"index":2876},"end":{"line":147,"column":39,"index":2889}}, + "params": [ + { + "type": "TSAnyKeyword", + "start":2877,"end":2880,"loc":{"start":{"line":147,"column":27,"index":2877},"end":{"line":147,"column":30,"index":2880}} + }, + { + "type": "TSTypeReference", + "start":2882,"end":2888,"loc":{"start":{"line":147,"column":32,"index":2882},"end":{"line":147,"column":38,"index":2888}}, + "typeName": { + "type": "Identifier", + "start":2882,"end":2888,"loc":{"start":{"line":147,"column":32,"index":2882},"end":{"line":147,"column":38,"index":2888},"identifierName":"TEvent"}, + "name": "TEvent" + } + } + ] + } + } + } + } + ], + "returnType": { + "type": "TSTypeAnnotation", + "start":2891,"end":2898,"loc":{"start":{"line":147,"column":41,"index":2891},"end":{"line":147,"column":48,"index":2898}}, + "typeAnnotation": { + "type": "TSVoidKeyword", + "start":2894,"end":2898,"loc":{"start":{"line":147,"column":44,"index":2894},"end":{"line":147,"column":48,"index":2898}} + } + } + } + } + } + ] + } + }, + { + "type": "TSDeclareFunction", + "start":2903,"end":3018,"loc":{"start":{"line":150,"column":0,"index":2903},"end":{"line":150,"column":115,"index":3018}}, + "declare": true, + "id": { + "type": "Identifier", + "start":2920,"end":2933,"loc":{"start":{"line":150,"column":17,"index":2920},"end":{"line":150,"column":30,"index":2933},"identifierName":"createMachine"}, + "name": "createMachine" + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":2933,"end":2966,"loc":{"start":{"line":150,"column":30,"index":2933},"end":{"line":150,"column":63,"index":2966}}, + "params": [ + { + "type": "TSTypeParameter", + "start":2934,"end":2965,"loc":{"start":{"line":150,"column":31,"index":2934},"end":{"line":150,"column":62,"index":2965}}, + "name": { + "type": "Identifier", + "start":2934,"end":2940,"loc":{"start":{"line":150,"column":31,"index":2934},"end":{"line":150,"column":37,"index":2940},"identifierName":"TEvent"}, + "name": "TEvent" + }, + "constraint": { + "type": "TSTypeLiteral", + "start":2949,"end":2965,"loc":{"start":{"line":150,"column":46,"index":2949},"end":{"line":150,"column":62,"index":2965}}, + "members": [ + { + "type": "TSPropertySignature", + "start":2951,"end":2963,"loc":{"start":{"line":150,"column":48,"index":2951},"end":{"line":150,"column":60,"index":2963}}, + "key": { + "type": "Identifier", + "start":2951,"end":2955,"loc":{"start":{"line":150,"column":48,"index":2951},"end":{"line":150,"column":52,"index":2955},"identifierName":"type"}, + "name": "type" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2955,"end":2963,"loc":{"start":{"line":150,"column":52,"index":2955},"end":{"line":150,"column":60,"index":2963}}, + "typeAnnotation": { + "type": "TSStringKeyword", + "start":2957,"end":2963,"loc":{"start":{"line":150,"column":54,"index":2957},"end":{"line":150,"column":60,"index":2963}} + } + } + } + ] + } + } + ] + }, + "params": [ + { + "type": "Identifier", + "start":2967,"end":2995,"loc":{"start":{"line":150,"column":64,"index":2967},"end":{"line":150,"column":92,"index":2995},"identifierName":"action"}, + "name": "action", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":2973,"end":2995,"loc":{"start":{"line":150,"column":70,"index":2973},"end":{"line":150,"column":92,"index":2995}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2975,"end":2995,"loc":{"start":{"line":150,"column":72,"index":2975},"end":{"line":150,"column":92,"index":2995}}, + "typeName": { + "type": "Identifier", + "start":2975,"end":2987,"loc":{"start":{"line":150,"column":72,"index":2975},"end":{"line":150,"column":84,"index":2987},"identifierName":"ActionObject"}, + "name": "ActionObject" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":2987,"end":2995,"loc":{"start":{"line":150,"column":84,"index":2987},"end":{"line":150,"column":92,"index":2995}}, + "params": [ + { + "type": "TSTypeReference", + "start":2988,"end":2994,"loc":{"start":{"line":150,"column":85,"index":2988},"end":{"line":150,"column":91,"index":2994}}, + "typeName": { + "type": "Identifier", + "start":2988,"end":2994,"loc":{"start":{"line":150,"column":85,"index":2988},"end":{"line":150,"column":91,"index":2994},"identifierName":"TEvent"}, + "name": "TEvent" + } + } + ] + } + } + } + } + ], + "returnType": { + "type": "TSTypeAnnotation", + "start":2996,"end":3017,"loc":{"start":{"line":150,"column":93,"index":2996},"end":{"line":150,"column":114,"index":3017}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":2998,"end":3017,"loc":{"start":{"line":150,"column":95,"index":2998},"end":{"line":150,"column":114,"index":3017}}, + "typeName": { + "type": "Identifier", + "start":2998,"end":3007,"loc":{"start":{"line":150,"column":95,"index":2998},"end":{"line":150,"column":104,"index":3007},"identifierName":"StateNode"}, + "name": "StateNode" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":3007,"end":3017,"loc":{"start":{"line":150,"column":104,"index":3007},"end":{"line":150,"column":114,"index":3017}}, + "params": [ + { + "type": "TSAnyKeyword", + "start":3008,"end":3011,"loc":{"start":{"line":150,"column":105,"index":3008},"end":{"line":150,"column":108,"index":3011}} + }, + { + "type": "TSAnyKeyword", + "start":3013,"end":3016,"loc":{"start":{"line":150,"column":110,"index":3013},"end":{"line":150,"column":113,"index":3016}} + } + ] + } + } + } + }, + { + "type": "TSDeclareFunction", + "start":3020,"end":3098,"loc":{"start":{"line":152,"column":0,"index":3020},"end":{"line":152,"column":78,"index":3098}}, + "declare": true, + "id": { + "type": "Identifier", + "start":3037,"end":3046,"loc":{"start":{"line":152,"column":17,"index":3037},"end":{"line":152,"column":26,"index":3046},"identifierName":"interpret"}, + "name": "interpret" + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":3046,"end":3056,"loc":{"start":{"line":152,"column":26,"index":3046},"end":{"line":152,"column":36,"index":3056}}, + "params": [ + { + "type": "TSTypeParameter", + "start":3047,"end":3055,"loc":{"start":{"line":152,"column":27,"index":3047},"end":{"line":152,"column":35,"index":3055}}, + "name": { + "type": "Identifier", + "start":3047,"end":3055,"loc":{"start":{"line":152,"column":27,"index":3047},"end":{"line":152,"column":35,"index":3055},"identifierName":"TContext"}, + "name": "TContext" + } + } + ] + }, + "params": [ + { + "type": "Identifier", + "start":3057,"end":3090,"loc":{"start":{"line":152,"column":37,"index":3057},"end":{"line":152,"column":70,"index":3090},"identifierName":"machine"}, + "name": "machine", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3064,"end":3090,"loc":{"start":{"line":152,"column":44,"index":3064},"end":{"line":152,"column":70,"index":3090}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":3066,"end":3090,"loc":{"start":{"line":152,"column":46,"index":3066},"end":{"line":152,"column":70,"index":3090}}, + "typeName": { + "type": "Identifier", + "start":3066,"end":3075,"loc":{"start":{"line":152,"column":46,"index":3066},"end":{"line":152,"column":55,"index":3075},"identifierName":"StateNode"}, + "name": "StateNode" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":3075,"end":3090,"loc":{"start":{"line":152,"column":55,"index":3075},"end":{"line":152,"column":70,"index":3090}}, + "params": [ + { + "type": "TSTypeReference", + "start":3076,"end":3084,"loc":{"start":{"line":152,"column":56,"index":3076},"end":{"line":152,"column":64,"index":3084}}, + "typeName": { + "type": "Identifier", + "start":3076,"end":3084,"loc":{"start":{"line":152,"column":56,"index":3076},"end":{"line":152,"column":64,"index":3084},"identifierName":"TContext"}, + "name": "TContext" + } + }, + { + "type": "TSAnyKeyword", + "start":3086,"end":3089,"loc":{"start":{"line":152,"column":66,"index":3086},"end":{"line":152,"column":69,"index":3089}} + } + ] + } + } + } + } + ], + "returnType": { + "type": "TSTypeAnnotation", + "start":3091,"end":3097,"loc":{"start":{"line":152,"column":71,"index":3091},"end":{"line":152,"column":77,"index":3097}}, + "typeAnnotation": { + "type": "TSVoidKeyword", + "start":3093,"end":3097,"loc":{"start":{"line":152,"column":73,"index":3093},"end":{"line":152,"column":77,"index":3097}} + } + } + }, + { + "type": "VariableDeclaration", + "start":3100,"end":3141,"loc":{"start":{"line":154,"column":0,"index":3100},"end":{"line":154,"column":41,"index":3141}}, + "declarations": [ + { + "type": "VariableDeclarator", + "start":3106,"end":3140,"loc":{"start":{"line":154,"column":6,"index":3106},"end":{"line":154,"column":40,"index":3140}}, + "id": { + "type": "Identifier", + "start":3106,"end":3113,"loc":{"start":{"line":154,"column":6,"index":3106},"end":{"line":154,"column":13,"index":3113},"identifierName":"machine"}, + "name": "machine" + }, + "init": { + "type": "CallExpression", + "start":3116,"end":3140,"loc":{"start":{"line":154,"column":16,"index":3116},"end":{"line":154,"column":40,"index":3140}}, + "callee": { + "type": "Identifier", + "start":3116,"end":3129,"loc":{"start":{"line":154,"column":16,"index":3116},"end":{"line":154,"column":29,"index":3129},"identifierName":"createMachine"}, + "name": "createMachine" + }, + "arguments": [ + { + "type": "TSAsExpression", + "start":3130,"end":3139,"loc":{"start":{"line":154,"column":30,"index":3130},"end":{"line":154,"column":39,"index":3139}}, + "expression": { + "type": "ObjectExpression", + "start":3130,"end":3132,"loc":{"start":{"line":154,"column":30,"index":3130},"end":{"line":154,"column":32,"index":3132}}, + "properties": [] + }, + "typeAnnotation": { + "type": "TSAnyKeyword", + "start":3136,"end":3139,"loc":{"start":{"line":154,"column":36,"index":3136},"end":{"line":154,"column":39,"index":3139}} + } + } + ] + } + } + ], + "kind": "const" + }, + { + "type": "ExpressionStatement", + "start":3143,"end":3162,"loc":{"start":{"line":156,"column":0,"index":3143},"end":{"line":156,"column":19,"index":3162}}, + "expression": { + "type": "CallExpression", + "start":3143,"end":3161,"loc":{"start":{"line":156,"column":0,"index":3143},"end":{"line":156,"column":18,"index":3161}}, + "callee": { + "type": "Identifier", + "start":3143,"end":3152,"loc":{"start":{"line":156,"column":0,"index":3143},"end":{"line":156,"column":9,"index":3152},"identifierName":"interpret"}, + "name": "interpret" + }, + "arguments": [ + { + "type": "Identifier", + "start":3153,"end":3160,"loc":{"start":{"line":156,"column":10,"index":3153},"end":{"line":156,"column":17,"index":3160},"identifierName":"machine"}, + "name": "machine" + } + ] + } + }, + { + "type": "VariableDeclaration", + "start":3164,"end":3228,"loc":{"start":{"line":158,"column":0,"index":3164},"end":{"line":158,"column":64,"index":3228}}, + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "start":3178,"end":3227,"loc":{"start":{"line":158,"column":14,"index":3178},"end":{"line":158,"column":63,"index":3227}}, + "id": { + "type": "Identifier", + "start":3178,"end":3227,"loc":{"start":{"line":158,"column":14,"index":3178},"end":{"line":158,"column":63,"index":3227},"identifierName":"qq"}, + "name": "qq", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3180,"end":3227,"loc":{"start":{"line":158,"column":16,"index":3180},"end":{"line":158,"column":63,"index":3227}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":3182,"end":3227,"loc":{"start":{"line":158,"column":18,"index":3182},"end":{"line":158,"column":63,"index":3227}}, + "typeName": { + "type": "Identifier", + "start":3182,"end":3194,"loc":{"start":{"line":158,"column":18,"index":3182},"end":{"line":158,"column":30,"index":3194},"identifierName":"ActionObject"}, + "name": "ActionObject" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":3194,"end":3227,"loc":{"start":{"line":158,"column":30,"index":3194},"end":{"line":158,"column":63,"index":3227}}, + "params": [ + { + "type": "TSTypeLiteral", + "start":3195,"end":3226,"loc":{"start":{"line":158,"column":31,"index":3195},"end":{"line":158,"column":62,"index":3226}}, + "members": [ + { + "type": "TSPropertySignature", + "start":3197,"end":3210,"loc":{"start":{"line":158,"column":33,"index":3197},"end":{"line":158,"column":46,"index":3210}}, + "key": { + "type": "Identifier", + "start":3197,"end":3201,"loc":{"start":{"line":158,"column":33,"index":3197},"end":{"line":158,"column":37,"index":3201},"identifierName":"type"}, + "name": "type" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3201,"end":3209,"loc":{"start":{"line":158,"column":37,"index":3201},"end":{"line":158,"column":45,"index":3209}}, + "typeAnnotation": { + "type": "TSLiteralType", + "start":3203,"end":3209,"loc":{"start":{"line":158,"column":39,"index":3203},"end":{"line":158,"column":45,"index":3209}}, + "literal": { + "type": "StringLiteral", + "start":3203,"end":3209,"loc":{"start":{"line":158,"column":39,"index":3203},"end":{"line":158,"column":45,"index":3209}}, + "extra": { + "rawValue": "PLAY", + "raw": "\"PLAY\"" + }, + "value": "PLAY" + } + } + } + }, + { + "type": "TSPropertySignature", + "start":3211,"end":3224,"loc":{"start":{"line":158,"column":47,"index":3211},"end":{"line":158,"column":60,"index":3224}}, + "key": { + "type": "Identifier", + "start":3211,"end":3216,"loc":{"start":{"line":158,"column":47,"index":3211},"end":{"line":158,"column":52,"index":3216},"identifierName":"value"}, + "name": "value" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3216,"end":3224,"loc":{"start":{"line":158,"column":52,"index":3216},"end":{"line":158,"column":60,"index":3224}}, + "typeAnnotation": { + "type": "TSNumberKeyword", + "start":3218,"end":3224,"loc":{"start":{"line":158,"column":54,"index":3218},"end":{"line":158,"column":60,"index":3224}} + } + } + } + ] + } + ] + } + } + } + }, + "init": null + } + ], + "kind": "const" + }, + { + "type": "ExpressionStatement", + "start":3230,"end":3301,"loc":{"start":{"line":160,"column":0,"index":3230},"end":{"line":160,"column":71,"index":3301}}, + "expression": { + "type": "CallExpression", + "start":3230,"end":3300,"loc":{"start":{"line":160,"column":0,"index":3230},"end":{"line":160,"column":70,"index":3300}}, + "callee": { + "type": "Identifier", + "start":3230,"end":3243,"loc":{"start":{"line":160,"column":0,"index":3230},"end":{"line":160,"column":13,"index":3243},"identifierName":"createMachine"}, + "name": "createMachine" + }, + "arguments": [ + { + "type": "Identifier", + "start":3297,"end":3299,"loc":{"start":{"line":160,"column":67,"index":3297},"end":{"line":160,"column":69,"index":3299},"identifierName":"qq"}, + "name": "qq" + } + ], + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start":3243,"end":3296,"loc":{"start":{"line":160,"column":13,"index":3243},"end":{"line":160,"column":66,"index":3296}}, + "params": [ + { + "type": "TSUnionType", + "start":3244,"end":3295,"loc":{"start":{"line":160,"column":14,"index":3244},"end":{"line":160,"column":65,"index":3295}}, + "types": [ + { + "type": "TSTypeLiteral", + "start":3244,"end":3275,"loc":{"start":{"line":160,"column":14,"index":3244},"end":{"line":160,"column":45,"index":3275}}, + "members": [ + { + "type": "TSPropertySignature", + "start":3246,"end":3259,"loc":{"start":{"line":160,"column":16,"index":3246},"end":{"line":160,"column":29,"index":3259}}, + "key": { + "type": "Identifier", + "start":3246,"end":3250,"loc":{"start":{"line":160,"column":16,"index":3246},"end":{"line":160,"column":20,"index":3250},"identifierName":"type"}, + "name": "type" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3250,"end":3258,"loc":{"start":{"line":160,"column":20,"index":3250},"end":{"line":160,"column":28,"index":3258}}, + "typeAnnotation": { + "type": "TSLiteralType", + "start":3252,"end":3258,"loc":{"start":{"line":160,"column":22,"index":3252},"end":{"line":160,"column":28,"index":3258}}, + "literal": { + "type": "StringLiteral", + "start":3252,"end":3258,"loc":{"start":{"line":160,"column":22,"index":3252},"end":{"line":160,"column":28,"index":3258}}, + "extra": { + "rawValue": "PLAY", + "raw": "\"PLAY\"" + }, + "value": "PLAY" + } + } + } + }, + { + "type": "TSPropertySignature", + "start":3260,"end":3273,"loc":{"start":{"line":160,"column":30,"index":3260},"end":{"line":160,"column":43,"index":3273}}, + "key": { + "type": "Identifier", + "start":3260,"end":3265,"loc":{"start":{"line":160,"column":30,"index":3260},"end":{"line":160,"column":35,"index":3265},"identifierName":"value"}, + "name": "value" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3265,"end":3273,"loc":{"start":{"line":160,"column":35,"index":3265},"end":{"line":160,"column":43,"index":3273}}, + "typeAnnotation": { + "type": "TSNumberKeyword", + "start":3267,"end":3273,"loc":{"start":{"line":160,"column":37,"index":3267},"end":{"line":160,"column":43,"index":3273}} + } + } + } + ] + }, + { + "type": "TSTypeLiteral", + "start":3278,"end":3295,"loc":{"start":{"line":160,"column":48,"index":3278},"end":{"line":160,"column":65,"index":3295}}, + "members": [ + { + "type": "TSPropertySignature", + "start":3280,"end":3293,"loc":{"start":{"line":160,"column":50,"index":3280},"end":{"line":160,"column":63,"index":3293}}, + "key": { + "type": "Identifier", + "start":3280,"end":3284,"loc":{"start":{"line":160,"column":50,"index":3280},"end":{"line":160,"column":54,"index":3284},"identifierName":"type"}, + "name": "type" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":3284,"end":3293,"loc":{"start":{"line":160,"column":54,"index":3284},"end":{"line":160,"column":63,"index":3293}}, + "typeAnnotation": { + "type": "TSLiteralType", + "start":3286,"end":3293,"loc":{"start":{"line":160,"column":56,"index":3286},"end":{"line":160,"column":63,"index":3293}}, + "literal": { + "type": "StringLiteral", + "start":3286,"end":3293,"loc":{"start":{"line":160,"column":56,"index":3286},"end":{"line":160,"column":63,"index":3293}}, + "extra": { + "rawValue": "RESET", + "raw": "\"RESET\"" + }, + "value": "RESET" + } + } + } + } + ] + } + ] + } + ] + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start":3303,"end":3311,"loc":{"start":{"line":160,"column":73,"index":3303},"end":{"line":160,"column":81,"index":3311}} + } + ] } ], "directives": [] - } + }, + "comments": [ + { + "type": "CommentLine", + "value": " Error", + "start":202,"end":210,"loc":{"start":{"line":9,"column":34,"index":202},"end":{"line":9,"column":42,"index":210}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":421,"end":429,"loc":{"start":{"line":18,"column":42,"index":421},"end":{"line":18,"column":50,"index":429}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":654,"end":662,"loc":{"start":{"line":28,"column":34,"index":654},"end":{"line":28,"column":42,"index":662}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":697,"end":705,"loc":{"start":{"line":29,"column":34,"index":697},"end":{"line":29,"column":42,"index":705}} + }, + { + "type": "CommentLine", + "value": " Variance of various type constructors", + "start":707,"end":747,"loc":{"start":{"line":31,"column":0,"index":707},"end":{"line":31,"column":40,"index":747}} + }, + { + "type": "CommentLine", + "value": " Variance annotation errors", + "start":877,"end":906,"loc":{"start":{"line":38,"column":0,"index":877},"end":{"line":38,"column":29,"index":906}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":935,"end":943,"loc":{"start":{"line":40,"column":27,"index":935},"end":{"line":40,"column":35,"index":943}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":996,"end":1004,"loc":{"start":{"line":44,"column":39,"index":996},"end":{"line":44,"column":47,"index":1004}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1038,"end":1046,"loc":{"start":{"line":46,"column":32,"index":1038},"end":{"line":46,"column":40,"index":1046}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1100,"end":1108,"loc":{"start":{"line":50,"column":27,"index":1100},"end":{"line":50,"column":35,"index":1108}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1160,"end":1168,"loc":{"start":{"line":54,"column":28,"index":1160},"end":{"line":54,"column":36,"index":1168}} + }, + { + "type": "CommentLine", + "value": " Variance in circular types", + "start":1192,"end":1221,"loc":{"start":{"line":58,"column":0,"index":1192},"end":{"line":58,"column":29,"index":1221}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1244,"end":1252,"loc":{"start":{"line":60,"column":21,"index":1244},"end":{"line":60,"column":29,"index":1252}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1392,"end":1400,"loc":{"start":{"line":71,"column":22,"index":1392},"end":{"line":71,"column":30,"index":1400}} + }, + { + "type": "CommentLine", + "value": " Wrong modifier usage", + "start":1659,"end":1682,"loc":{"start":{"line":93,"column":0,"index":1659},"end":{"line":93,"column":23,"index":1682}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1709,"end":1717,"loc":{"start":{"line":95,"column":25,"index":1709},"end":{"line":95,"column":33,"index":1717}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1746,"end":1754,"loc":{"start":{"line":96,"column":28,"index":1746},"end":{"line":96,"column":36,"index":1754}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1784,"end":1792,"loc":{"start":{"line":97,"column":29,"index":1784},"end":{"line":97,"column":37,"index":1792}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1818,"end":1826,"loc":{"start":{"line":98,"column":25,"index":1818},"end":{"line":98,"column":33,"index":1826}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1868,"end":1876,"loc":{"start":{"line":100,"column":40,"index":1868},"end":{"line":100,"column":48,"index":1876}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1911,"end":1919,"loc":{"start":{"line":101,"column":34,"index":1911},"end":{"line":101,"column":42,"index":1919}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1946,"end":1954,"loc":{"start":{"line":104,"column":15,"index":1946},"end":{"line":104,"column":23,"index":1954}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":1971,"end":1979,"loc":{"start":{"line":105,"column":16,"index":1971},"end":{"line":105,"column":24,"index":1979}} + }, + { + "type": "CommentLine", + "value": " Interface merging", + "start":1983,"end":2003,"loc":{"start":{"line":108,"column":0,"index":1983},"end":{"line":108,"column":20,"index":2003}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":2131,"end":2139,"loc":{"start":{"line":116,"column":14,"index":2131},"end":{"line":116,"column":22,"index":2139}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":2154,"end":2162,"loc":{"start":{"line":117,"column":14,"index":2154},"end":{"line":117,"column":22,"index":2162}} + }, + { + "type": "CommentLine", + "value": " Repro from #44572", + "start":2164,"end":2184,"loc":{"start":{"line":119,"column":0,"index":2164},"end":{"line":119,"column":20,"index":2184}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":2571,"end":2579,"loc":{"start":{"line":136,"column":39,"index":2571},"end":{"line":136,"column":47,"index":2579}} + }, + { + "type": "CommentLine", + "value": " Repro from comment in #44572", + "start":2581,"end":2612,"loc":{"start":{"line":138,"column":0,"index":2581},"end":{"line":138,"column":31,"index":2612}} + }, + { + "type": "CommentLine", + "value": " Error", + "start":3303,"end":3311,"loc":{"start":{"line":160,"column":73,"index":3303},"end":{"line":160,"column":81,"index":3311}} + } + ] }