Skip to content

Commit

Permalink
Accept new baselines
Browse files Browse the repository at this point in the history
  • Loading branch information
ahejlsberg committed Aug 27, 2019
1 parent c2d0aa8 commit 8f3a917
Show file tree
Hide file tree
Showing 15 changed files with 61 additions and 48 deletions.
2 changes: 0 additions & 2 deletions tests/baselines/reference/arrayFrom.errors.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
tests/cases/compiler/arrayFrom.ts(20,7): error TS2322: Type 'A[]' is not assignable to type 'B[]'.
Property 'b' is missing in type 'A' but required in type 'B'.
tests/cases/compiler/arrayFrom.ts(23,7): error TS2322: Type 'A[]' is not assignable to type 'B[]'.
Type 'A' is not assignable to type 'B'.


==== tests/cases/compiler/arrayFrom.ts (2 errors) ====
Expand Down Expand Up @@ -34,7 +33,6 @@ tests/cases/compiler/arrayFrom.ts(23,7): error TS2322: Type 'A[]' is not assigna
const result6: B[] = Array.from(inputALike); // expect error
~~~~~~~
!!! error TS2322: Type 'A[]' is not assignable to type 'B[]'.
!!! error TS2322: Type 'A' is not assignable to type 'B'.
const result7: B[] = Array.from(inputALike, ({ a }): B => ({ b: a }));
const result8: A[] = Array.from(inputARand);
const result9: B[] = Array.from(inputARand, ({ a }): B => ({ b: a }));
Expand Down
2 changes: 0 additions & 2 deletions tests/baselines/reference/castingTuple.errors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ tests/cases/conformance/types/tuple/castingTuple.ts(14,15): error TS2352: Conver
Types of property 'length' are incompatible.
Type '3' is not comparable to type '2'.
tests/cases/conformance/types/tuple/castingTuple.ts(15,14): error TS2352: Conversion of type '[number, string]' to type '[number, string, boolean]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
Property '2' is missing in type '[number, string]' but required in type '[number, string, boolean]'.
tests/cases/conformance/types/tuple/castingTuple.ts(18,21): error TS2352: Conversion of type '[C, D]' to type '[C, D, A]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
Property '2' is missing in type '[C, D]' but required in type '[C, D, A]'.
tests/cases/conformance/types/tuple/castingTuple.ts(20,33): error TS2493: Tuple type '[C, D, A]' of length '3' has no element at index '5'.
Expand Down Expand Up @@ -41,7 +40,6 @@ tests/cases/conformance/types/tuple/castingTuple.ts(33,1): error TS2304: Cannot
var longer = numStrTuple as [number, string, boolean]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2352: Conversion of type '[number, string]' to type '[number, string, boolean]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
!!! error TS2352: Property '2' is missing in type '[number, string]' but required in type '[number, string, boolean]'.
var classCDTuple: [C, D] = [new C(), new D()];
var interfaceIITuple = <[I, I]>classCDTuple;
var classCDATuple = <[C, D, A]>classCDTuple;
Expand Down
4 changes: 2 additions & 2 deletions tests/baselines/reference/checkJsxChildrenProperty3.types
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ class FetchUser extends React.Component<IFetchUserProps, any> {

? this.props.children(this.state.result)
>this.props.children(this.state.result) : JSX.Element
>this.props.children : ((user: IUser) => JSX.Element) | (((user: IUser) => JSX.Element) & string) | (((user: IUser) => JSX.Element) & number) | (((user: IUser) => JSX.Element) & false) | (((user: IUser) => JSX.Element) & true) | (((user: IUser) => JSX.Element) & React.ReactElement<any>) | (((user: IUser) => JSX.Element) & (string | number | boolean | React.ReactElement<any> | any[])[])
>this.props.children : ((user: IUser) => JSX.Element) | (((user: IUser) => JSX.Element) & string) | (((user: IUser) => JSX.Element) & number) | (((user: IUser) => JSX.Element) & false) | (((user: IUser) => JSX.Element) & true) | (((user: IUser) => JSX.Element) & React.ReactElement<any>) | (((user: IUser) => JSX.Element) & (string | number | boolean | any[] | React.ReactElement<any>)[])
>this.props : IFetchUserProps & { children?: React.ReactNode; }
>this : this
>props : IFetchUserProps & { children?: React.ReactNode; }
>children : ((user: IUser) => JSX.Element) | (((user: IUser) => JSX.Element) & string) | (((user: IUser) => JSX.Element) & number) | (((user: IUser) => JSX.Element) & false) | (((user: IUser) => JSX.Element) & true) | (((user: IUser) => JSX.Element) & React.ReactElement<any>) | (((user: IUser) => JSX.Element) & (string | number | boolean | React.ReactElement<any> | any[])[])
>children : ((user: IUser) => JSX.Element) | (((user: IUser) => JSX.Element) & string) | (((user: IUser) => JSX.Element) & number) | (((user: IUser) => JSX.Element) & false) | (((user: IUser) => JSX.Element) & true) | (((user: IUser) => JSX.Element) & React.ReactElement<any>) | (((user: IUser) => JSX.Element) & (string | number | boolean | any[] | React.ReactElement<any>)[])
>this.state.result : any
>this.state : any
>this : this
Expand Down
16 changes: 8 additions & 8 deletions tests/baselines/reference/checkJsxChildrenProperty4.errors.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
tests/cases/conformance/jsx/file.tsx(24,28): error TS2551: Property 'NAme' does not exist on type 'IUser'. Did you mean 'Name'?
tests/cases/conformance/jsx/file.tsx(36,15): error TS2322: Type '(user: IUser) => Element' is not assignable to type 'string | number | boolean | ReactElement<any> | any[]'.
Type '(user: IUser) => Element' is missing the following properties from type 'any[]': push, pop, concat, join, and 15 more.
tests/cases/conformance/jsx/file.tsx(39,15): error TS2322: Type '(user: IUser) => Element' is not assignable to type 'string | number | boolean | ReactElement<any> | any[]'.
Type '(user: IUser) => Element' is missing the following properties from type 'any[]': push, pop, concat, join, and 15 more.
tests/cases/conformance/jsx/file.tsx(36,15): error TS2322: Type '(user: IUser) => Element' is not assignable to type 'string | number | boolean | any[] | ReactElement<any>'.
Type '(user: IUser) => Element' is missing the following properties from type 'ReactElement<any>': type, props
tests/cases/conformance/jsx/file.tsx(39,15): error TS2322: Type '(user: IUser) => Element' is not assignable to type 'string | number | boolean | any[] | ReactElement<any>'.
Type '(user: IUser) => Element' is missing the following properties from type 'ReactElement<any>': type, props


==== tests/cases/conformance/jsx/file.tsx (3 errors) ====
Expand Down Expand Up @@ -50,17 +50,17 @@ tests/cases/conformance/jsx/file.tsx(39,15): error TS2322: Type '(user: IUser) =
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
) }
~~~~~~~~~~~~~
!!! error TS2322: Type '(user: IUser) => Element' is not assignable to type 'string | number | boolean | ReactElement<any> | any[]'.
!!! error TS2322: Type '(user: IUser) => Element' is missing the following properties from type 'any[]': push, pop, concat, join, and 15 more.
!!! error TS2322: Type '(user: IUser) => Element' is not assignable to type 'string | number | boolean | any[] | ReactElement<any>'.
!!! error TS2322: Type '(user: IUser) => Element' is missing the following properties from type 'ReactElement<any>': type, props
!!! related TS6212 tests/cases/conformance/jsx/file.tsx:36:15: Did you mean to call this expression?
{ user => (
~~~~~~~~~
<h1>{ user.Name }</h1>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
) }
~~~~~~~~~~~~~
!!! error TS2322: Type '(user: IUser) => Element' is not assignable to type 'string | number | boolean | ReactElement<any> | any[]'.
!!! error TS2322: Type '(user: IUser) => Element' is missing the following properties from type 'any[]': push, pop, concat, join, and 15 more.
!!! error TS2322: Type '(user: IUser) => Element' is not assignable to type 'string | number | boolean | any[] | ReactElement<any>'.
!!! error TS2322: Type '(user: IUser) => Element' is missing the following properties from type 'ReactElement<any>': type, props
!!! related TS6212 tests/cases/conformance/jsx/file.tsx:39:15: Did you mean to call this expression?
</FetchUser>
);
Expand Down
4 changes: 2 additions & 2 deletions tests/baselines/reference/checkJsxChildrenProperty4.types
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ class FetchUser extends React.Component<IFetchUserProps, any> {

? this.props.children(this.state.result)
>this.props.children(this.state.result) : JSX.Element
>this.props.children : ((user: IUser) => JSX.Element) | (((user: IUser) => JSX.Element) & string) | (((user: IUser) => JSX.Element) & number) | (((user: IUser) => JSX.Element) & false) | (((user: IUser) => JSX.Element) & true) | (((user: IUser) => JSX.Element) & React.ReactElement<any>) | (((user: IUser) => JSX.Element) & (string | number | boolean | React.ReactElement<any> | any[])[])
>this.props.children : ((user: IUser) => JSX.Element) | (((user: IUser) => JSX.Element) & string) | (((user: IUser) => JSX.Element) & number) | (((user: IUser) => JSX.Element) & false) | (((user: IUser) => JSX.Element) & true) | (((user: IUser) => JSX.Element) & React.ReactElement<any>) | (((user: IUser) => JSX.Element) & (string | number | boolean | any[] | React.ReactElement<any>)[])
>this.props : IFetchUserProps & { children?: React.ReactNode; }
>this : this
>props : IFetchUserProps & { children?: React.ReactNode; }
>children : ((user: IUser) => JSX.Element) | (((user: IUser) => JSX.Element) & string) | (((user: IUser) => JSX.Element) & number) | (((user: IUser) => JSX.Element) & false) | (((user: IUser) => JSX.Element) & true) | (((user: IUser) => JSX.Element) & React.ReactElement<any>) | (((user: IUser) => JSX.Element) & (string | number | boolean | React.ReactElement<any> | any[])[])
>children : ((user: IUser) => JSX.Element) | (((user: IUser) => JSX.Element) & string) | (((user: IUser) => JSX.Element) & number) | (((user: IUser) => JSX.Element) & false) | (((user: IUser) => JSX.Element) & true) | (((user: IUser) => JSX.Element) & React.ReactElement<any>) | (((user: IUser) => JSX.Element) & (string | number | boolean | any[] | React.ReactElement<any>)[])
>this.state.result : any
>this.state : any
>this : this
Expand Down
16 changes: 8 additions & 8 deletions tests/baselines/reference/complexRecursiveCollections.types
Original file line number Diff line number Diff line change
Expand Up @@ -1029,28 +1029,28 @@ declare module Immutable {
>value : T[K]

merge(...collections: Array<Partial<T> | Iterable<[string, any]>>): this;
>merge : (...collections: (Partial<T> | Iterable<[string, any]>)[]) => this
>collections : (Partial<T> | Iterable<[string, any]>)[]
>merge : (...collections: (Iterable<[string, any]> | Partial<T>)[]) => this
>collections : (Iterable<[string, any]> | Partial<T>)[]

mergeDeep(...collections: Array<Partial<T> | Iterable<[string, any]>>): this;
>mergeDeep : (...collections: (Partial<T> | Iterable<[string, any]>)[]) => this
>collections : (Partial<T> | Iterable<[string, any]>)[]
>mergeDeep : (...collections: (Iterable<[string, any]> | Partial<T>)[]) => this
>collections : (Iterable<[string, any]> | Partial<T>)[]

mergeWith(merger: (oldVal: any, newVal: any, key: keyof T) => any, ...collections: Array<Partial<T> | Iterable<[string, any]>>): this;
>mergeWith : (merger: (oldVal: any, newVal: any, key: keyof T) => any, ...collections: (Partial<T> | Iterable<[string, any]>)[]) => this
>mergeWith : (merger: (oldVal: any, newVal: any, key: keyof T) => any, ...collections: (Iterable<[string, any]> | Partial<T>)[]) => this
>merger : (oldVal: any, newVal: any, key: keyof T) => any
>oldVal : any
>newVal : any
>key : keyof T
>collections : (Partial<T> | Iterable<[string, any]>)[]
>collections : (Iterable<[string, any]> | Partial<T>)[]

mergeDeepWith(merger: (oldVal: any, newVal: any, key: any) => any, ...collections: Array<Partial<T> | Iterable<[string, any]>>): this;
>mergeDeepWith : (merger: (oldVal: any, newVal: any, key: any) => any, ...collections: (Partial<T> | Iterable<[string, any]>)[]) => this
>mergeDeepWith : (merger: (oldVal: any, newVal: any, key: any) => any, ...collections: (Iterable<[string, any]> | Partial<T>)[]) => this
>merger : (oldVal: any, newVal: any, key: any) => any
>oldVal : any
>newVal : any
>key : any
>collections : (Partial<T> | Iterable<[string, any]>)[]
>collections : (Iterable<[string, any]> | Partial<T>)[]

delete<K extends keyof T>(key: K): this;
>delete : <K extends keyof T>(key: K) => this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ var d = bar(1, "one", h); // Should be number[] | string[]

var d = bar("one", 1, h); // Should be number[] | string[]
>d : number[] | string[]
>bar("one", 1, h) : string[] | number[]
>bar("one", 1, h) : number[] | string[]
>bar : <T, U, V>(x: T, y: U, cb: (x: T, y: U) => V) => V
>"one" : "one"
>1 : 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(
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 (6 errors) ====
==== tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts (12 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.
Expand Down Expand Up @@ -44,13 +50,25 @@ tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(

// A type query directly depends on the type of the referenced entity.
var x: T5[] = []
~
!!! error TS2502: 'x' is referenced directly or indirectly in its own type annotation.
type T5 = typeof x
~~
!!! error TS2456: Type alias 'T5' circularly references itself.

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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,28 +39,28 @@ type T4 = [number, T4]

// A type query directly depends on the type of the referenced entity.
var x: T5[] = []
>x : any[][][][][][][][][][][]
>x : any
>[] : undefined[]

type T5 = typeof x
>T5 : any[][][][][][][][][][][]
>x : any[][][][][][][][][][][]
>T5 : any
>x : any

class C1<T> {}
>C1 : C1<T>

type T6 = T7 | number
>T6 : T6
>T6 : any

type T7 = typeof yy
>T7 : [string, C<T6>[]]
>yy : [string, C<T6>[]]
>T7 : any
>yy : any

var yy: [string, T8[]];
>yy : [string, C<T6>[]]
>yy : any

type T8 = C<T6>
>T8 : C<T6>
>T8 : any

// legal cases
type T9 = () => T9
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tests/cases/compiler/recursiveResolveTypeMembers.ts(4,49): error TS2589: Type instantiation is excessively deep and possibly infinite.
tests/cases/compiler/recursiveResolveTypeMembers.ts(4,49): error TS2577: Return type annotation circularly references itself.
tests/cases/compiler/recursiveResolveTypeMembers.ts(4,58): error TS2304: Cannot find name 'H'.
tests/cases/compiler/recursiveResolveTypeMembers.ts(4,62): error TS2574: A rest element type must be an array type.
tests/cases/compiler/recursiveResolveTypeMembers.ts(4,79): error TS2304: Cannot find name 'R'.
Expand All @@ -10,7 +10,7 @@ tests/cases/compiler/recursiveResolveTypeMembers.ts(4,79): error TS2304: Cannot
type PromisedTuple<L extends any[], U = (...args: L) => void> =
U extends (h: infer H, ...args: infer R) => [Promise<H>, ...PromisedTuple<R>] ? [] : []
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2589: Type instantiation is excessively deep and possibly infinite.
!!! error TS2577: Return type annotation circularly references itself.
~
!!! error TS2304: Cannot find name 'H'.
~~~~~~~~~~~~~~~~~~~
Expand Down
7 changes: 3 additions & 4 deletions tests/baselines/reference/recursiveTypesWithTypeof.errors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithType
tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts(6,5): error TS2502: 'e' is referenced directly or indirectly in its own type annotation.
tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts(10,5): error TS2502: 'f' is referenced directly or indirectly in its own type annotation.
tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts(12,5): error TS2502: 'f2' is referenced directly or indirectly in its own type annotation.
tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts(15,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'f3' must be of type 'Foo<Foo<Foo<Foo<Foo<Foo<Foo<Foo<Foo<Foo<Foo<any>[]>[]>[]>[]>[]>[]>[]>[]>[]>[]>[]', but here has type 'any'.
tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts(14,5): error TS2502: 'f3' is referenced directly or indirectly in its own type annotation.
tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts(51,5): error TS2502: 'hy3' is referenced directly or indirectly in its own type annotation.


Expand Down Expand Up @@ -32,10 +32,9 @@ tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithType
!!! error TS2502: 'f2' is referenced directly or indirectly in its own type annotation.
var f2: any;
var f3: Foo<typeof f3>[];
var f3: any;
~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'f3' must be of type 'Foo<Foo<Foo<Foo<Foo<Foo<Foo<Foo<Foo<Foo<Foo<any>[]>[]>[]>[]>[]>[]>[]>[]>[]>[]>[]', but here has type 'any'.
!!! related TS6203 tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts:14:5: 'f3' was also declared here.
!!! error TS2502: 'f3' is referenced directly or indirectly in its own type annotation.
var f3: any;

// None of these declarations should have any errors!
// Truly recursive types
Expand Down
6 changes: 3 additions & 3 deletions tests/baselines/reference/recursiveTypesWithTypeof.types
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ var f2: any;
>f2 : any

var f3: Foo<typeof f3>[];
>f3 : Foo<Foo<Foo<Foo<Foo<Foo<Foo<Foo<Foo<Foo<Foo<any>[]>[]>[]>[]>[]>[]>[]>[]>[]>[]>[]
>f3 : Foo<Foo<Foo<Foo<Foo<Foo<Foo<Foo<Foo<Foo<Foo<any>[]>[]>[]>[]>[]>[]>[]>[]>[]>[]>[]
>f3 : any
>f3 : any

var f3: any;
>f3 : Foo<Foo<Foo<Foo<Foo<Foo<Foo<Foo<Foo<Foo<Foo<any>[]>[]>[]>[]>[]>[]>[]>[]>[]>[]>[]
>f3 : any

// None of these declarations should have any errors!
// Truly recursive types
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/spreadTypeVariable.types
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function f4<T extends number | { [key: string]: any }>(arg: T) {
}

function f5<T extends string[] | { [key: string]: any }>(arg: T) {
>f5 : <T extends { [key: string]: any; } | string[]>(arg: T) => T
>f5 : <T extends string[] | { [key: string]: any; }>(arg: T) => T
>key : string
>arg : T

Expand Down
Loading

0 comments on commit 8f3a917

Please sign in to comment.