diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index c70f389e210..c6601d8d37d 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -2351,7 +2351,7 @@ declare namespace ts { */ export interface TypeReference extends ObjectType { target: GenericType; - node?: ArrayTypeNode | TupleTypeNode; + node?: TypeReferenceNode | ArrayTypeNode | TupleTypeNode; } export interface DeferredTypeReference extends TypeReference { } diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index c7b96ded9b2..de30e555988 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -2351,7 +2351,7 @@ declare namespace ts { */ export interface TypeReference extends ObjectType { target: GenericType; - node?: ArrayTypeNode | TupleTypeNode; + node?: TypeReferenceNode | ArrayTypeNode | TupleTypeNode; } export interface DeferredTypeReference extends TypeReference { } diff --git a/tests/baselines/reference/asyncAliasReturnType_es5.types b/tests/baselines/reference/asyncAliasReturnType_es5.types index 87090b795e3..22ca9c932b3 100644 --- a/tests/baselines/reference/asyncAliasReturnType_es5.types +++ b/tests/baselines/reference/asyncAliasReturnType_es5.types @@ -1,7 +1,7 @@ === tests/cases/conformance/async/es5/asyncAliasReturnType_es5.ts === type PromiseAlias = Promise; ->PromiseAlias : Promise +>PromiseAlias : PromiseAlias async function f(): PromiseAlias { ->f : () => Promise +>f : () => PromiseAlias } diff --git a/tests/baselines/reference/asyncAliasReturnType_es6.types b/tests/baselines/reference/asyncAliasReturnType_es6.types index 85d74896056..943856611b5 100644 --- a/tests/baselines/reference/asyncAliasReturnType_es6.types +++ b/tests/baselines/reference/asyncAliasReturnType_es6.types @@ -1,7 +1,7 @@ === tests/cases/conformance/async/es6/asyncAliasReturnType_es6.ts === type PromiseAlias = Promise; ->PromiseAlias : Promise +>PromiseAlias : PromiseAlias async function f(): PromiseAlias { ->f : () => Promise +>f : () => PromiseAlias } diff --git a/tests/baselines/reference/asyncAwait_es2017.types b/tests/baselines/reference/asyncAwait_es2017.types index 4d657ab2ca3..c3fecf0f7c8 100644 --- a/tests/baselines/reference/asyncAwait_es2017.types +++ b/tests/baselines/reference/asyncAwait_es2017.types @@ -1,6 +1,6 @@ === tests/cases/conformance/async/es2017/asyncAwait_es2017.ts === type MyPromise = Promise; ->MyPromise : Promise +>MyPromise : MyPromise declare var MyPromise: typeof Promise; >MyPromise : PromiseConstructor @@ -10,7 +10,7 @@ declare var p: Promise; >p : Promise declare var mp: MyPromise; ->mp : Promise +>mp : MyPromise async function f0() { } >f0 : () => Promise @@ -19,7 +19,7 @@ async function f1(): Promise { } >f1 : () => Promise async function f3(): MyPromise { } ->f3 : () => Promise +>f3 : () => MyPromise let f4 = async function() { } >f4 : () => Promise @@ -30,8 +30,8 @@ let f5 = async function(): Promise { } >async function(): Promise { } : () => Promise let f6 = async function(): MyPromise { } ->f6 : () => Promise ->async function(): MyPromise { } : () => Promise +>f6 : () => MyPromise +>async function(): MyPromise { } : () => MyPromise let f7 = async () => { }; >f7 : () => Promise @@ -42,8 +42,8 @@ let f8 = async (): Promise => { }; >async (): Promise => { } : () => Promise let f9 = async (): MyPromise => { }; ->f9 : () => Promise ->async (): MyPromise => { } : () => Promise +>f9 : () => MyPromise +>async (): MyPromise => { } : () => MyPromise let f10 = async () => p; >f10 : () => Promise @@ -53,21 +53,21 @@ let f10 = async () => p; let f11 = async () => mp; >f11 : () => Promise >async () => mp : () => Promise ->mp : Promise +>mp : MyPromise let f12 = async (): Promise => mp; >f12 : () => Promise >async (): Promise => mp : () => Promise ->mp : Promise +>mp : MyPromise let f13 = async (): MyPromise => p; ->f13 : () => Promise ->async (): MyPromise => p : () => Promise +>f13 : () => MyPromise +>async (): MyPromise => p : () => MyPromise >p : Promise let o = { ->o : { m1(): Promise; m2(): Promise; m3(): Promise; } ->{ async m1() { }, async m2(): Promise { }, async m3(): MyPromise { }} : { m1(): Promise; m2(): Promise; m3(): Promise; } +>o : { m1(): Promise; m2(): Promise; m3(): MyPromise; } +>{ async m1() { }, async m2(): Promise { }, async m3(): MyPromise { }} : { m1(): Promise; m2(): Promise; m3(): MyPromise; } async m1() { }, >m1 : () => Promise @@ -76,7 +76,7 @@ let o = { >m2 : () => Promise async m3(): MyPromise { } ->m3 : () => Promise +>m3 : () => MyPromise }; @@ -90,7 +90,7 @@ class C { >m2 : () => Promise async m3(): MyPromise { } ->m3 : () => Promise +>m3 : () => MyPromise static async m4() { } >m4 : () => Promise @@ -99,7 +99,7 @@ class C { >m5 : () => Promise static async m6(): MyPromise { } ->m6 : () => Promise +>m6 : () => MyPromise } module M { diff --git a/tests/baselines/reference/asyncAwait_es5.types b/tests/baselines/reference/asyncAwait_es5.types index fb10a6dd043..be62067c301 100644 --- a/tests/baselines/reference/asyncAwait_es5.types +++ b/tests/baselines/reference/asyncAwait_es5.types @@ -1,6 +1,6 @@ === tests/cases/conformance/async/es5/asyncAwait_es5.ts === type MyPromise = Promise; ->MyPromise : Promise +>MyPromise : MyPromise declare var MyPromise: typeof Promise; >MyPromise : PromiseConstructor @@ -10,7 +10,7 @@ declare var p: Promise; >p : Promise declare var mp: MyPromise; ->mp : Promise +>mp : MyPromise async function f0() { } >f0 : () => Promise @@ -19,7 +19,7 @@ async function f1(): Promise { } >f1 : () => Promise async function f3(): MyPromise { } ->f3 : () => Promise +>f3 : () => MyPromise let f4 = async function() { } >f4 : () => Promise @@ -30,8 +30,8 @@ let f5 = async function(): Promise { } >async function(): Promise { } : () => Promise let f6 = async function(): MyPromise { } ->f6 : () => Promise ->async function(): MyPromise { } : () => Promise +>f6 : () => MyPromise +>async function(): MyPromise { } : () => MyPromise let f7 = async () => { }; >f7 : () => Promise @@ -42,8 +42,8 @@ let f8 = async (): Promise => { }; >async (): Promise => { } : () => Promise let f9 = async (): MyPromise => { }; ->f9 : () => Promise ->async (): MyPromise => { } : () => Promise +>f9 : () => MyPromise +>async (): MyPromise => { } : () => MyPromise let f10 = async () => p; >f10 : () => Promise @@ -53,21 +53,21 @@ let f10 = async () => p; let f11 = async () => mp; >f11 : () => Promise >async () => mp : () => Promise ->mp : Promise +>mp : MyPromise let f12 = async (): Promise => mp; >f12 : () => Promise >async (): Promise => mp : () => Promise ->mp : Promise +>mp : MyPromise let f13 = async (): MyPromise => p; ->f13 : () => Promise ->async (): MyPromise => p : () => Promise +>f13 : () => MyPromise +>async (): MyPromise => p : () => MyPromise >p : Promise let o = { ->o : { m1(): Promise; m2(): Promise; m3(): Promise; } ->{ async m1() { }, async m2(): Promise { }, async m3(): MyPromise { }} : { m1(): Promise; m2(): Promise; m3(): Promise; } +>o : { m1(): Promise; m2(): Promise; m3(): MyPromise; } +>{ async m1() { }, async m2(): Promise { }, async m3(): MyPromise { }} : { m1(): Promise; m2(): Promise; m3(): MyPromise; } async m1() { }, >m1 : () => Promise @@ -76,7 +76,7 @@ let o = { >m2 : () => Promise async m3(): MyPromise { } ->m3 : () => Promise +>m3 : () => MyPromise }; @@ -90,7 +90,7 @@ class C { >m2 : () => Promise async m3(): MyPromise { } ->m3 : () => Promise +>m3 : () => MyPromise static async m4() { } >m4 : () => Promise @@ -99,7 +99,7 @@ class C { >m5 : () => Promise static async m6(): MyPromise { } ->m6 : () => Promise +>m6 : () => MyPromise } module M { diff --git a/tests/baselines/reference/asyncAwait_es6.types b/tests/baselines/reference/asyncAwait_es6.types index cd9a05ee48e..3933b9ce7da 100644 --- a/tests/baselines/reference/asyncAwait_es6.types +++ b/tests/baselines/reference/asyncAwait_es6.types @@ -1,6 +1,6 @@ === tests/cases/conformance/async/es6/asyncAwait_es6.ts === type MyPromise = Promise; ->MyPromise : Promise +>MyPromise : MyPromise declare var MyPromise: typeof Promise; >MyPromise : PromiseConstructor @@ -10,7 +10,7 @@ declare var p: Promise; >p : Promise declare var mp: MyPromise; ->mp : Promise +>mp : MyPromise async function f0() { } >f0 : () => Promise @@ -19,7 +19,7 @@ async function f1(): Promise { } >f1 : () => Promise async function f3(): MyPromise { } ->f3 : () => Promise +>f3 : () => MyPromise let f4 = async function() { } >f4 : () => Promise @@ -30,8 +30,8 @@ let f5 = async function(): Promise { } >async function(): Promise { } : () => Promise let f6 = async function(): MyPromise { } ->f6 : () => Promise ->async function(): MyPromise { } : () => Promise +>f6 : () => MyPromise +>async function(): MyPromise { } : () => MyPromise let f7 = async () => { }; >f7 : () => Promise @@ -42,8 +42,8 @@ let f8 = async (): Promise => { }; >async (): Promise => { } : () => Promise let f9 = async (): MyPromise => { }; ->f9 : () => Promise ->async (): MyPromise => { } : () => Promise +>f9 : () => MyPromise +>async (): MyPromise => { } : () => MyPromise let f10 = async () => p; >f10 : () => Promise @@ -53,21 +53,21 @@ let f10 = async () => p; let f11 = async () => mp; >f11 : () => Promise >async () => mp : () => Promise ->mp : Promise +>mp : MyPromise let f12 = async (): Promise => mp; >f12 : () => Promise >async (): Promise => mp : () => Promise ->mp : Promise +>mp : MyPromise let f13 = async (): MyPromise => p; ->f13 : () => Promise ->async (): MyPromise => p : () => Promise +>f13 : () => MyPromise +>async (): MyPromise => p : () => MyPromise >p : Promise let o = { ->o : { m1(): Promise; m2(): Promise; m3(): Promise; } ->{ async m1() { }, async m2(): Promise { }, async m3(): MyPromise { }} : { m1(): Promise; m2(): Promise; m3(): Promise; } +>o : { m1(): Promise; m2(): Promise; m3(): MyPromise; } +>{ async m1() { }, async m2(): Promise { }, async m3(): MyPromise { }} : { m1(): Promise; m2(): Promise; m3(): MyPromise; } async m1() { }, >m1 : () => Promise @@ -76,7 +76,7 @@ let o = { >m2 : () => Promise async m3(): MyPromise { } ->m3 : () => Promise +>m3 : () => MyPromise }; @@ -90,7 +90,7 @@ class C { >m2 : () => Promise async m3(): MyPromise { } ->m3 : () => Promise +>m3 : () => MyPromise static async m4() { } >m4 : () => Promise @@ -99,7 +99,7 @@ class C { >m5 : () => Promise static async m6(): MyPromise { } ->m6 : () => Promise +>m6 : () => MyPromise } module M { diff --git a/tests/baselines/reference/complicatedIndexesOfIntersectionsAreInferencable.types b/tests/baselines/reference/complicatedIndexesOfIntersectionsAreInferencable.types index 64511cb9df2..55d6368e292 100644 --- a/tests/baselines/reference/complicatedIndexesOfIntersectionsAreInferencable.types +++ b/tests/baselines/reference/complicatedIndexesOfIntersectionsAreInferencable.types @@ -12,10 +12,10 @@ interface FormikConfig { } declare function Func( ->Func : (x: string extends "validate" | "initialValues" | keyof ExtraProps ? Readonly & ExtraProps> : Pick & ExtraProps>, "validate" | "initialValues" | Exclude> & Partial & ExtraProps>, "validateOnChange" | Extract>>) => void +>Func : (x: string extends keyof ExtraProps | "validate" | "initialValues" ? Readonly & ExtraProps> : Pick & ExtraProps>, Exclude | "validate" | "initialValues"> & Partial & ExtraProps>, "validateOnChange" | Extract>>) => void x: (string extends "validate" | "initialValues" | keyof ExtraProps ->x : string extends "validate" | "initialValues" | keyof ExtraProps ? Readonly & ExtraProps> : Pick & ExtraProps>, "validate" | "initialValues" | Exclude> & Partial & ExtraProps>, "validateOnChange" | Extract>> +>x : string extends keyof ExtraProps | "validate" | "initialValues" ? Readonly & ExtraProps> : Pick & ExtraProps>, Exclude | "validate" | "initialValues"> & Partial & ExtraProps>, "validateOnChange" | Extract>> ? Readonly & ExtraProps> : Pick & ExtraProps>, "validate" | "initialValues" | Exclude> @@ -24,7 +24,7 @@ declare function Func( Func({ >Func({ initialValues: { foo: "" }, validate: props => { props.foo; }}) : void ->Func : (x: string extends "validate" | "initialValues" | keyof ExtraProps ? Readonly & ExtraProps> : Pick & ExtraProps>, "validate" | "initialValues" | Exclude> & Partial & ExtraProps>, "validateOnChange" | Extract>>) => void +>Func : (x: string extends keyof ExtraProps | "validate" | "initialValues" ? Readonly & ExtraProps> : Pick & ExtraProps>, Exclude | "validate" | "initialValues"> & Partial & ExtraProps>, "validateOnChange" | Extract>>) => void >{ initialValues: { foo: "" }, validate: props => { props.foo; }} : { initialValues: { foo: string; }; validate: (props: { foo: string; }) => void; } initialValues: { diff --git a/tests/baselines/reference/constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.types b/tests/baselines/reference/constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.types index b3f5a0e9f91..1170aa71c48 100644 --- a/tests/baselines/reference/constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.types +++ b/tests/baselines/reference/constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.types @@ -6,7 +6,7 @@ interface Map { } export type ImmutableTypes = IImmutableMap; ->ImmutableTypes : IImmutableMap +>ImmutableTypes : ImmutableTypes export type ImmutableModel = { [K in keyof T]: T[K] extends ImmutableTypes ? T[K] : never }; >ImmutableModel : ImmutableModel @@ -19,7 +19,7 @@ export interface IImmutableMap> extends Map; ->ImmutableTypes2 : IImmutableMap2 +>ImmutableTypes2 : ImmutableTypes2 type isImmutableType = [T] extends [ImmutableTypes2] ? T : never; >isImmutableType : isImmutableType diff --git a/tests/baselines/reference/declarationsForIndirectTypeAliasReference.js b/tests/baselines/reference/declarationsForIndirectTypeAliasReference.js index 9e2f9ee4039..1563e2571cc 100644 --- a/tests/baselines/reference/declarationsForIndirectTypeAliasReference.js +++ b/tests/baselines/reference/declarationsForIndirectTypeAliasReference.js @@ -61,6 +61,6 @@ declare type StringHash = Hash; interface StringHash2 extends Hash { } //// [a.d.ts] -import { StringHash2 } from "./b"; +import { StringHash, StringHash2 } from "./b"; export { doSome }; -declare function doSome(arg1: string, arg2?: import("./b").Hash, arg3?: StringHash2): void; +declare function doSome(arg1: string, arg2?: StringHash, arg3?: StringHash2): void; diff --git a/tests/baselines/reference/declarationsForIndirectTypeAliasReference.types b/tests/baselines/reference/declarationsForIndirectTypeAliasReference.types index e527a8a3bfa..85ebfca651f 100644 --- a/tests/baselines/reference/declarationsForIndirectTypeAliasReference.types +++ b/tests/baselines/reference/declarationsForIndirectTypeAliasReference.types @@ -15,7 +15,7 @@ interface Hash { } type StringHash = Hash; ->StringHash : Hash +>StringHash : StringHash interface StringHash2 extends Hash {} === tests/cases/compiler/a.ts === @@ -25,11 +25,11 @@ import {StringHash, StringHash2} from "./b"; export { doSome ->doSome : (arg1: string, arg2?: import("tests/cases/compiler/b").Hash, arg3?: StringHash2) => void +>doSome : (arg1: string, arg2?: StringHash, arg3?: StringHash2) => void } const MAP: StringHash = { ->MAP : import("tests/cases/compiler/b").Hash +>MAP : StringHash >{ a: "a"} : { a: string; } a: "a" @@ -49,12 +49,12 @@ const MAP2: StringHash2 = { }; function doSome(arg1: string, ->doSome : (arg1: string, arg2?: import("tests/cases/compiler/b").Hash, arg3?: StringHash2) => void +>doSome : (arg1: string, arg2?: StringHash, arg3?: StringHash2) => void >arg1 : string arg2 = MAP, ->arg2 : import("tests/cases/compiler/b").Hash ->MAP : import("tests/cases/compiler/b").Hash +>arg2 : StringHash +>MAP : StringHash arg3 = MAP2) { >arg3 : StringHash2 diff --git a/tests/baselines/reference/destructuringParameterDeclaration3ES5.types b/tests/baselines/reference/destructuringParameterDeclaration3ES5.types index 96681054bd9..a18a2c4f0a9 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration3ES5.types +++ b/tests/baselines/reference/destructuringParameterDeclaration3ES5.types @@ -6,13 +6,13 @@ // ... Identifier TypeAnnotation(opt) type arrayString = Array ->arrayString : String[] +>arrayString : arrayString type someArray = Array | number[]; >someArray : someArray type stringOrNumArray = Array; ->stringOrNumArray : (String | Number)[] +>stringOrNumArray : stringOrNumArray function a1(...x: (number|string)[]) { } >a1 : (...x: (string | number)[]) => void @@ -27,12 +27,12 @@ function a3(...a: Array) { } >a : String[] function a4(...a: arrayString) { } ->a4 : (...a: String[]) => void ->a : String[] +>a4 : (...a: arrayString) => void +>a : arrayString function a5(...a: stringOrNumArray) { } ->a5 : (...a: (String | Number)[]) => void ->a : (String | Number)[] +>a5 : (...a: stringOrNumArray) => void +>a : stringOrNumArray function a9([a, b, [[c]]]) { } >a9 : ([a, b, [[c]]]: [any, any, [[any]]]) => void diff --git a/tests/baselines/reference/destructuringParameterDeclaration3ES5iterable.types b/tests/baselines/reference/destructuringParameterDeclaration3ES5iterable.types index 441a079e4ab..e41c2e5d75a 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration3ES5iterable.types +++ b/tests/baselines/reference/destructuringParameterDeclaration3ES5iterable.types @@ -6,13 +6,13 @@ // ... Identifier TypeAnnotation(opt) type arrayString = Array ->arrayString : String[] +>arrayString : arrayString type someArray = Array | number[]; >someArray : someArray type stringOrNumArray = Array; ->stringOrNumArray : (String | Number)[] +>stringOrNumArray : stringOrNumArray function a1(...x: (number|string)[]) { } >a1 : (...x: (string | number)[]) => void @@ -27,12 +27,12 @@ function a3(...a: Array) { } >a : String[] function a4(...a: arrayString) { } ->a4 : (...a: String[]) => void ->a : String[] +>a4 : (...a: arrayString) => void +>a : arrayString function a5(...a: stringOrNumArray) { } ->a5 : (...a: (String | Number)[]) => void ->a : (String | Number)[] +>a5 : (...a: stringOrNumArray) => void +>a : stringOrNumArray function a9([a, b, [[c]]]) { } >a9 : ([a, b, [[c]]]: [any, any, [[any]]]) => void diff --git a/tests/baselines/reference/destructuringParameterDeclaration3ES6.types b/tests/baselines/reference/destructuringParameterDeclaration3ES6.types index a7fcb861e4c..4adacfd11ff 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration3ES6.types +++ b/tests/baselines/reference/destructuringParameterDeclaration3ES6.types @@ -6,13 +6,13 @@ // ... Identifier TypeAnnotation(opt) type arrayString = Array ->arrayString : String[] +>arrayString : arrayString type someArray = Array | number[]; >someArray : someArray type stringOrNumArray = Array; ->stringOrNumArray : (String | Number)[] +>stringOrNumArray : stringOrNumArray function a1(...x: (number|string)[]) { } >a1 : (...x: (string | number)[]) => void @@ -27,12 +27,12 @@ function a3(...a: Array) { } >a : String[] function a4(...a: arrayString) { } ->a4 : (...a: String[]) => void ->a : String[] +>a4 : (...a: arrayString) => void +>a : arrayString function a5(...a: stringOrNumArray) { } ->a5 : (...a: (String | Number)[]) => void ->a : (String | Number)[] +>a5 : (...a: stringOrNumArray) => void +>a : stringOrNumArray function a9([a, b, [[c]]]) { } >a9 : ([a, b, [[c]]]: [any, any, [[any]]]) => void diff --git a/tests/baselines/reference/destructuringParameterDeclaration4.types b/tests/baselines/reference/destructuringParameterDeclaration4.types index 444a70ff196..2c3a7dc5f95 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration4.types +++ b/tests/baselines/reference/destructuringParameterDeclaration4.types @@ -6,13 +6,13 @@ // ... Identifier TypeAnnotation(opt) type arrayString = Array ->arrayString : String[] +>arrayString : arrayString type someArray = Array | number[]; >someArray : someArray type stringOrNumArray = Array; ->stringOrNumArray : (String | Number)[] +>stringOrNumArray : stringOrNumArray function a0(...x: [number, number, string]) { } // Error, rest parameter must be array type >a0 : (x_0: number, x_1: number, x_2: string) => void diff --git a/tests/baselines/reference/directDependenceBetweenTypeAliases.errors.txt b/tests/baselines/reference/directDependenceBetweenTypeAliases.errors.txt index 15e654df9a7..374cef0c1cb 100644 --- a/tests/baselines/reference/directDependenceBetweenTypeAliases.errors.txt +++ b/tests/baselines/reference/directDependenceBetweenTypeAliases.errors.txt @@ -2,17 +2,12 @@ tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts( tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(5,6): error TS2456: Type alias 'T0_1' circularly references itself. tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(6,6): error TS2456: Type alias 'T0_2' circularly references itself. tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(7,6): error TS2456: Type alias 'T0_3' circularly references itself. -tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(11,6): error TS2456: Type alias 'T1' circularly references itself. tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(14,6): error TS2456: Type alias 'T2' circularly references itself. tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(25,5): error TS2502: 'x' is referenced directly or indirectly in its own type annotation. tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(26,6): error TS2456: Type alias 'T5' circularly references itself. -tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(29,6): error TS2456: Type alias 'T6' circularly references itself. -tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(30,6): error TS2456: Type alias 'T7' circularly references itself. -tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(31,5): error TS2502: 'yy' is referenced directly or indirectly in its own type annotation. -tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(32,6): error TS2456: Type alias 'T8' circularly references itself. -==== tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts (12 errors) ==== +==== tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts (7 errors) ==== // It is an error for the type specified in a type alias to depend on that type alias // A type alias directly depends on the type it aliases. @@ -32,8 +27,6 @@ tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts( // A type reference directly depends on the referenced type and each of the type arguments, if any. interface I {} type T1 = I - ~~ -!!! error TS2456: Type alias 'T1' circularly references itself. // A union type directly depends on each of the constituent types. type T2 = T2 | string @@ -58,17 +51,9 @@ tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts( class C1 {} type T6 = T7 | number - ~~ -!!! error TS2456: Type alias 'T6' circularly references itself. type T7 = typeof yy - ~~ -!!! error TS2456: Type alias 'T7' circularly references itself. var yy: [string, T8[]]; - ~~ -!!! error TS2502: 'yy' is referenced directly or indirectly in its own type annotation. type T8 = C - ~~ -!!! error TS2456: Type alias 'T8' circularly references itself. // legal cases type T9 = () => T9 diff --git a/tests/baselines/reference/directDependenceBetweenTypeAliases.types b/tests/baselines/reference/directDependenceBetweenTypeAliases.types index 1ddbeb019cf..e1d6784b327 100644 --- a/tests/baselines/reference/directDependenceBetweenTypeAliases.types +++ b/tests/baselines/reference/directDependenceBetweenTypeAliases.types @@ -17,7 +17,7 @@ type T0_3 = T0_1 // A type reference directly depends on the referenced type and each of the type arguments, if any. interface I {} type T1 = I ->T1 : any +>T1 : T1 // A union type directly depends on each of the constituent types. type T2 = T2 | string @@ -50,17 +50,17 @@ class C1 {} >C1 : C1 type T6 = T7 | number ->T6 : any +>T6 : T6 type T7 = typeof yy ->T7 : any ->yy : any +>T7 : [string, T8[]] +>yy : [string, T8[]] var yy: [string, T8[]]; ->yy : any +>yy : [string, T8[]] type T8 = C ->T8 : any +>T8 : T8 // legal cases type T9 = () => T9 diff --git a/tests/baselines/reference/genericDefaultsErrors.types b/tests/baselines/reference/genericDefaultsErrors.types index 51b819f9d01..5eaf9af1cc1 100644 --- a/tests/baselines/reference/genericDefaultsErrors.types +++ b/tests/baselines/reference/genericDefaultsErrors.types @@ -70,10 +70,10 @@ type i09t01 = i09<1>; // error >i09t01 : any type i09t02 = i09<1, 2>; // ok ->i09t02 : i09<1, 2, number> +>i09t02 : i09t02 type i09t03 = i09<1, 2, 3>; // ok ->i09t03 : i09<1, 2, 3> +>i09t03 : i09t03 type i09t04 = i09<1, 2, 3, 4>; // error >i09t04 : any diff --git a/tests/baselines/reference/genericTypeAliases.types b/tests/baselines/reference/genericTypeAliases.types index 308c61da725..a092c7c8024 100644 --- a/tests/baselines/reference/genericTypeAliases.types +++ b/tests/baselines/reference/genericTypeAliases.types @@ -143,7 +143,7 @@ interface AB { } type Pair = AB; ->Pair : AB +>Pair : Pair interface TaggedPair extends Pair { tag: string; diff --git a/tests/baselines/reference/mappedTypesArraysTuples.types b/tests/baselines/reference/mappedTypesArraysTuples.types index 6b43cd510fb..2ec00ad565e 100644 --- a/tests/baselines/reference/mappedTypesArraysTuples.types +++ b/tests/baselines/reference/mappedTypesArraysTuples.types @@ -66,7 +66,7 @@ type B = { b: string }; >b : string type T40 = Boxified | [A, B] | string | string[]>; ->T40 : string | Box[] | Boxified | Box[] | readonly Box[] | [Box, Box] +>T40 : string | Box[] | Boxified | readonly Box[] | Box[] | [Box, Box] type ReadWrite = { -readonly [P in keyof T] : T[P] }; >ReadWrite : ReadWrite diff --git a/tests/baselines/reference/reactSFCAndFunctionResolvable.types b/tests/baselines/reference/reactSFCAndFunctionResolvable.types index d8061605b1f..d4949fe8850 100644 --- a/tests/baselines/reference/reactSFCAndFunctionResolvable.types +++ b/tests/baselines/reference/reactSFCAndFunctionResolvable.types @@ -14,7 +14,7 @@ declare const OtherRadio: () => React.ReactElement<{}>; >React : any declare const Checkbox: React.SFC; ->Checkbox : React.StatelessComponent<{}> +>Checkbox : React.SFC<{}> >React : any declare const condition1: boolean; @@ -27,43 +27,43 @@ declare const condition3: boolean; >condition3 : boolean const RandomComponent: React.SFC = () => { ->RandomComponent : React.StatelessComponent<{}> +>RandomComponent : React.SFC<{}> >React : any >() => { const Component = condition1 ? Radio : Checkbox; const OtherComponent = condition2 ? OtherRadio : Checkbox; return condition1 ? : ;} : () => JSX.Element const Component = ->Component : React.StatelessComponent<{}> | ((props: {}) => React.ReactElement<{}>) +>Component : ((props: {}) => React.ReactElement<{}>) | React.SFC<{}> condition1 ->condition1 ? Radio : Checkbox : React.StatelessComponent<{}> | ((props: {}) => React.ReactElement<{}>) +>condition1 ? Radio : Checkbox : ((props: {}) => React.ReactElement<{}>) | React.SFC<{}> >condition1 : boolean ? Radio >Radio : (props: {}) => React.ReactElement<{}> : Checkbox; ->Checkbox : React.StatelessComponent<{}> +>Checkbox : React.SFC<{}> const OtherComponent = ->OtherComponent : React.StatelessComponent<{}> | (() => React.ReactElement<{}>) +>OtherComponent : (() => React.ReactElement<{}>) | React.SFC<{}> condition2 ->condition2 ? OtherRadio : Checkbox : React.StatelessComponent<{}> | (() => React.ReactElement<{}>) +>condition2 ? OtherRadio : Checkbox : (() => React.ReactElement<{}>) | React.SFC<{}> >condition2 : boolean ? OtherRadio >OtherRadio : () => React.ReactElement<{}> : Checkbox; ->Checkbox : React.StatelessComponent<{}> +>Checkbox : React.SFC<{}> return condition1 ? : ; >condition1 ? : : JSX.Element >condition1 : boolean > : JSX.Element ->Component : React.StatelessComponent<{}> | ((props: {}) => React.ReactElement<{}>) +>Component : ((props: {}) => React.ReactElement<{}>) | React.SFC<{}> > : JSX.Element ->OtherComponent : React.StatelessComponent<{}> | (() => React.ReactElement<{}>) +>OtherComponent : (() => React.ReactElement<{}>) | React.SFC<{}> }; diff --git a/tests/baselines/reference/readonlyArraysAndTuples.types b/tests/baselines/reference/readonlyArraysAndTuples.types index 2d4086a0193..a0db326f35e 100644 --- a/tests/baselines/reference/readonlyArraysAndTuples.types +++ b/tests/baselines/reference/readonlyArraysAndTuples.types @@ -3,13 +3,13 @@ type T10 = string[]; >T10 : T10 type T11 = Array; ->T11 : string[] +>T11 : T11 type T12 = readonly string[]; >T12 : readonly string[] type T13 = ReadonlyArray; ->T13 : readonly string[] +>T13 : T13 type T20 = [number, number]; >T20 : T20 diff --git a/tests/baselines/reference/readonlyArraysAndTuples2.types b/tests/baselines/reference/readonlyArraysAndTuples2.types index 7b8c7124806..be75e046528 100644 --- a/tests/baselines/reference/readonlyArraysAndTuples2.types +++ b/tests/baselines/reference/readonlyArraysAndTuples2.types @@ -3,13 +3,13 @@ type T10 = string[]; >T10 : T10 type T11 = Array; ->T11 : string[] +>T11 : T11 type T12 = readonly string[]; >T12 : readonly string[] type T13 = ReadonlyArray; ->T13 : readonly string[] +>T13 : T13 type T20 = [number, number]; >T20 : T20 diff --git a/tests/baselines/reference/specedNoStackBlown.types b/tests/baselines/reference/specedNoStackBlown.types index f2ef490fa80..884c24151a0 100644 --- a/tests/baselines/reference/specedNoStackBlown.types +++ b/tests/baselines/reference/specedNoStackBlown.types @@ -29,7 +29,7 @@ export type Spec = [Predicate, ErrorMs >Spec : Spec export type SpecArray = Array>; ->SpecArray : Spec[] +>SpecArray : SpecArray export type SpecFunction = [INPUT] extends [ReadonlyArray] >SpecFunction : SpecFunction diff --git a/tests/baselines/reference/thisIndexOnExistingReadonlyFieldIsNotNever.types b/tests/baselines/reference/thisIndexOnExistingReadonlyFieldIsNotNever.types index 30dfd635724..8f1eff831e3 100644 --- a/tests/baselines/reference/thisIndexOnExistingReadonlyFieldIsNotNever.types +++ b/tests/baselines/reference/thisIndexOnExistingReadonlyFieldIsNotNever.types @@ -15,7 +15,7 @@ interface CoachMarkAnchorProps { >anchor : C } type AnchorType

= Component

; ->AnchorType : Component +>AnchorType : AnchorType

class CoachMarkAnchorDecorator { >CoachMarkAnchorDecorator : CoachMarkAnchorDecorator @@ -27,28 +27,28 @@ class CoachMarkAnchorDecorator { return class CoachMarkAnchor extends Component> & P, {}> { >class CoachMarkAnchor extends Component> & P, {}> { private _onAnchorRef = (anchor: AnchorType

) => { const anchorRef = this.props.anchorRef; if (anchorRef) { anchorRef(anchor); } } } : typeof CoachMarkAnchor >CoachMarkAnchor : typeof CoachMarkAnchor ->Component : Component> & P, {}> +>Component : Component> & P, {}> private _onAnchorRef = (anchor: AnchorType

) => { ->_onAnchorRef : (anchor: Component) => void ->(anchor: AnchorType

) => { const anchorRef = this.props.anchorRef; if (anchorRef) { anchorRef(anchor); } } : (anchor: Component) => void ->anchor : Component +>_onAnchorRef : (anchor: AnchorType

) => void +>(anchor: AnchorType

) => { const anchorRef = this.props.anchorRef; if (anchorRef) { anchorRef(anchor); } } : (anchor: AnchorType

) => void +>anchor : AnchorType

const anchorRef = this.props.anchorRef; ->anchorRef : (CoachMarkAnchorProps> & P)["anchorRef"] | undefined ->this.props.anchorRef : (CoachMarkAnchorProps> & P)["anchorRef"] | undefined ->this.props : Readonly<{ children?: unknown; }> & Readonly> & P> +>anchorRef : (CoachMarkAnchorProps> & P)["anchorRef"] | undefined +>this.props.anchorRef : (CoachMarkAnchorProps> & P)["anchorRef"] | undefined +>this.props : Readonly<{ children?: unknown; }> & Readonly> & P> >this : this ->props : Readonly<{ children?: unknown; }> & Readonly> & P> ->anchorRef : (CoachMarkAnchorProps> & P)["anchorRef"] | undefined +>props : Readonly<{ children?: unknown; }> & Readonly> & P> +>anchorRef : (CoachMarkAnchorProps> & P)["anchorRef"] | undefined if (anchorRef) { ->anchorRef : (CoachMarkAnchorProps> & P)["anchorRef"] | undefined +>anchorRef : (CoachMarkAnchorProps> & P)["anchorRef"] | undefined anchorRef(anchor); >anchorRef(anchor) : void ->anchorRef : (anchor: Component) => void ->anchor : Component +>anchorRef : (anchor: AnchorType

) => void +>anchor : AnchorType

} } }; diff --git a/tests/baselines/reference/transformNestedGeneratorsWithTry.types b/tests/baselines/reference/transformNestedGeneratorsWithTry.types index 0ea963bbe4a..061342eaf44 100644 --- a/tests/baselines/reference/transformNestedGeneratorsWithTry.types +++ b/tests/baselines/reference/transformNestedGeneratorsWithTry.types @@ -4,13 +4,13 @@ import * as Bluebird from 'bluebird'; >Bluebird : PromiseConstructor async function a(): Bluebird { ->a : () => Promise +>a : () => Bluebird try { const b = async function b(): Bluebird { ->b : () => Promise ->async function b(): Bluebird { try { await Bluebird.resolve(); // -- remove this and it compiles } catch (error) { } } : () => Promise ->b : () => Promise +>b : () => Bluebird +>async function b(): Bluebird { try { await Bluebird.resolve(); // -- remove this and it compiles } catch (error) { } } : () => Bluebird +>b : () => Bluebird try { await Bluebird.resolve(); // -- remove this and it compiles @@ -27,8 +27,8 @@ async function a(): Bluebird { await b(); // -- or remove this and it compiles >await b() : void ->b() : Promise ->b : () => Promise +>b() : Bluebird +>b : () => Bluebird } catch (error) { } >error : any @@ -39,12 +39,12 @@ declare module "bluebird" { >"bluebird" : typeof import("bluebird") type Bluebird = Promise; ->Bluebird : Promise +>Bluebird : Bluebird const Bluebird: typeof Promise; >Bluebird : PromiseConstructor >Promise : PromiseConstructor export = Bluebird; ->Bluebird : Promise +>Bluebird : Bluebird } diff --git a/tests/baselines/reference/tsxReactPropsInferenceSucceedsOnIntersections.types b/tests/baselines/reference/tsxReactPropsInferenceSucceedsOnIntersections.types index 16b5cd13636..3fa0b722aa4 100644 --- a/tests/baselines/reference/tsxReactPropsInferenceSucceedsOnIntersections.types +++ b/tests/baselines/reference/tsxReactPropsInferenceSucceedsOnIntersections.types @@ -25,7 +25,7 @@ interface CustomButtonProps extends ButtonProps { } const CustomButton: React.SFC = props =>