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