Accept new baselines

This commit is contained in:
Anders Hejlsberg
2019-08-30 07:58:04 -07:00
parent 2f0ac25a00
commit 81bfa6f2e0
30 changed files with 139 additions and 154 deletions
+1 -1
View File
@@ -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 {
}
+1 -1
View File
@@ -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 {
}
@@ -1,7 +1,7 @@
=== tests/cases/conformance/async/es5/asyncAliasReturnType_es5.ts ===
type PromiseAlias<T> = Promise<T>;
>PromiseAlias : Promise<T>
>PromiseAlias : PromiseAlias<T>
async function f(): PromiseAlias<void> {
>f : () => Promise<void>
>f : () => PromiseAlias<void>
}
@@ -1,7 +1,7 @@
=== tests/cases/conformance/async/es6/asyncAliasReturnType_es6.ts ===
type PromiseAlias<T> = Promise<T>;
>PromiseAlias : Promise<T>
>PromiseAlias : PromiseAlias<T>
async function f(): PromiseAlias<void> {
>f : () => Promise<void>
>f : () => PromiseAlias<void>
}
@@ -1,6 +1,6 @@
=== tests/cases/conformance/async/es2017/asyncAwait_es2017.ts ===
type MyPromise<T> = Promise<T>;
>MyPromise : Promise<T>
>MyPromise : MyPromise<T>
declare var MyPromise: typeof Promise;
>MyPromise : PromiseConstructor
@@ -10,7 +10,7 @@ declare var p: Promise<number>;
>p : Promise<number>
declare var mp: MyPromise<number>;
>mp : Promise<number>
>mp : MyPromise<number>
async function f0() { }
>f0 : () => Promise<void>
@@ -19,7 +19,7 @@ async function f1(): Promise<void> { }
>f1 : () => Promise<void>
async function f3(): MyPromise<void> { }
>f3 : () => Promise<void>
>f3 : () => MyPromise<void>
let f4 = async function() { }
>f4 : () => Promise<void>
@@ -30,8 +30,8 @@ let f5 = async function(): Promise<void> { }
>async function(): Promise<void> { } : () => Promise<void>
let f6 = async function(): MyPromise<void> { }
>f6 : () => Promise<void>
>async function(): MyPromise<void> { } : () => Promise<void>
>f6 : () => MyPromise<void>
>async function(): MyPromise<void> { } : () => MyPromise<void>
let f7 = async () => { };
>f7 : () => Promise<void>
@@ -42,8 +42,8 @@ let f8 = async (): Promise<void> => { };
>async (): Promise<void> => { } : () => Promise<void>
let f9 = async (): MyPromise<void> => { };
>f9 : () => Promise<void>
>async (): MyPromise<void> => { } : () => Promise<void>
>f9 : () => MyPromise<void>
>async (): MyPromise<void> => { } : () => MyPromise<void>
let f10 = async () => p;
>f10 : () => Promise<number>
@@ -53,21 +53,21 @@ let f10 = async () => p;
let f11 = async () => mp;
>f11 : () => Promise<number>
>async () => mp : () => Promise<number>
>mp : Promise<number>
>mp : MyPromise<number>
let f12 = async (): Promise<number> => mp;
>f12 : () => Promise<number>
>async (): Promise<number> => mp : () => Promise<number>
>mp : Promise<number>
>mp : MyPromise<number>
let f13 = async (): MyPromise<number> => p;
>f13 : () => Promise<number>
>async (): MyPromise<number> => p : () => Promise<number>
>f13 : () => MyPromise<number>
>async (): MyPromise<number> => p : () => MyPromise<number>
>p : Promise<number>
let o = {
>o : { m1(): Promise<void>; m2(): Promise<void>; m3(): Promise<void>; }
>{ async m1() { }, async m2(): Promise<void> { }, async m3(): MyPromise<void> { }} : { m1(): Promise<void>; m2(): Promise<void>; m3(): Promise<void>; }
>o : { m1(): Promise<void>; m2(): Promise<void>; m3(): MyPromise<void>; }
>{ async m1() { }, async m2(): Promise<void> { }, async m3(): MyPromise<void> { }} : { m1(): Promise<void>; m2(): Promise<void>; m3(): MyPromise<void>; }
async m1() { },
>m1 : () => Promise<void>
@@ -76,7 +76,7 @@ let o = {
>m2 : () => Promise<void>
async m3(): MyPromise<void> { }
>m3 : () => Promise<void>
>m3 : () => MyPromise<void>
};
@@ -90,7 +90,7 @@ class C {
>m2 : () => Promise<void>
async m3(): MyPromise<void> { }
>m3 : () => Promise<void>
>m3 : () => MyPromise<void>
static async m4() { }
>m4 : () => Promise<void>
@@ -99,7 +99,7 @@ class C {
>m5 : () => Promise<void>
static async m6(): MyPromise<void> { }
>m6 : () => Promise<void>
>m6 : () => MyPromise<void>
}
module M {
+16 -16
View File
@@ -1,6 +1,6 @@
=== tests/cases/conformance/async/es5/asyncAwait_es5.ts ===
type MyPromise<T> = Promise<T>;
>MyPromise : Promise<T>
>MyPromise : MyPromise<T>
declare var MyPromise: typeof Promise;
>MyPromise : PromiseConstructor
@@ -10,7 +10,7 @@ declare var p: Promise<number>;
>p : Promise<number>
declare var mp: MyPromise<number>;
>mp : Promise<number>
>mp : MyPromise<number>
async function f0() { }
>f0 : () => Promise<void>
@@ -19,7 +19,7 @@ async function f1(): Promise<void> { }
>f1 : () => Promise<void>
async function f3(): MyPromise<void> { }
>f3 : () => Promise<void>
>f3 : () => MyPromise<void>
let f4 = async function() { }
>f4 : () => Promise<void>
@@ -30,8 +30,8 @@ let f5 = async function(): Promise<void> { }
>async function(): Promise<void> { } : () => Promise<void>
let f6 = async function(): MyPromise<void> { }
>f6 : () => Promise<void>
>async function(): MyPromise<void> { } : () => Promise<void>
>f6 : () => MyPromise<void>
>async function(): MyPromise<void> { } : () => MyPromise<void>
let f7 = async () => { };
>f7 : () => Promise<void>
@@ -42,8 +42,8 @@ let f8 = async (): Promise<void> => { };
>async (): Promise<void> => { } : () => Promise<void>
let f9 = async (): MyPromise<void> => { };
>f9 : () => Promise<void>
>async (): MyPromise<void> => { } : () => Promise<void>
>f9 : () => MyPromise<void>
>async (): MyPromise<void> => { } : () => MyPromise<void>
let f10 = async () => p;
>f10 : () => Promise<number>
@@ -53,21 +53,21 @@ let f10 = async () => p;
let f11 = async () => mp;
>f11 : () => Promise<number>
>async () => mp : () => Promise<number>
>mp : Promise<number>
>mp : MyPromise<number>
let f12 = async (): Promise<number> => mp;
>f12 : () => Promise<number>
>async (): Promise<number> => mp : () => Promise<number>
>mp : Promise<number>
>mp : MyPromise<number>
let f13 = async (): MyPromise<number> => p;
>f13 : () => Promise<number>
>async (): MyPromise<number> => p : () => Promise<number>
>f13 : () => MyPromise<number>
>async (): MyPromise<number> => p : () => MyPromise<number>
>p : Promise<number>
let o = {
>o : { m1(): Promise<void>; m2(): Promise<void>; m3(): Promise<void>; }
>{ async m1() { }, async m2(): Promise<void> { }, async m3(): MyPromise<void> { }} : { m1(): Promise<void>; m2(): Promise<void>; m3(): Promise<void>; }
>o : { m1(): Promise<void>; m2(): Promise<void>; m3(): MyPromise<void>; }
>{ async m1() { }, async m2(): Promise<void> { }, async m3(): MyPromise<void> { }} : { m1(): Promise<void>; m2(): Promise<void>; m3(): MyPromise<void>; }
async m1() { },
>m1 : () => Promise<void>
@@ -76,7 +76,7 @@ let o = {
>m2 : () => Promise<void>
async m3(): MyPromise<void> { }
>m3 : () => Promise<void>
>m3 : () => MyPromise<void>
};
@@ -90,7 +90,7 @@ class C {
>m2 : () => Promise<void>
async m3(): MyPromise<void> { }
>m3 : () => Promise<void>
>m3 : () => MyPromise<void>
static async m4() { }
>m4 : () => Promise<void>
@@ -99,7 +99,7 @@ class C {
>m5 : () => Promise<void>
static async m6(): MyPromise<void> { }
>m6 : () => Promise<void>
>m6 : () => MyPromise<void>
}
module M {
+16 -16
View File
@@ -1,6 +1,6 @@
=== tests/cases/conformance/async/es6/asyncAwait_es6.ts ===
type MyPromise<T> = Promise<T>;
>MyPromise : Promise<T>
>MyPromise : MyPromise<T>
declare var MyPromise: typeof Promise;
>MyPromise : PromiseConstructor
@@ -10,7 +10,7 @@ declare var p: Promise<number>;
>p : Promise<number>
declare var mp: MyPromise<number>;
>mp : Promise<number>
>mp : MyPromise<number>
async function f0() { }
>f0 : () => Promise<void>
@@ -19,7 +19,7 @@ async function f1(): Promise<void> { }
>f1 : () => Promise<void>
async function f3(): MyPromise<void> { }
>f3 : () => Promise<void>
>f3 : () => MyPromise<void>
let f4 = async function() { }
>f4 : () => Promise<void>
@@ -30,8 +30,8 @@ let f5 = async function(): Promise<void> { }
>async function(): Promise<void> { } : () => Promise<void>
let f6 = async function(): MyPromise<void> { }
>f6 : () => Promise<void>
>async function(): MyPromise<void> { } : () => Promise<void>
>f6 : () => MyPromise<void>
>async function(): MyPromise<void> { } : () => MyPromise<void>
let f7 = async () => { };
>f7 : () => Promise<void>
@@ -42,8 +42,8 @@ let f8 = async (): Promise<void> => { };
>async (): Promise<void> => { } : () => Promise<void>
let f9 = async (): MyPromise<void> => { };
>f9 : () => Promise<void>
>async (): MyPromise<void> => { } : () => Promise<void>
>f9 : () => MyPromise<void>
>async (): MyPromise<void> => { } : () => MyPromise<void>
let f10 = async () => p;
>f10 : () => Promise<number>
@@ -53,21 +53,21 @@ let f10 = async () => p;
let f11 = async () => mp;
>f11 : () => Promise<number>
>async () => mp : () => Promise<number>
>mp : Promise<number>
>mp : MyPromise<number>
let f12 = async (): Promise<number> => mp;
>f12 : () => Promise<number>
>async (): Promise<number> => mp : () => Promise<number>
>mp : Promise<number>
>mp : MyPromise<number>
let f13 = async (): MyPromise<number> => p;
>f13 : () => Promise<number>
>async (): MyPromise<number> => p : () => Promise<number>
>f13 : () => MyPromise<number>
>async (): MyPromise<number> => p : () => MyPromise<number>
>p : Promise<number>
let o = {
>o : { m1(): Promise<void>; m2(): Promise<void>; m3(): Promise<void>; }
>{ async m1() { }, async m2(): Promise<void> { }, async m3(): MyPromise<void> { }} : { m1(): Promise<void>; m2(): Promise<void>; m3(): Promise<void>; }
>o : { m1(): Promise<void>; m2(): Promise<void>; m3(): MyPromise<void>; }
>{ async m1() { }, async m2(): Promise<void> { }, async m3(): MyPromise<void> { }} : { m1(): Promise<void>; m2(): Promise<void>; m3(): MyPromise<void>; }
async m1() { },
>m1 : () => Promise<void>
@@ -76,7 +76,7 @@ let o = {
>m2 : () => Promise<void>
async m3(): MyPromise<void> { }
>m3 : () => Promise<void>
>m3 : () => MyPromise<void>
};
@@ -90,7 +90,7 @@ class C {
>m2 : () => Promise<void>
async m3(): MyPromise<void> { }
>m3 : () => Promise<void>
>m3 : () => MyPromise<void>
static async m4() { }
>m4 : () => Promise<void>
@@ -99,7 +99,7 @@ class C {
>m5 : () => Promise<void>
static async m6(): MyPromise<void> { }
>m6 : () => Promise<void>
>m6 : () => MyPromise<void>
}
module M {
@@ -12,10 +12,10 @@ interface FormikConfig<Values> {
}
declare function Func<Values = object, ExtraProps = {}>(
>Func : <Values = object, ExtraProps = {}>(x: string extends "validate" | "initialValues" | keyof ExtraProps ? Readonly<FormikConfig<Values> & ExtraProps> : Pick<Readonly<FormikConfig<Values> & ExtraProps>, "validate" | "initialValues" | Exclude<keyof ExtraProps, "validateOnChange">> & Partial<Pick<Readonly<FormikConfig<Values> & ExtraProps>, "validateOnChange" | Extract<keyof ExtraProps, "validateOnChange">>>) => void
>Func : <Values = object, ExtraProps = {}>(x: string extends keyof ExtraProps | "validate" | "initialValues" ? Readonly<FormikConfig<Values> & ExtraProps> : Pick<Readonly<FormikConfig<Values> & ExtraProps>, Exclude<keyof ExtraProps, "validateOnChange"> | "validate" | "initialValues"> & Partial<Pick<Readonly<FormikConfig<Values> & ExtraProps>, "validateOnChange" | Extract<keyof ExtraProps, "validateOnChange">>>) => void
x: (string extends "validate" | "initialValues" | keyof ExtraProps
>x : string extends "validate" | "initialValues" | keyof ExtraProps ? Readonly<FormikConfig<Values> & ExtraProps> : Pick<Readonly<FormikConfig<Values> & ExtraProps>, "validate" | "initialValues" | Exclude<keyof ExtraProps, "validateOnChange">> & Partial<Pick<Readonly<FormikConfig<Values> & ExtraProps>, "validateOnChange" | Extract<keyof ExtraProps, "validateOnChange">>>
>x : string extends keyof ExtraProps | "validate" | "initialValues" ? Readonly<FormikConfig<Values> & ExtraProps> : Pick<Readonly<FormikConfig<Values> & ExtraProps>, Exclude<keyof ExtraProps, "validateOnChange"> | "validate" | "initialValues"> & Partial<Pick<Readonly<FormikConfig<Values> & ExtraProps>, "validateOnChange" | Extract<keyof ExtraProps, "validateOnChange">>>
? Readonly<FormikConfig<Values> & ExtraProps>
: Pick<Readonly<FormikConfig<Values> & ExtraProps>, "validate" | "initialValues" | Exclude<keyof ExtraProps, "validateOnChange">>
@@ -24,7 +24,7 @@ declare function Func<Values = object, ExtraProps = {}>(
Func({
>Func({ initialValues: { foo: "" }, validate: props => { props.foo; }}) : void
>Func : <Values = object, ExtraProps = {}>(x: string extends "validate" | "initialValues" | keyof ExtraProps ? Readonly<FormikConfig<Values> & ExtraProps> : Pick<Readonly<FormikConfig<Values> & ExtraProps>, "validate" | "initialValues" | Exclude<keyof ExtraProps, "validateOnChange">> & Partial<Pick<Readonly<FormikConfig<Values> & ExtraProps>, "validateOnChange" | Extract<keyof ExtraProps, "validateOnChange">>>) => void
>Func : <Values = object, ExtraProps = {}>(x: string extends keyof ExtraProps | "validate" | "initialValues" ? Readonly<FormikConfig<Values> & ExtraProps> : Pick<Readonly<FormikConfig<Values> & ExtraProps>, Exclude<keyof ExtraProps, "validateOnChange"> | "validate" | "initialValues"> & Partial<Pick<Readonly<FormikConfig<Values> & ExtraProps>, "validateOnChange" | Extract<keyof ExtraProps, "validateOnChange">>>) => void
>{ initialValues: { foo: "" }, validate: props => { props.foo; }} : { initialValues: { foo: string; }; validate: (props: { foo: string; }) => void; }
initialValues: {
@@ -6,7 +6,7 @@ interface Map<K, V> {
}
export type ImmutableTypes = IImmutableMap<any>;
>ImmutableTypes : IImmutableMap<any>
>ImmutableTypes : ImmutableTypes
export type ImmutableModel<T> = { [K in keyof T]: T[K] extends ImmutableTypes ? T[K] : never };
>ImmutableModel : ImmutableModel<T>
@@ -19,7 +19,7 @@ export interface IImmutableMap<T extends ImmutableModel<T>> extends Map<string,
}
export type ImmutableTypes2 = IImmutableMap2<any>;
>ImmutableTypes2 : IImmutableMap2<any>
>ImmutableTypes2 : ImmutableTypes2
type isImmutableType<T> = [T] extends [ImmutableTypes2] ? T : never;
>isImmutableType : isImmutableType<T>
@@ -61,6 +61,6 @@ declare type StringHash = Hash<string>;
interface StringHash2 extends Hash<string> {
}
//// [a.d.ts]
import { StringHash2 } from "./b";
import { StringHash, StringHash2 } from "./b";
export { doSome };
declare function doSome(arg1: string, arg2?: import("./b").Hash<string>, arg3?: StringHash2): void;
declare function doSome(arg1: string, arg2?: StringHash, arg3?: StringHash2): void;
@@ -15,7 +15,7 @@ interface Hash<T> {
}
type StringHash = Hash<string>;
>StringHash : Hash<string>
>StringHash : StringHash
interface StringHash2 extends Hash<string> {}
=== 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<string>, arg3?: StringHash2) => void
>doSome : (arg1: string, arg2?: StringHash, arg3?: StringHash2) => void
}
const MAP: StringHash = {
>MAP : import("tests/cases/compiler/b").Hash<string>
>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<string>, arg3?: StringHash2) => void
>doSome : (arg1: string, arg2?: StringHash, arg3?: StringHash2) => void
>arg1 : string
arg2 = MAP,
>arg2 : import("tests/cases/compiler/b").Hash<string>
>MAP : import("tests/cases/compiler/b").Hash<string>
>arg2 : StringHash
>MAP : StringHash
arg3 = MAP2) {
>arg3 : StringHash2
@@ -6,13 +6,13 @@
// ... Identifier TypeAnnotation(opt)
type arrayString = Array<String>
>arrayString : String[]
>arrayString : arrayString
type someArray = Array<String> | number[];
>someArray : someArray
type stringOrNumArray = Array<String|Number>;
>stringOrNumArray : (String | Number)[]
>stringOrNumArray : stringOrNumArray
function a1(...x: (number|string)[]) { }
>a1 : (...x: (string | number)[]) => void
@@ -27,12 +27,12 @@ function a3(...a: Array<String>) { }
>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
@@ -6,13 +6,13 @@
// ... Identifier TypeAnnotation(opt)
type arrayString = Array<String>
>arrayString : String[]
>arrayString : arrayString
type someArray = Array<String> | number[];
>someArray : someArray
type stringOrNumArray = Array<String|Number>;
>stringOrNumArray : (String | Number)[]
>stringOrNumArray : stringOrNumArray
function a1(...x: (number|string)[]) { }
>a1 : (...x: (string | number)[]) => void
@@ -27,12 +27,12 @@ function a3(...a: Array<String>) { }
>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
@@ -6,13 +6,13 @@
// ... Identifier TypeAnnotation(opt)
type arrayString = Array<String>
>arrayString : String[]
>arrayString : arrayString
type someArray = Array<String> | number[];
>someArray : someArray
type stringOrNumArray = Array<String|Number>;
>stringOrNumArray : (String | Number)[]
>stringOrNumArray : stringOrNumArray
function a1(...x: (number|string)[]) { }
>a1 : (...x: (string | number)[]) => void
@@ -27,12 +27,12 @@ function a3(...a: Array<String>) { }
>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
@@ -6,13 +6,13 @@
// ... Identifier TypeAnnotation(opt)
type arrayString = Array<String>
>arrayString : String[]
>arrayString : arrayString
type someArray = Array<String> | number[];
>someArray : someArray
type stringOrNumArray = Array<String|Number>;
>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
@@ -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<T> {}
type T1 = I<T1>
~~
!!! 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<T> {}
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<T6>
~~
!!! error TS2456: Type alias 'T8' circularly references itself.
// legal cases
type T9 = () => T9
@@ -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<T> {}
type T1 = I<T1>
>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<T> {}
>C1 : C1<T>
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<T6>
>T8 : any
>T8 : T8
// legal cases
type T9 = () => T9
@@ -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
@@ -143,7 +143,7 @@ interface AB<A, B> {
}
type Pair<T> = AB<T, T>;
>Pair : AB<T, T>
>Pair : Pair<T>
interface TaggedPair<T> extends Pair<T> {
tag: string;
@@ -66,7 +66,7 @@ type B = { b: string };
>b : string
type T40 = Boxified<A | A[] | ReadonlyArray<A> | [A, B] | string | string[]>;
>T40 : string | Box<string>[] | Boxified<A> | Box<A>[] | readonly Box<A>[] | [Box<A>, Box<B>]
>T40 : string | Box<string>[] | Boxified<A> | readonly Box<A>[] | Box<A>[] | [Box<A>, Box<B>]
type ReadWrite<T> = { -readonly [P in keyof T] : T[P] };
>ReadWrite : ReadWrite<T>
@@ -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 ? <Component /> : <OtherComponent />;} : () => 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 ? <Component /> : <OtherComponent />;
>condition1 ? <Component /> : <OtherComponent /> : JSX.Element
>condition1 : boolean
><Component /> : JSX.Element
>Component : React.StatelessComponent<{}> | ((props: {}) => React.ReactElement<{}>)
>Component : ((props: {}) => React.ReactElement<{}>) | React.SFC<{}>
><OtherComponent /> : JSX.Element
>OtherComponent : React.StatelessComponent<{}> | (() => React.ReactElement<{}>)
>OtherComponent : (() => React.ReactElement<{}>) | React.SFC<{}>
};
@@ -3,13 +3,13 @@ type T10 = string[];
>T10 : T10
type T11 = Array<string>;
>T11 : string[]
>T11 : T11
type T12 = readonly string[];
>T12 : readonly string[]
type T13 = ReadonlyArray<string>;
>T13 : readonly string[]
>T13 : T13
type T20 = [number, number];
>T20 : T20
@@ -3,13 +3,13 @@ type T10 = string[];
>T10 : T10
type T11 = Array<string>;
>T11 : string[]
>T11 : T11
type T12 = readonly string[];
>T12 : readonly string[]
type T13 = ReadonlyArray<string>;
>T13 : readonly string[]
>T13 : T13
type T20 = [number, number];
>T20 : T20
@@ -29,7 +29,7 @@ export type Spec<INPUT, ROOTINPUT = any> = [Predicate<INPUT, ROOTINPUT>, ErrorMs
>Spec : Spec<INPUT, ROOTINPUT>
export type SpecArray<INPUT, ROOTINPUT = any> = Array<Spec<INPUT, ROOTINPUT>>;
>SpecArray : Spec<INPUT, ROOTINPUT>[]
>SpecArray : SpecArray<INPUT, ROOTINPUT>
export type SpecFunction<INPUT, ROOTINPUT = any> = [INPUT] extends [ReadonlyArray<infer U>]
>SpecFunction : SpecFunction<INPUT, ROOTINPUT>
@@ -15,7 +15,7 @@ interface CoachMarkAnchorProps<C> {
>anchor : C
}
type AnchorType<P> = Component<P>;
>AnchorType : Component<P, {}>
>AnchorType : AnchorType<P>
class CoachMarkAnchorDecorator {
>CoachMarkAnchorDecorator : CoachMarkAnchorDecorator
@@ -27,28 +27,28 @@ class CoachMarkAnchorDecorator {
return class CoachMarkAnchor extends Component<CoachMarkAnchorProps<AnchorType<P>> & P, {}> {
>class CoachMarkAnchor extends Component<CoachMarkAnchorProps<AnchorType<P>> & P, {}> { private _onAnchorRef = (anchor: AnchorType<P>) => { const anchorRef = this.props.anchorRef; if (anchorRef) { anchorRef(anchor); } } } : typeof CoachMarkAnchor
>CoachMarkAnchor : typeof CoachMarkAnchor
>Component : Component<CoachMarkAnchorProps<Component<P, {}>> & P, {}>
>Component : Component<CoachMarkAnchorProps<AnchorType<P>> & P, {}>
private _onAnchorRef = (anchor: AnchorType<P>) => {
>_onAnchorRef : (anchor: Component<P, {}>) => void
>(anchor: AnchorType<P>) => { const anchorRef = this.props.anchorRef; if (anchorRef) { anchorRef(anchor); } } : (anchor: Component<P, {}>) => void
>anchor : Component<P, {}>
>_onAnchorRef : (anchor: AnchorType<P>) => void
>(anchor: AnchorType<P>) => { const anchorRef = this.props.anchorRef; if (anchorRef) { anchorRef(anchor); } } : (anchor: AnchorType<P>) => void
>anchor : AnchorType<P>
const anchorRef = this.props.anchorRef;
>anchorRef : (CoachMarkAnchorProps<Component<P, {}>> & P)["anchorRef"] | undefined
>this.props.anchorRef : (CoachMarkAnchorProps<Component<P, {}>> & P)["anchorRef"] | undefined
>this.props : Readonly<{ children?: unknown; }> & Readonly<CoachMarkAnchorProps<Component<P, {}>> & P>
>anchorRef : (CoachMarkAnchorProps<AnchorType<P>> & P)["anchorRef"] | undefined
>this.props.anchorRef : (CoachMarkAnchorProps<AnchorType<P>> & P)["anchorRef"] | undefined
>this.props : Readonly<{ children?: unknown; }> & Readonly<CoachMarkAnchorProps<AnchorType<P>> & P>
>this : this
>props : Readonly<{ children?: unknown; }> & Readonly<CoachMarkAnchorProps<Component<P, {}>> & P>
>anchorRef : (CoachMarkAnchorProps<Component<P, {}>> & P)["anchorRef"] | undefined
>props : Readonly<{ children?: unknown; }> & Readonly<CoachMarkAnchorProps<AnchorType<P>> & P>
>anchorRef : (CoachMarkAnchorProps<AnchorType<P>> & P)["anchorRef"] | undefined
if (anchorRef) {
>anchorRef : (CoachMarkAnchorProps<Component<P, {}>> & P)["anchorRef"] | undefined
>anchorRef : (CoachMarkAnchorProps<AnchorType<P>> & P)["anchorRef"] | undefined
anchorRef(anchor);
>anchorRef(anchor) : void
>anchorRef : (anchor: Component<P, {}>) => void
>anchor : Component<P, {}>
>anchorRef : (anchor: AnchorType<P>) => void
>anchor : AnchorType<P>
}
}
};
@@ -4,13 +4,13 @@ import * as Bluebird from 'bluebird';
>Bluebird : PromiseConstructor
async function a(): Bluebird<void> {
>a : () => Promise<void>
>a : () => Bluebird<void>
try {
const b = async function b(): Bluebird<void> {
>b : () => Promise<void>
>async function b(): Bluebird<void> { try { await Bluebird.resolve(); // -- remove this and it compiles } catch (error) { } } : () => Promise<void>
>b : () => Promise<void>
>b : () => Bluebird<void>
>async function b(): Bluebird<void> { try { await Bluebird.resolve(); // -- remove this and it compiles } catch (error) { } } : () => Bluebird<void>
>b : () => Bluebird<void>
try {
await Bluebird.resolve(); // -- remove this and it compiles
@@ -27,8 +27,8 @@ async function a(): Bluebird<void> {
await b(); // -- or remove this and it compiles
>await b() : void
>b() : Promise<void>
>b : () => Promise<void>
>b() : Bluebird<void>
>b : () => Bluebird<void>
} catch (error) { }
>error : any
@@ -39,12 +39,12 @@ declare module "bluebird" {
>"bluebird" : typeof import("bluebird")
type Bluebird<T> = Promise<T>;
>Bluebird : Promise<T>
>Bluebird : Bluebird<T>
const Bluebird: typeof Promise;
>Bluebird : PromiseConstructor
>Promise : PromiseConstructor
export = Bluebird;
>Bluebird : Promise<T>
>Bluebird : Bluebird<T>
}
@@ -25,7 +25,7 @@ interface CustomButtonProps extends ButtonProps {
}
const CustomButton: React.SFC<CustomButtonProps> = props => <Button {...props} />;
>CustomButton : React.StatelessComponent<CustomButtonProps>
>CustomButton : React.SFC<CustomButtonProps>
>React : any
>props => <Button {...props} /> : (props: CustomButtonProps & { children?: React.ReactNode; }) => JSX.Element
>props : CustomButtonProps & { children?: React.ReactNode; }
@@ -12,7 +12,7 @@ export interface ClickableProps {
export interface ButtonProps extends ClickableProps {
onClick: React.MouseEventHandler<any>;
>onClick : React.EventHandler<React.MouseEvent<any>>
>onClick : React.MouseEventHandler<any>
>React : any
}
@@ -12,7 +12,7 @@ export interface ClickableProps {
export interface ButtonProps extends ClickableProps {
onClick: React.MouseEventHandler<any>;
>onClick : React.EventHandler<React.MouseEvent<any>>
>onClick : React.MouseEventHandler<any>
>React : any
}
@@ -42,8 +42,8 @@ let test1: Test1<number>;
// not generic parameter default
interface Test2Base<V, T extends Settable<T, V>> { };
type Test2<V> = Test2Base<V, Identity<V>>;
>Test2 : Test2Base<V, Identity<V>>
>Test2 : Test2<V>
let test2: Test2<number>;
>test2 : Test2Base<number, Identity<number>>
>test2 : Test2<number>