From 9e362b949edec7b59a79ed402d4fd92a737f646b Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Thu, 24 May 2018 12:49:20 -0700 Subject: [PATCH] Accept new baselines --- .../reference/awaitUnionPromise.types | 12 +++--- .../checkJsxChildrenProperty12.types | 8 ++-- .../checkJsxChildrenProperty13.types | 4 +- .../reference/checkJsxChildrenProperty3.types | 8 ++-- .../checkJsxChildrenProperty4.errors.txt | 4 +- .../reference/checkJsxChildrenProperty4.types | 8 ++-- ...controlFlowWithTemplateLiterals.errors.txt | 16 ++++++++ .../controlFlowWithTemplateLiterals.symbols | 4 -- .../controlFlowWithTemplateLiterals.types | 16 ++++---- .../defaultExportInAwaitExpression01.types | 6 +-- .../defaultExportInAwaitExpression02.types | 6 +-- ...ectBindingPatternAndAssignment3.errors.txt | 4 +- ...illInMissingTypeArgsOnConstructCalls.types | 4 +- ...ithConstraintsTypeArgumentInference2.types | 8 ++-- .../baselines/reference/genericDefaults.types | 18 ++++---- .../reference/indexerConstraints2.types | 6 +-- .../baselines/reference/inferenceLimit.types | 6 +-- ...eLibrary_NoErrorDuplicateLibOptions1.types | 4 +- ...eLibrary_NoErrorDuplicateLibOptions2.types | 4 +- ...dularizeLibrary_TargetES5UsingES6Lib.types | 4 +- tests/baselines/reference/objectSpread.types | 6 +-- .../reference/spreadUnion2.errors.txt | 41 ------------------- tests/baselines/reference/spreadUnion2.types | 22 +++++----- .../reference/thisTypeInFunctions2.symbols | 6 ++- .../reference/thisTypeInFunctions2.types | 16 ++++---- .../tsxAttributeResolution15.errors.txt | 4 +- .../reference/tsxGenericAttributesType1.types | 18 ++++---- .../tsxGenericAttributesType2.errors.txt | 4 +- .../reference/tsxGenericAttributesType2.types | 6 +-- .../reference/tsxGenericAttributesType3.types | 4 +- .../reference/tsxGenericAttributesType4.types | 4 +- .../reference/tsxGenericAttributesType9.types | 4 +- ...ponentWithDefaultTypeParameter3.errors.txt | 4 +- ...tsxSpreadAttributesResolution12.errors.txt | 4 +- .../tsxSpreadAttributesResolution2.errors.txt | 16 ++++---- .../tsxSpreadAttributesResolution5.errors.txt | 8 ++-- .../tsxSpreadAttributesResolution6.errors.txt | 8 ++-- .../tsxStatelessFunctionComponents3.types | 6 +-- .../tsxTypeArgumentResolution.errors.txt | 8 ++-- .../reference/tsxUnionElementType4.errors.txt | 8 ++-- .../reference/tsxUnionTypeComponent1.types | 4 +- .../baselines/reference/tupleTypes.errors.txt | 10 ++--- .../reference/usePromiseFinally.types | 4 +- 43 files changed, 168 insertions(+), 197 deletions(-) create mode 100644 tests/baselines/reference/controlFlowWithTemplateLiterals.errors.txt delete mode 100644 tests/baselines/reference/spreadUnion2.errors.txt diff --git a/tests/baselines/reference/awaitUnionPromise.types b/tests/baselines/reference/awaitUnionPromise.types index f1d91c038de..cbc3abbb21c 100644 --- a/tests/baselines/reference/awaitUnionPromise.types +++ b/tests/baselines/reference/awaitUnionPromise.types @@ -23,7 +23,7 @@ interface IAsyncEnumerator { >AsyncEnumeratorDone : AsyncEnumeratorDone next3(): Promise; ->next3 : () => Promise<{} | T> +>next3 : () => Promise<{}> >Promise : Promise >T : T @@ -59,12 +59,12 @@ async function main() { >next2 : () => Promise | Promise let c = await x.next3(); ->c : number | {} ->await x.next3() : number | {} ->x.next3() : Promise ->x.next3 : () => Promise +>c : {} +>await x.next3() : {} +>x.next3() : Promise<{}> +>x.next3 : () => Promise<{}> >x : IAsyncEnumerator ->next3 : () => Promise +>next3 : () => Promise<{}> let d = await x.next4(); >d : number | { x: string; } diff --git a/tests/baselines/reference/checkJsxChildrenProperty12.types b/tests/baselines/reference/checkJsxChildrenProperty12.types index 93a7d0f9be1..743c628b85e 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty12.types +++ b/tests/baselines/reference/checkJsxChildrenProperty12.types @@ -35,18 +35,18 @@ class Button extends React.Component { return > : JSX.Element >InnerButton : typeof InnerButton ->this.props : ButtonProp & { children?: React.ReactNode; } +>this.props : ButtonProp & { children?: {}; } >this : this ->props : ButtonProp & { children?: React.ReactNode; } +>props : ButtonProp & { children?: {}; } } else { return ( >(
Hello World
) : JSX.Element >
Hello World
: JSX.Element >InnerButton : typeof InnerButton ->this.props : ButtonProp & { children?: React.ReactNode; } +>this.props : ButtonProp & { children?: {}; } >this : this ->props : ButtonProp & { children?: React.ReactNode; } +>props : ButtonProp & { children?: {}; }
Hello World
>
Hello World
: JSX.Element diff --git a/tests/baselines/reference/checkJsxChildrenProperty13.types b/tests/baselines/reference/checkJsxChildrenProperty13.types index 10d3876ae63..7aaab34ab72 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty13.types +++ b/tests/baselines/reference/checkJsxChildrenProperty13.types @@ -31,9 +31,9 @@ class Button extends React.Component { >(
Hello World
) : JSX.Element >
Hello World
: JSX.Element >InnerButton : typeof InnerButton ->this.props : ButtonProp & { children?: React.ReactNode; } +>this.props : ButtonProp & { children?: {}; } >this : this ->props : ButtonProp & { children?: React.ReactNode; } +>props : ButtonProp & { children?: {}; } >children : string
Hello World
diff --git a/tests/baselines/reference/checkJsxChildrenProperty3.types b/tests/baselines/reference/checkJsxChildrenProperty3.types index 7fbb91bee00..2045f946d56 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty3.types +++ b/tests/baselines/reference/checkJsxChildrenProperty3.types @@ -38,11 +38,11 @@ class FetchUser extends React.Component { ? 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) & true) | (((user: IUser) => JSX.Element) & false) | (((user: IUser) => JSX.Element) & React.ReactElement) | (((user: IUser) => JSX.Element) & (string | number | boolean | any[] | React.ReactElement)[]) ->this.props : IFetchUserProps & { children?: React.ReactNode; } +>this.props.children : (user: IUser) => JSX.Element +>this.props : IFetchUserProps & { children?: {}; } >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) & true) | (((user: IUser) => JSX.Element) & false) | (((user: IUser) => JSX.Element) & React.ReactElement) | (((user: IUser) => JSX.Element) & (string | number | boolean | any[] | React.ReactElement)[]) +>props : IFetchUserProps & { children?: {}; } +>children : (user: IUser) => JSX.Element >this.state.result : any >this.state : any >this : this diff --git a/tests/baselines/reference/checkJsxChildrenProperty4.errors.txt b/tests/baselines/reference/checkJsxChildrenProperty4.errors.txt index 377ac6ab886..d0ed50f986e 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty4.errors.txt +++ b/tests/baselines/reference/checkJsxChildrenProperty4.errors.txt @@ -1,5 +1,5 @@ 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(32,10): error TS2322: Type '{ children: ((user: IUser) => Element)[]; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & IFetchUserProps & { children?: ReactNode; }'. +tests/cases/conformance/jsx/file.tsx(32,10): error TS2322: Type '{ children: ((user: IUser) => Element)[]; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & IFetchUserProps & { children?: {}; }'. Type '{ children: ((user: IUser) => Element)[]; }' is not assignable to type 'IFetchUserProps'. Types of property 'children' are incompatible. Type '((user: IUser) => Element)[]' is not assignable to type '(user: IUser) => Element'. @@ -42,7 +42,7 @@ tests/cases/conformance/jsx/file.tsx(32,10): error TS2322: Type '{ children: ((u return ( ~~~~~~~~~ -!!! error TS2322: Type '{ children: ((user: IUser) => Element)[]; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & IFetchUserProps & { children?: ReactNode; }'. +!!! error TS2322: Type '{ children: ((user: IUser) => Element)[]; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & IFetchUserProps & { children?: {}; }'. !!! error TS2322: Type '{ children: ((user: IUser) => Element)[]; }' is not assignable to type 'IFetchUserProps'. !!! error TS2322: Types of property 'children' are incompatible. !!! error TS2322: Type '((user: IUser) => Element)[]' is not assignable to type '(user: IUser) => Element'. diff --git a/tests/baselines/reference/checkJsxChildrenProperty4.types b/tests/baselines/reference/checkJsxChildrenProperty4.types index 6e4c04aa231..2545088ba3f 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty4.types +++ b/tests/baselines/reference/checkJsxChildrenProperty4.types @@ -38,11 +38,11 @@ class FetchUser extends React.Component { ? 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) & true) | (((user: IUser) => JSX.Element) & false) | (((user: IUser) => JSX.Element) & React.ReactElement) | (((user: IUser) => JSX.Element) & (string | number | boolean | any[] | React.ReactElement)[]) ->this.props : IFetchUserProps & { children?: React.ReactNode; } +>this.props.children : (user: IUser) => JSX.Element +>this.props : IFetchUserProps & { children?: {}; } >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) & true) | (((user: IUser) => JSX.Element) & false) | (((user: IUser) => JSX.Element) & React.ReactElement) | (((user: IUser) => JSX.Element) & (string | number | boolean | any[] | React.ReactElement)[]) +>props : IFetchUserProps & { children?: {}; } +>children : (user: IUser) => JSX.Element >this.state.result : any >this.state : any >this : this diff --git a/tests/baselines/reference/controlFlowWithTemplateLiterals.errors.txt b/tests/baselines/reference/controlFlowWithTemplateLiterals.errors.txt new file mode 100644 index 00000000000..26327f842f0 --- /dev/null +++ b/tests/baselines/reference/controlFlowWithTemplateLiterals.errors.txt @@ -0,0 +1,16 @@ +tests/cases/conformance/controlFlow/controlFlowWithTemplateLiterals.ts(8,7): error TS2339: Property 'test' does not exist on type 'never'. + + +==== tests/cases/conformance/controlFlow/controlFlowWithTemplateLiterals.ts (1 errors) ==== + declare const envVar: string | undefined; + if (typeof envVar === `string`) { + envVar.slice(0) + } + + declare const obj: {test: string} | {} + if (`test` in obj) { + obj.test.slice(0) + ~~~~ +!!! error TS2339: Property 'test' does not exist on type 'never'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/controlFlowWithTemplateLiterals.symbols b/tests/baselines/reference/controlFlowWithTemplateLiterals.symbols index 978a0e507e0..a16a2ea702e 100644 --- a/tests/baselines/reference/controlFlowWithTemplateLiterals.symbols +++ b/tests/baselines/reference/controlFlowWithTemplateLiterals.symbols @@ -19,10 +19,6 @@ if (`test` in obj) { >obj : Symbol(obj, Decl(controlFlowWithTemplateLiterals.ts, 5, 13)) obj.test.slice(0) ->obj.test.slice : Symbol(String.slice, Decl(lib.d.ts, --, --)) ->obj.test : Symbol(test, Decl(controlFlowWithTemplateLiterals.ts, 5, 20)) >obj : Symbol(obj, Decl(controlFlowWithTemplateLiterals.ts, 5, 13)) ->test : Symbol(test, Decl(controlFlowWithTemplateLiterals.ts, 5, 20)) ->slice : Symbol(String.slice, Decl(lib.d.ts, --, --)) } diff --git a/tests/baselines/reference/controlFlowWithTemplateLiterals.types b/tests/baselines/reference/controlFlowWithTemplateLiterals.types index 7775d26fe38..3702cbdb8f6 100644 --- a/tests/baselines/reference/controlFlowWithTemplateLiterals.types +++ b/tests/baselines/reference/controlFlowWithTemplateLiterals.types @@ -17,21 +17,21 @@ if (typeof envVar === `string`) { } declare const obj: {test: string} | {} ->obj : {} | { test: string; } +>obj : {} >test : string if (`test` in obj) { >`test` in obj : boolean >`test` : "test" ->obj : {} | { test: string; } +>obj : {} obj.test.slice(0) ->obj.test.slice(0) : string ->obj.test.slice : (start?: number | undefined, end?: number | undefined) => string ->obj.test : string ->obj : { test: string; } ->test : string ->slice : (start?: number | undefined, end?: number | undefined) => string +>obj.test.slice(0) : any +>obj.test.slice : any +>obj.test : any +>obj : never +>test : any +>slice : any >0 : 0 } diff --git a/tests/baselines/reference/defaultExportInAwaitExpression01.types b/tests/baselines/reference/defaultExportInAwaitExpression01.types index 1f7de76b90e..d78fa2adf01 100644 --- a/tests/baselines/reference/defaultExportInAwaitExpression01.types +++ b/tests/baselines/reference/defaultExportInAwaitExpression01.types @@ -3,11 +3,11 @@ const x = new Promise( ( resolve, reject ) => { resolve( {} ); } ); >x : Promise<{}> >new Promise( ( resolve, reject ) => { resolve( {} ); } ) : Promise<{}> >Promise : PromiseConstructor ->( resolve, reject ) => { resolve( {} ); } : (resolve: (value?: {} | PromiseLike<{}>) => void, reject: (reason?: any) => void) => void ->resolve : (value?: {} | PromiseLike<{}>) => void +>( resolve, reject ) => { resolve( {} ); } : (resolve: (value?: {}) => void, reject: (reason?: any) => void) => void +>resolve : (value?: {}) => void >reject : (reason?: any) => void >resolve( {} ) : void ->resolve : (value?: {} | PromiseLike<{}>) => void +>resolve : (value?: {}) => void >{} : {} export default x; diff --git a/tests/baselines/reference/defaultExportInAwaitExpression02.types b/tests/baselines/reference/defaultExportInAwaitExpression02.types index 1f7de76b90e..d78fa2adf01 100644 --- a/tests/baselines/reference/defaultExportInAwaitExpression02.types +++ b/tests/baselines/reference/defaultExportInAwaitExpression02.types @@ -3,11 +3,11 @@ const x = new Promise( ( resolve, reject ) => { resolve( {} ); } ); >x : Promise<{}> >new Promise( ( resolve, reject ) => { resolve( {} ); } ) : Promise<{}> >Promise : PromiseConstructor ->( resolve, reject ) => { resolve( {} ); } : (resolve: (value?: {} | PromiseLike<{}>) => void, reject: (reason?: any) => void) => void ->resolve : (value?: {} | PromiseLike<{}>) => void +>( resolve, reject ) => { resolve( {} ); } : (resolve: (value?: {}) => void, reject: (reason?: any) => void) => void +>resolve : (value?: {}) => void >reject : (reason?: any) => void >resolve( {} ) : void ->resolve : (value?: {} | PromiseLike<{}>) => void +>resolve : (value?: {}) => void >{} : {} export default x; diff --git a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment3.errors.txt b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment3.errors.txt index 33344b9b5eb..5d932b0f8b1 100644 --- a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment3.errors.txt +++ b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment3.errors.txt @@ -2,7 +2,7 @@ tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAs tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts(3,5): error TS2322: Type '{ i: number; }' is not assignable to type 'string | number'. Type '{ i: number; }' is not assignable to type 'number'. tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts(3,6): error TS2459: Type 'string | number' has no property 'i' and no string index signature. -tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts(4,6): error TS2459: Type 'string | number | {}' has no property 'i1' and no string index signature. +tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts(4,6): error TS2459: Type '{}' has no property 'i1' and no string index signature. tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts(5,12): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts(5,21): error TS2353: Object literal may only specify known properties, and 'f212' does not exist in type '{ f21: any; }'. tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts(6,7): error TS1005: ':' expected. @@ -23,7 +23,7 @@ tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAs !!! error TS2459: Type 'string | number' has no property 'i' and no string index signature. var {i1}: string | number| {} = { i1: 2 }; ~~ -!!! error TS2459: Type 'string | number | {}' has no property 'i1' and no string index signature. +!!! error TS2459: Type '{}' has no property 'i1' and no string index signature. var { f2: {f21} = { f212: "string" } }: any = undefined; ~~~ !!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. diff --git a/tests/baselines/reference/fillInMissingTypeArgsOnConstructCalls.types b/tests/baselines/reference/fillInMissingTypeArgsOnConstructCalls.types index 496400c8235..06e7cb90ceb 100644 --- a/tests/baselines/reference/fillInMissingTypeArgsOnConstructCalls.types +++ b/tests/baselines/reference/fillInMissingTypeArgsOnConstructCalls.types @@ -9,7 +9,7 @@ class A{ >T : T } var a = new A(); ->a : A<{}> ->new A() : A<{}> +>a : A +>new A() : A >A : typeof A diff --git a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.types b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.types index 75519a850fe..bb11146b0df 100644 --- a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.types +++ b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.types @@ -24,14 +24,14 @@ var r = foo(1); // ok >1 : 1 var r2 = foo(null); // {} ->r2 : {} ->foo(null) : {} +>r2 : any +>foo(null) : any >foo : (t: T) => U >null : null var r3 = foo(new Object()); // {} ->r3 : {} ->foo(new Object()) : {} +>r3 : Object +>foo(new Object()) : Object >foo : (t: T) => U >new Object() : Object >Object : ObjectConstructor diff --git a/tests/baselines/reference/genericDefaults.types b/tests/baselines/reference/genericDefaults.types index 0013daefd89..c15e3220ecf 100644 --- a/tests/baselines/reference/genericDefaults.types +++ b/tests/baselines/reference/genericDefaults.types @@ -1004,7 +1004,7 @@ declare function f11(a?: T, b?: U): [T, U]; // inference f11(); ->f11() : [{}, {} | B] +>f11() : [{}, {}] >f11 : (a?: T, b?: U) => [T, U] f11(a); @@ -1607,7 +1607,7 @@ declare function f17(a?: T, b?: U): [T, U]; // inference f17(); ->f17() : [{}, {} | B] +>f17() : [{}, {}] >f17 : (a?: T, b?: U) => [T, U] f17(a); @@ -1702,11 +1702,11 @@ declare function f18(a?: T, b?: U, c?: V): [T, U, V]; // inference f18(); ->f18() : [{}, {}, {} | C] +>f18() : [{}, {}, {}] >f18 : (a?: T, b?: U, c?: V) => [T, U, V] f18(a); ->f18(a) : [A, {}, {} | C] +>f18(a) : [A, {}, {}] >f18 : (a?: T, b?: U, c?: V) => [T, U, V] >a : A @@ -1732,25 +1732,25 @@ f18(a, b, c); // no inference, partially supplied f18(); ->f18() : [A, {}, {} | C] +>f18() : [A, {}, {}] >f18 : (a?: T, b?: U, c?: V) => [T, U, V] >A : A f18(a); ->f18(a) : [A, {}, {} | C] +>f18(a) : [A, {}, {}] >f18 : (a?: T, b?: U, c?: V) => [T, U, V] >A : A >a : A f18(a, b); ->f18(a, b) : [A, {}, {} | C] +>f18(a, b) : [A, {}, {}] >f18 : (a?: T, b?: U, c?: V) => [T, U, V] >A : A >a : A >b : B f18(a, b, b); ->f18(a, b, b) : [A, {}, {} | C] +>f18(a, b, b) : [A, {}, {}] >f18 : (a?: T, b?: U, c?: V) => [T, U, V] >A : A >a : A @@ -1758,7 +1758,7 @@ f18(a, b, b); >b : B f18(a, b, c); ->f18(a, b, c) : [A, {}, {} | C] +>f18(a, b, c) : [A, {}, {}] >f18 : (a?: T, b?: U, c?: V) => [T, U, V] >A : A >a : A diff --git a/tests/baselines/reference/indexerConstraints2.types b/tests/baselines/reference/indexerConstraints2.types index e2db782d788..a6ce22c20af 100644 --- a/tests/baselines/reference/indexerConstraints2.types +++ b/tests/baselines/reference/indexerConstraints2.types @@ -113,14 +113,14 @@ interface O { } type NonIndexableUnion = boolean | {}; ->NonIndexableUnion : NonIndexableUnion +>NonIndexableUnion : {} interface P { >P : P [u: NonIndexableUnion]: A; ->u : NonIndexableUnion ->NonIndexableUnion : NonIndexableUnion +>u : {} +>NonIndexableUnion : {} >A : A } diff --git a/tests/baselines/reference/inferenceLimit.types b/tests/baselines/reference/inferenceLimit.types index 4a398932232..5835f680c0c 100644 --- a/tests/baselines/reference/inferenceLimit.types +++ b/tests/baselines/reference/inferenceLimit.types @@ -40,8 +40,8 @@ export class BrokenClass { return new Promise((resolve, reject) => { >new Promise((resolve, reject) => { this.doStuff(order.id) .then((items) => { order.items = items; resolve(order); }); }) : Promise<{}> >Promise : PromiseConstructor ->(resolve, reject) => { this.doStuff(order.id) .then((items) => { order.items = items; resolve(order); }); } : (resolve: (value?: {} | PromiseLike<{}>) => void, reject: (reason?: any) => void) => void ->resolve : (value?: {} | PromiseLike<{}>) => void +>(resolve, reject) => { this.doStuff(order.id) .then((items) => { order.items = items; resolve(order); }); } : (resolve: (value?: {}) => void, reject: (reason?: any) => void) => void +>resolve : (value?: {}) => void >reject : (reason?: any) => void this.doStuff(order.id) @@ -69,7 +69,7 @@ export class BrokenClass { resolve(order); >resolve(order) : void ->resolve : (value?: {} | PromiseLike<{}>) => void +>resolve : (value?: {}) => void >order : any }); diff --git a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types index 4fdc3764e88..614651e67be 100644 --- a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types +++ b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types @@ -138,8 +138,8 @@ async function out() { return new Promise(function (resolve, reject) {}); >new Promise(function (resolve, reject) {}) : Promise<{}> >Promise : PromiseConstructor ->function (resolve, reject) {} : (resolve: (value?: {} | PromiseLike<{}>) => void, reject: (reason?: any) => void) => void ->resolve : (value?: {} | PromiseLike<{}>) => void +>function (resolve, reject) {} : (resolve: (value?: {}) => void, reject: (reason?: any) => void) => void +>resolve : (value?: {}) => void >reject : (reason?: any) => void } diff --git a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types index 8c3ad5b55af..aad9e483a69 100644 --- a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types +++ b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types @@ -138,8 +138,8 @@ async function out() { return new Promise(function (resolve, reject) {}); >new Promise(function (resolve, reject) {}) : Promise<{}> >Promise : PromiseConstructor ->function (resolve, reject) {} : (resolve: (value?: {} | PromiseLike<{}>) => void, reject: (reason?: any) => void) => void ->resolve : (value?: {} | PromiseLike<{}>) => void +>function (resolve, reject) {} : (resolve: (value?: {}) => void, reject: (reason?: any) => void) => void +>resolve : (value?: {}) => void >reject : (reason?: any) => void } diff --git a/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types b/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types index df4e231ba80..2f3c76e9b14 100644 --- a/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types +++ b/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types @@ -138,8 +138,8 @@ async function out() { return new Promise(function (resolve, reject) {}); >new Promise(function (resolve, reject) {}) : Promise<{}> >Promise : PromiseConstructor ->function (resolve, reject) {} : (resolve: (value?: {} | PromiseLike<{}>) => void, reject: (reason?: any) => void) => void ->resolve : (value?: {} | PromiseLike<{}>) => void +>function (resolve, reject) {} : (resolve: (value?: {}) => void, reject: (reason?: any) => void) => void +>resolve : (value?: {}) => void >reject : (reason?: any) => void } diff --git a/tests/baselines/reference/objectSpread.types b/tests/baselines/reference/objectSpread.types index 8b7cb97fce3..684ba544599 100644 --- a/tests/baselines/reference/objectSpread.types +++ b/tests/baselines/reference/objectSpread.types @@ -296,7 +296,7 @@ function conditionalSpreadBoolean(b: boolean) : { x: number, y: number } { } let o2 = { ...b && { x: 21 }} >o2 : {} ->{ ...b && { x: 21 }} : {} | { x: number; } +>{ ...b && { x: 21 }} : {} >b && { x: 21 } : false | { x: number; } >b : boolean >{ x: 21 } : { x: number; } @@ -337,7 +337,7 @@ function conditionalSpreadNumber(nt: number): { x: number, y: number } { } let o2 = { ...nt && { x: nt }} >o2 : {} ->{ ...nt && { x: nt }} : {} | { x: number; } +>{ ...nt && { x: nt }} : {} >nt && { x: nt } : 0 | { x: number; } >nt : number >{ x: nt } : { x: number; } @@ -378,7 +378,7 @@ function conditionalSpreadString(st: string): { x: string, y: number } { } let o2 = { ...st && { x: st }} >o2 : {} ->{ ...st && { x: st }} : {} | { x: string; } +>{ ...st && { x: st }} : {} >st && { x: st } : "" | { x: string; } >st : string >{ x: st } : { x: string; } diff --git a/tests/baselines/reference/spreadUnion2.errors.txt b/tests/baselines/reference/spreadUnion2.errors.txt deleted file mode 100644 index 0115c449930..00000000000 --- a/tests/baselines/reference/spreadUnion2.errors.txt +++ /dev/null @@ -1,41 +0,0 @@ -tests/cases/conformance/types/spread/spreadUnion2.ts(5,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'o1' must be of type '{} | { a: number; }', but here has type '{}'. -tests/cases/conformance/types/spread/spreadUnion2.ts(8,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'o2' must be of type '{} | { b: number; }', but here has type '{}'. -tests/cases/conformance/types/spread/spreadUnion2.ts(11,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'o3' must be of type '{} | { a: number; } | { b: number; } | { a: number; b: number; }', but here has type '{}'. -tests/cases/conformance/types/spread/spreadUnion2.ts(12,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'o3' must be of type '{} | { a: number; } | { b: number; } | { a: number; b: number; }', but here has type '{}'. -tests/cases/conformance/types/spread/spreadUnion2.ts(15,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'o4' must be of type '{} | { a: number; }', but here has type '{}'. -tests/cases/conformance/types/spread/spreadUnion2.ts(18,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'o5' must be of type '{} | { b: number; }', but here has type '{}'. - - -==== tests/cases/conformance/types/spread/spreadUnion2.ts (6 errors) ==== - declare const undefinedUnion: { a: number } | undefined; - declare const nullUnion: { b: number } | null; - - var o1: {} | { a: number }; - var o1 = { ...undefinedUnion }; - ~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'o1' must be of type '{} | { a: number; }', but here has type '{}'. - - var o2: {} | { b: number }; - var o2 = { ...nullUnion }; - ~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'o2' must be of type '{} | { b: number; }', but here has type '{}'. - - var o3: {} | { a: number } | { b: number } | { a: number, b: number }; - var o3 = { ...undefinedUnion, ...nullUnion }; - ~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'o3' must be of type '{} | { a: number; } | { b: number; } | { a: number; b: number; }', but here has type '{}'. - var o3 = { ...nullUnion, ...undefinedUnion }; - ~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'o3' must be of type '{} | { a: number; } | { b: number; } | { a: number; b: number; }', but here has type '{}'. - - var o4: {} | { a: number }; - var o4 = { ...undefinedUnion, ...undefinedUnion }; - ~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'o4' must be of type '{} | { a: number; }', but here has type '{}'. - - var o5: {} | { b: number }; - var o5 = { ...nullUnion, ...nullUnion }; - ~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'o5' must be of type '{} | { b: number; }', but here has type '{}'. - - \ No newline at end of file diff --git a/tests/baselines/reference/spreadUnion2.types b/tests/baselines/reference/spreadUnion2.types index 5077949bc97..7efd1f05e10 100644 --- a/tests/baselines/reference/spreadUnion2.types +++ b/tests/baselines/reference/spreadUnion2.types @@ -9,58 +9,58 @@ declare const nullUnion: { b: number } | null; >null : null var o1: {} | { a: number }; ->o1 : {} | { a: number; } +>o1 : {} >a : number var o1 = { ...undefinedUnion }; ->o1 : {} | { a: number; } +>o1 : {} >{ ...undefinedUnion } : {} | { a: number; } >undefinedUnion : { a: number; } | undefined var o2: {} | { b: number }; ->o2 : {} | { b: number; } +>o2 : {} >b : number var o2 = { ...nullUnion }; ->o2 : {} | { b: number; } +>o2 : {} >{ ...nullUnion } : {} | { b: number; } >nullUnion : { b: number; } | null var o3: {} | { a: number } | { b: number } | { a: number, b: number }; ->o3 : {} | { a: number; } | { b: number; } | { a: number; b: number; } +>o3 : {} >a : number >b : number >a : number >b : number var o3 = { ...undefinedUnion, ...nullUnion }; ->o3 : {} | { a: number; } | { b: number; } | { a: number; b: number; } +>o3 : {} >{ ...undefinedUnion, ...nullUnion } : {} | { b: number; } | { a: number; } | { b: number; a: number; } >undefinedUnion : { a: number; } | undefined >nullUnion : { b: number; } | null var o3 = { ...nullUnion, ...undefinedUnion }; ->o3 : {} | { a: number; } | { b: number; } | { a: number; b: number; } +>o3 : {} >{ ...nullUnion, ...undefinedUnion } : {} | { a: number; } | { b: number; } | { a: number; b: number; } >nullUnion : { b: number; } | null >undefinedUnion : { a: number; } | undefined var o4: {} | { a: number }; ->o4 : {} | { a: number; } +>o4 : {} >a : number var o4 = { ...undefinedUnion, ...undefinedUnion }; ->o4 : {} | { a: number; } +>o4 : {} >{ ...undefinedUnion, ...undefinedUnion } : {} | { a: number; } | { a: number; } | { a: number; } >undefinedUnion : { a: number; } | undefined >undefinedUnion : { a: number; } | undefined var o5: {} | { b: number }; ->o5 : {} | { b: number; } +>o5 : {} >b : number var o5 = { ...nullUnion, ...nullUnion }; ->o5 : {} | { b: number; } +>o5 : {} >{ ...nullUnion, ...nullUnion } : {} | { b: number; } | { b: number; } | { b: number; } >nullUnion : { b: number; } | null >nullUnion : { b: number; } | null diff --git a/tests/baselines/reference/thisTypeInFunctions2.symbols b/tests/baselines/reference/thisTypeInFunctions2.symbols index aeff7756a62..5681ca18d53 100644 --- a/tests/baselines/reference/thisTypeInFunctions2.symbols +++ b/tests/baselines/reference/thisTypeInFunctions2.symbols @@ -77,10 +77,12 @@ extend1({ >foo : Symbol(foo, Decl(thisTypeInFunctions2.ts, 26, 13)) this.url; // this: any because 'foo' matches the string indexer ->this : Symbol(this, Decl(thisTypeInFunctions2.ts, 4, 87)) +>this : Symbol(IndexedWithThis, Decl(thisTypeInFunctions2.ts, 0, 0)) this.willDestroy; ->this : Symbol(this, Decl(thisTypeInFunctions2.ts, 4, 87)) +>this.willDestroy : Symbol(IndexedWithThis.willDestroy, Decl(thisTypeInFunctions2.ts, 2, 32)) +>this : Symbol(IndexedWithThis, Decl(thisTypeInFunctions2.ts, 0, 0)) +>willDestroy : Symbol(IndexedWithThis.willDestroy, Decl(thisTypeInFunctions2.ts, 2, 32)) } }); extend2({ diff --git a/tests/baselines/reference/thisTypeInFunctions2.types b/tests/baselines/reference/thisTypeInFunctions2.types index e8df582332a..6e031c7ec1e 100644 --- a/tests/baselines/reference/thisTypeInFunctions2.types +++ b/tests/baselines/reference/thisTypeInFunctions2.types @@ -58,7 +58,7 @@ declare function simple(arg: SimpleInterface): void; extend1({ >extend1({ init() { this // this: IndexedWithThis because of contextual typing. // this.mine this.willDestroy }, mine: 12, foo() { this.url; // this: any because 'foo' matches the string indexer this.willDestroy; }}) : void >extend1 : (args: IndexedWithThis) => void ->{ init() { this // this: IndexedWithThis because of contextual typing. // this.mine this.willDestroy }, mine: 12, foo() { this.url; // this: any because 'foo' matches the string indexer this.willDestroy; }} : { init(this: IndexedWithThis): void; mine: number; foo(this: any): void; } +>{ init() { this // this: IndexedWithThis because of contextual typing. // this.mine this.willDestroy }, mine: 12, foo() { this.url; // this: any because 'foo' matches the string indexer this.willDestroy; }} : { init(this: IndexedWithThis): void; mine: number; foo(): void; } init() { >init : (this: IndexedWithThis) => void @@ -78,17 +78,17 @@ extend1({ >12 : 12 foo() { ->foo : (this: any) => void +>foo : () => void this.url; // this: any because 'foo' matches the string indexer ->this.url : any ->this : any ->url : any +>this.url : {} +>this : IndexedWithThis +>url : {} this.willDestroy; ->this.willDestroy : any ->this : any ->willDestroy : any +>this.willDestroy : (this: any) => void +>this : IndexedWithThis +>willDestroy : (this: any) => void } }); extend2({ diff --git a/tests/baselines/reference/tsxAttributeResolution15.errors.txt b/tests/baselines/reference/tsxAttributeResolution15.errors.txt index ecb389e7dfc..d0453a17268 100644 --- a/tests/baselines/reference/tsxAttributeResolution15.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution15.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(11,10): error TS2559: Type '{ prop1: string; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. +tests/cases/conformance/jsx/file.tsx(11,10): error TS2559: Type '{ prop1: string; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: {}; }'. ==== tests/cases/conformance/jsx/file.tsx (1 errors) ==== @@ -14,7 +14,7 @@ tests/cases/conformance/jsx/file.tsx(11,10): error TS2559: Type '{ prop1: string // Error let a = ~~~~~~~~~~ -!!! error TS2559: Type '{ prop1: string; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. +!!! error TS2559: Type '{ prop1: string; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: {}; }'. // OK let b = { this.textInput = input; }} /> diff --git a/tests/baselines/reference/tsxGenericAttributesType1.types b/tests/baselines/reference/tsxGenericAttributesType1.types index 50be358302e..ef9e8497998 100644 --- a/tests/baselines/reference/tsxGenericAttributesType1.types +++ b/tests/baselines/reference/tsxGenericAttributesType1.types @@ -15,11 +15,11 @@ const decorator = function (Component: React.StatelessComponent): React.St >T : T return (props) => ->(props) => : (props: T & { children?: React.ReactNode; }) => JSX.Element ->props : T & { children?: React.ReactNode; } +>(props) => : (props: T & { children?: {}; }) => JSX.Element +>props : T & { children?: {}; } > : JSX.Element >Component : React.StatelessComponent ->props : T & { children?: React.ReactNode; } +>props : T & { children?: {}; } >Component : React.StatelessComponent }; @@ -38,11 +38,11 @@ const decorator2 = function (Component: React.Stateless >T : T return (props) => ->(props) => : (props: T & { children?: React.ReactNode; }) => JSX.Element ->props : T & { children?: React.ReactNode; } +>(props) => : (props: T & { children?: {}; }) => JSX.Element +>props : T & { children?: {}; } > : JSX.Element >Component : React.StatelessComponent ->props : T & { children?: React.ReactNode; } +>props : T & { children?: {}; } >x : number >2 : 2 >Component : React.StatelessComponent @@ -65,13 +65,13 @@ const decorator3 = function ( >T : T return (props) => ->(props) => : (props: T & { children?: React.ReactNode; }) => JSX.Element ->props : T & { children?: React.ReactNode; } +>(props) => : (props: T & { children?: {}; }) => JSX.Element +>props : T & { children?: {}; } > : JSX.Element >Component : React.StatelessComponent >x : number >2 : 2 ->props : T & { children?: React.ReactNode; } +>props : T & { children?: {}; } >Component : React.StatelessComponent }; diff --git a/tests/baselines/reference/tsxGenericAttributesType2.errors.txt b/tests/baselines/reference/tsxGenericAttributesType2.errors.txt index cbd926c9b69..19b8643f100 100644 --- a/tests/baselines/reference/tsxGenericAttributesType2.errors.txt +++ b/tests/baselines/reference/tsxGenericAttributesType2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(4,45): error TS2339: Property 'y' does not exist on type 'IntrinsicAttributes & { x: number; } & { children?: ReactNode; }'. +tests/cases/conformance/jsx/file.tsx(4,45): error TS2339: Property 'y' does not exist on type 'IntrinsicAttributes & { x: number; } & { children?: {}; }'. ==== tests/cases/conformance/jsx/file.tsx (1 errors) ==== @@ -7,5 +7,5 @@ tests/cases/conformance/jsx/file.tsx(4,45): error TS2339: Property 'y' does not const decorator4 = function (Component: React.StatelessComponent): React.StatelessComponent { return (props) => ~~~~~~~~~~ -!!! error TS2339: Property 'y' does not exist on type 'IntrinsicAttributes & { x: number; } & { children?: ReactNode; }'. +!!! error TS2339: Property 'y' does not exist on type 'IntrinsicAttributes & { x: number; } & { children?: {}; }'. }; \ No newline at end of file diff --git a/tests/baselines/reference/tsxGenericAttributesType2.types b/tests/baselines/reference/tsxGenericAttributesType2.types index 19c2e2ce033..8e60e5e2f31 100644 --- a/tests/baselines/reference/tsxGenericAttributesType2.types +++ b/tests/baselines/reference/tsxGenericAttributesType2.types @@ -16,11 +16,11 @@ const decorator4 = function (Component: React.Stateless >T : T return (props) => ->(props) => : (props: T & { children?: React.ReactNode; }) => JSX.Element ->props : T & { children?: React.ReactNode; } +>(props) => : (props: T & { children?: {}; }) => JSX.Element +>props : T & { children?: {}; } > : JSX.Element >Component : React.StatelessComponent ->props : T & { children?: React.ReactNode; } +>props : T & { children?: {}; } >y : string >"blah" : "blah" >Component : React.StatelessComponent diff --git a/tests/baselines/reference/tsxGenericAttributesType3.types b/tests/baselines/reference/tsxGenericAttributesType3.types index 72674ac5bf7..d1f887e87b3 100644 --- a/tests/baselines/reference/tsxGenericAttributesType3.types +++ b/tests/baselines/reference/tsxGenericAttributesType3.types @@ -35,9 +35,9 @@ class B extends React.Component { return ; > : JSX.Element >B1 : typeof B1 ->this.props : U & { children?: React.ReactNode; } +>this.props : U & { children?: {}; } >this : this ->props : U & { children?: React.ReactNode; } +>props : U & { children?: {}; } >x : string } } diff --git a/tests/baselines/reference/tsxGenericAttributesType4.types b/tests/baselines/reference/tsxGenericAttributesType4.types index 874d77d8325..3761643ee8d 100644 --- a/tests/baselines/reference/tsxGenericAttributesType4.types +++ b/tests/baselines/reference/tsxGenericAttributesType4.types @@ -34,9 +34,9 @@ class B extends React.Component { return ; > : JSX.Element >B1 : typeof B1 ->this.props : U & { children?: React.ReactNode; } +>this.props : U & { children?: {}; } >this : this ->props : U & { children?: React.ReactNode; } +>props : U & { children?: {}; } >x : string } } diff --git a/tests/baselines/reference/tsxGenericAttributesType9.types b/tests/baselines/reference/tsxGenericAttributesType9.types index 2cc8a57bc5d..ac92750e95e 100644 --- a/tests/baselines/reference/tsxGenericAttributesType9.types +++ b/tests/baselines/reference/tsxGenericAttributesType9.types @@ -28,9 +28,9 @@ export function makeP

(Ctor: React.ComponentClass

) { > : JSX.Element >Ctor : React.ComponentClass

->this.props : P & { children?: React.ReactNode; } +>this.props : P & { children?: {}; } >this : this ->props : P & { children?: React.ReactNode; } +>props : P & { children?: {}; } ); } diff --git a/tests/baselines/reference/tsxReactComponentWithDefaultTypeParameter3.errors.txt b/tests/baselines/reference/tsxReactComponentWithDefaultTypeParameter3.errors.txt index 1403b284a0b..45c66bf296b 100644 --- a/tests/baselines/reference/tsxReactComponentWithDefaultTypeParameter3.errors.txt +++ b/tests/baselines/reference/tsxReactComponentWithDefaultTypeParameter3.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(13,11): error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes> & Prop & { children?: ReactNode; }'. +tests/cases/conformance/jsx/file.tsx(13,11): error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes> & Prop & { children?: {}; }'. Type '{}' is not assignable to type 'Prop'. Property 'a' is missing in type '{}'. tests/cases/conformance/jsx/file.tsx(19,18): error TS2326: Types of property 'a' are incompatible. @@ -20,7 +20,7 @@ tests/cases/conformance/jsx/file.tsx(19,18): error TS2326: Types of property 'a' // Error let x1 = ~~~~~~ -!!! error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes> & Prop & { children?: ReactNode; }'. +!!! error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes> & Prop & { children?: {}; }'. !!! error TS2322: Type '{}' is not assignable to type 'Prop'. !!! error TS2322: Property 'a' is missing in type '{}'. diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution12.errors.txt b/tests/baselines/reference/tsxSpreadAttributesResolution12.errors.txt index d40fb60ca1e..96b84810345 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution12.errors.txt +++ b/tests/baselines/reference/tsxSpreadAttributesResolution12.errors.txt @@ -2,7 +2,7 @@ tests/cases/conformance/jsx/file.tsx(27,33): error TS2326: Types of property 'y' Type 'true' is not assignable to type 'false'. tests/cases/conformance/jsx/file.tsx(28,50): error TS2326: Types of property 'x' are incompatible. Type '3' is not assignable to type '2'. -tests/cases/conformance/jsx/file.tsx(30,11): error TS2322: Type '{ y: true; x: 2; overwrite: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Prop & { children?: ReactNode; }'. +tests/cases/conformance/jsx/file.tsx(30,11): error TS2322: Type '{ y: true; x: 2; overwrite: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Prop & { children?: {}; }'. Type '{ y: true; x: 2; overwrite: string; }' is not assignable to type 'Prop'. Types of property 'y' are incompatible. Type 'true' is not assignable to type 'false'. @@ -46,7 +46,7 @@ tests/cases/conformance/jsx/file.tsx(30,11): error TS2322: Type '{ y: true; x: 2 let x2 = let x3 = ~~~~~~~~~~~~~ -!!! error TS2322: Type '{ y: true; x: 2; overwrite: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Prop & { children?: ReactNode; }'. +!!! error TS2322: Type '{ y: true; x: 2; overwrite: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Prop & { children?: {}; }'. !!! error TS2322: Type '{ y: true; x: 2; overwrite: string; }' is not assignable to type 'Prop'. !!! error TS2322: Types of property 'y' are incompatible. !!! error TS2322: Type 'true' is not assignable to type 'false'. diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution2.errors.txt b/tests/baselines/reference/tsxSpreadAttributesResolution2.errors.txt index 8026b7d629f..c7ff2040cdd 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution2.errors.txt +++ b/tests/baselines/reference/tsxSpreadAttributesResolution2.errors.txt @@ -1,18 +1,18 @@ -tests/cases/conformance/jsx/file.tsx(17,10): error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & PoisonedProp & { children?: ReactNode; }'. +tests/cases/conformance/jsx/file.tsx(17,10): error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & PoisonedProp & { children?: {}; }'. Type '{}' is not assignable to type 'PoisonedProp'. Property 'x' is missing in type '{}'. -tests/cases/conformance/jsx/file.tsx(18,10): error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & PoisonedProp & { children?: ReactNode; }'. +tests/cases/conformance/jsx/file.tsx(18,10): error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & PoisonedProp & { children?: {}; }'. Type '{}' is not assignable to type 'PoisonedProp'. Property 'x' is missing in type '{}'. tests/cases/conformance/jsx/file.tsx(19,19): error TS2326: Types of property 'x' are incompatible. Type 'true' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(19,21): error TS2326: Types of property 'y' are incompatible. Type 'true' is not assignable to type '"2"'. -tests/cases/conformance/jsx/file.tsx(20,10): error TS2322: Type '{ x: number; y: "2"; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & PoisonedProp & { children?: ReactNode; }'. +tests/cases/conformance/jsx/file.tsx(20,10): error TS2322: Type '{ x: number; y: "2"; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & PoisonedProp & { children?: {}; }'. Type '{ x: number; y: "2"; }' is not assignable to type 'PoisonedProp'. Types of property 'x' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(21,11): error TS2322: Type '{ X: string; x: number; y: "2"; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & PoisonedProp & { children?: ReactNode; }'. +tests/cases/conformance/jsx/file.tsx(21,11): error TS2322: Type '{ X: string; x: number; y: "2"; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & PoisonedProp & { children?: {}; }'. Type '{ X: string; x: number; y: "2"; }' is not assignable to type 'PoisonedProp'. Types of property 'x' are incompatible. Type 'number' is not assignable to type 'string'. @@ -37,12 +37,12 @@ tests/cases/conformance/jsx/file.tsx(21,11): error TS2322: Type '{ X: string; x: // Error let p = ; ~~~~~~~~ -!!! error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & PoisonedProp & { children?: ReactNode; }'. +!!! error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & PoisonedProp & { children?: {}; }'. !!! error TS2322: Type '{}' is not assignable to type 'PoisonedProp'. !!! error TS2322: Property 'x' is missing in type '{}'. let y = ; ~~~~~~~~ -!!! error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & PoisonedProp & { children?: ReactNode; }'. +!!! error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & PoisonedProp & { children?: {}; }'. !!! error TS2322: Type '{}' is not assignable to type 'PoisonedProp'. !!! error TS2322: Property 'x' is missing in type '{}'. let z = ; @@ -54,13 +54,13 @@ tests/cases/conformance/jsx/file.tsx(21,11): error TS2322: Type '{ X: string; x: !!! error TS2326: Type 'true' is not assignable to type '"2"'. let w = ; ~~~~~~~~ -!!! error TS2322: Type '{ x: number; y: "2"; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & PoisonedProp & { children?: ReactNode; }'. +!!! error TS2322: Type '{ x: number; y: "2"; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & PoisonedProp & { children?: {}; }'. !!! error TS2322: Type '{ x: number; y: "2"; }' is not assignable to type 'PoisonedProp'. !!! error TS2322: Types of property 'x' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. let w1 = ; ~~~~~~~~ -!!! error TS2322: Type '{ X: string; x: number; y: "2"; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & PoisonedProp & { children?: ReactNode; }'. +!!! error TS2322: Type '{ X: string; x: number; y: "2"; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & PoisonedProp & { children?: {}; }'. !!! error TS2322: Type '{ X: string; x: number; y: "2"; }' is not assignable to type 'PoisonedProp'. !!! error TS2322: Types of property 'x' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution5.errors.txt b/tests/baselines/reference/tsxSpreadAttributesResolution5.errors.txt index cb47c7196c2..d0df035bb9c 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution5.errors.txt +++ b/tests/baselines/reference/tsxSpreadAttributesResolution5.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/jsx/file.tsx(20,10): error TS2322: Type '{ x: string; y: number; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & PoisonedProp & { children?: ReactNode; }'. +tests/cases/conformance/jsx/file.tsx(20,10): error TS2322: Type '{ x: string; y: number; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & PoisonedProp & { children?: {}; }'. Type '{ x: string; y: number; }' is not assignable to type 'PoisonedProp'. Types of property 'y' are incompatible. Type 'number' is not assignable to type '2'. -tests/cases/conformance/jsx/file.tsx(33,10): error TS2559: Type '{ prop1: boolean; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. +tests/cases/conformance/jsx/file.tsx(33,10): error TS2559: Type '{ prop1: boolean; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: {}; }'. ==== tests/cases/conformance/jsx/file.tsx (2 errors) ==== @@ -27,7 +27,7 @@ tests/cases/conformance/jsx/file.tsx(33,10): error TS2559: Type '{ prop1: boolea // Error as "obj" has type { x: string; y: number } let p = ; ~~~~~~~~ -!!! error TS2322: Type '{ x: string; y: number; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & PoisonedProp & { children?: ReactNode; }'. +!!! error TS2322: Type '{ x: string; y: number; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & PoisonedProp & { children?: {}; }'. !!! error TS2322: Type '{ x: string; y: number; }' is not assignable to type 'PoisonedProp'. !!! error TS2322: Types of property 'y' are incompatible. !!! error TS2322: Type 'number' is not assignable to type '2'. @@ -45,4 +45,4 @@ tests/cases/conformance/jsx/file.tsx(33,10): error TS2559: Type '{ prop1: boolea // Ok let e = ; ~~~~~~~~~ -!!! error TS2559: Type '{ prop1: boolean; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. \ No newline at end of file +!!! error TS2559: Type '{ prop1: boolean; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: {}; }'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution6.errors.txt b/tests/baselines/reference/tsxSpreadAttributesResolution6.errors.txt index 586be36c850..263bb8866a2 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution6.errors.txt +++ b/tests/baselines/reference/tsxSpreadAttributesResolution6.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/jsx/file.tsx(13,10): error TS2322: Type '{ editable: true; }' is not assignable to type '(IntrinsicAttributes & IntrinsicClassAttributes & { editable: false; } & { children?: ReactNode; }) | (IntrinsicAttributes & IntrinsicClassAttributes & { editable: true; onEdit: (newText: string) => void; } & { children?: ReactNode; })'. - Type '{ editable: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & { editable: true; onEdit: (newText: string) => void; } & { children?: ReactNode; }'. +tests/cases/conformance/jsx/file.tsx(13,10): error TS2322: Type '{ editable: true; }' is not assignable to type '(IntrinsicAttributes & IntrinsicClassAttributes & { editable: false; } & { children?: {}; }) | (IntrinsicAttributes & IntrinsicClassAttributes & { editable: true; onEdit: (newText: string) => void; } & { children?: {}; })'. + Type '{ editable: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & { editable: true; onEdit: (newText: string) => void; } & { children?: {}; }'. Type '{ editable: true; }' is not assignable to type '{ editable: true; onEdit: (newText: string) => void; }'. Property 'onEdit' is missing in type '{ editable: true; }'. @@ -19,8 +19,8 @@ tests/cases/conformance/jsx/file.tsx(13,10): error TS2322: Type '{ editable: tru // Error let x = ~~~~~~~~~~~~~ -!!! error TS2322: Type '{ editable: true; }' is not assignable to type '(IntrinsicAttributes & IntrinsicClassAttributes & { editable: false; } & { children?: ReactNode; }) | (IntrinsicAttributes & IntrinsicClassAttributes & { editable: true; onEdit: (newText: string) => void; } & { children?: ReactNode; })'. -!!! error TS2322: Type '{ editable: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & { editable: true; onEdit: (newText: string) => void; } & { children?: ReactNode; }'. +!!! error TS2322: Type '{ editable: true; }' is not assignable to type '(IntrinsicAttributes & IntrinsicClassAttributes & { editable: false; } & { children?: {}; }) | (IntrinsicAttributes & IntrinsicClassAttributes & { editable: true; onEdit: (newText: string) => void; } & { children?: {}; })'. +!!! error TS2322: Type '{ editable: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & { editable: true; onEdit: (newText: string) => void; } & { children?: {}; }'. !!! error TS2322: Type '{ editable: true; }' is not assignable to type '{ editable: true; onEdit: (newText: string) => void; }'. !!! error TS2322: Property 'onEdit' is missing in type '{ editable: true; }'. diff --git a/tests/baselines/reference/tsxStatelessFunctionComponents3.types b/tests/baselines/reference/tsxStatelessFunctionComponents3.types index e01c8454aa7..73697a0dc72 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponents3.types +++ b/tests/baselines/reference/tsxStatelessFunctionComponents3.types @@ -21,8 +21,8 @@ var MainMenu: React.StatelessComponent<{}> = (props) => (

>MainMenu : React.StatelessComponent<{}> >React : any >StatelessComponent : React.StatelessComponent

->(props) => (

Main Menu

) : (props: { children?: React.ReactNode; }) => JSX.Element ->props : { children?: React.ReactNode; } +>(props) => (

Main Menu

) : (props: { children?: {}; }) => JSX.Element +>props : { children?: {}; } >(

Main Menu

) : JSX.Element >

Main Menu

: JSX.Element >div : any @@ -40,7 +40,7 @@ var App: React.StatelessComponent<{ children }> = ({children}) => ( >React : any >StatelessComponent : React.StatelessComponent

>children : any ->({children}) => (

) : ({ children }: { children: any; } & { children?: React.ReactNode; }) => JSX.Element +>({children}) => (
) : ({ children }: { children: any; } & { children?: {}; }) => JSX.Element >children : any >(
) : JSX.Element diff --git a/tests/baselines/reference/tsxTypeArgumentResolution.errors.txt b/tests/baselines/reference/tsxTypeArgumentResolution.errors.txt index 950d9549ba8..4cd3ed169f3 100644 --- a/tests/baselines/reference/tsxTypeArgumentResolution.errors.txt +++ b/tests/baselines/reference/tsxTypeArgumentResolution.errors.txt @@ -15,9 +15,9 @@ tests/cases/conformance/jsx/file.tsx(41,14): error TS2344: Type 'Prop' does not tests/cases/conformance/jsx/file.tsx(41,20): error TS2326: Types of property 'a' are incompatible. Type 'number' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(47,14): error TS2558: Expected 1-2 type arguments, but got 3. -tests/cases/conformance/jsx/file.tsx(47,53): error TS2339: Property 'b' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes> & { a: string; } & { children?: ReactNode; }'. +tests/cases/conformance/jsx/file.tsx(47,53): error TS2339: Property 'b' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes> & { a: string; } & { children?: {}; }'. tests/cases/conformance/jsx/file.tsx(49,14): error TS2558: Expected 1-2 type arguments, but got 3. -tests/cases/conformance/jsx/file.tsx(49,53): error TS2339: Property 'b' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes> & { a: string; } & { children?: ReactNode; }'. +tests/cases/conformance/jsx/file.tsx(49,53): error TS2339: Property 'b' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes> & { a: string; } & { children?: {}; }'. tests/cases/conformance/jsx/file.tsx(51,47): error TS2326: Types of property 'b' are incompatible. Type 'string' is not assignable to type 'number'. tests/cases/conformance/jsx/file.tsx(53,47): error TS2326: Types of property 'b' are incompatible. @@ -101,13 +101,13 @@ tests/cases/conformance/jsx/file.tsx(53,47): error TS2326: Types of property 'b' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2558: Expected 1-2 type arguments, but got 3. ~~~~~~ -!!! error TS2339: Property 'b' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes> & { a: string; } & { children?: ReactNode; }'. +!!! error TS2339: Property 'b' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes> & { a: string; } & { children?: {}; }'. x = a="hi" b="hi">; // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2558: Expected 1-2 type arguments, but got 3. ~~~~~~ -!!! error TS2339: Property 'b' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes> & { a: string; } & { children?: ReactNode; }'. +!!! error TS2339: Property 'b' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes> & { a: string; } & { children?: {}; }'. x = a="hi" b="hi" />; // error ~~~~~~ diff --git a/tests/baselines/reference/tsxUnionElementType4.errors.txt b/tests/baselines/reference/tsxUnionElementType4.errors.txt index 6bd8092d749..9852461c96a 100644 --- a/tests/baselines/reference/tsxUnionElementType4.errors.txt +++ b/tests/baselines/reference/tsxUnionElementType4.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/jsx/file.tsx(32,17): error TS2326: Types of property 'x' are incompatible. Type 'true' is not assignable to type 'ReactText'. -tests/cases/conformance/jsx/file.tsx(33,10): error TS2559: Type '{ x: number; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. -tests/cases/conformance/jsx/file.tsx(34,10): error TS2559: Type '{ prop: true; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. +tests/cases/conformance/jsx/file.tsx(33,10): error TS2559: Type '{ x: number; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: {}; }'. +tests/cases/conformance/jsx/file.tsx(34,10): error TS2559: Type '{ prop: true; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: {}; }'. ==== tests/cases/conformance/jsx/file.tsx (3 errors) ==== @@ -42,8 +42,8 @@ tests/cases/conformance/jsx/file.tsx(34,10): error TS2559: Type '{ prop: true; } !!! error TS2326: Type 'true' is not assignable to type 'ReactText'. let b = ~~~~~~~~~~ -!!! error TS2559: Type '{ x: number; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. +!!! error TS2559: Type '{ x: number; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: {}; }'. let c = ; ~~~~~~~~~~~ -!!! error TS2559: Type '{ prop: true; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. +!!! error TS2559: Type '{ prop: true; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: {}; }'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxUnionTypeComponent1.types b/tests/baselines/reference/tsxUnionTypeComponent1.types index 102972e0b5b..85ff3bed5a6 100644 --- a/tests/baselines/reference/tsxUnionTypeComponent1.types +++ b/tests/baselines/reference/tsxUnionTypeComponent1.types @@ -25,9 +25,9 @@ class MyComponent extends React.Component { const { AnyComponent } = this.props; >AnyComponent : React.StatelessComponent | React.ComponentClass ->this.props : ComponentProps & { children?: React.ReactNode; } +>this.props : ComponentProps & { children?: {}; } >this : this ->props : ComponentProps & { children?: React.ReactNode; } +>props : ComponentProps & { children?: {}; } return (); >() : JSX.Element diff --git a/tests/baselines/reference/tupleTypes.errors.txt b/tests/baselines/reference/tupleTypes.errors.txt index 16a8f66ba79..497778d739d 100644 --- a/tests/baselines/reference/tupleTypes.errors.txt +++ b/tests/baselines/reference/tupleTypes.errors.txt @@ -16,9 +16,8 @@ tests/cases/compiler/tupleTypes.ts(47,1): error TS2322: Type '[number, string]' Type 'string' is not assignable to type 'number'. tests/cases/compiler/tupleTypes.ts(49,1): error TS2322: Type '[number, {}]' is not assignable to type 'number[]'. Types of property 'pop' are incompatible. - Type '() => number | {}' is not assignable to type '() => number'. - Type 'number | {}' is not assignable to type 'number'. - Type '{}' is not assignable to type 'number'. + Type '() => {}' is not assignable to type '() => number'. + Type '{}' is not assignable to type 'number'. tests/cases/compiler/tupleTypes.ts(50,1): error TS2322: Type '[number, number]' is not assignable to type '[number, string]'. Type 'number' is not assignable to type 'string'. tests/cases/compiler/tupleTypes.ts(51,1): error TS2322: Type '[number, {}]' is not assignable to type '[number, string]'. @@ -101,9 +100,8 @@ tests/cases/compiler/tupleTypes.ts(51,1): error TS2322: Type '[number, {}]' is n ~ !!! error TS2322: Type '[number, {}]' is not assignable to type 'number[]'. !!! error TS2322: Types of property 'pop' are incompatible. -!!! error TS2322: Type '() => number | {}' is not assignable to type '() => number'. -!!! error TS2322: Type 'number | {}' is not assignable to type 'number'. -!!! error TS2322: Type '{}' is not assignable to type 'number'. +!!! error TS2322: Type '() => {}' is not assignable to type '() => number'. +!!! error TS2322: Type '{}' is not assignable to type 'number'. a1 = a2; // Error ~~ !!! error TS2322: Type '[number, number]' is not assignable to type '[number, string]'. diff --git a/tests/baselines/reference/usePromiseFinally.types b/tests/baselines/reference/usePromiseFinally.types index 80534c75610..7a8bb97d0f1 100644 --- a/tests/baselines/reference/usePromiseFinally.types +++ b/tests/baselines/reference/usePromiseFinally.types @@ -5,8 +5,8 @@ let promise1 = new Promise(function(resolve, reject) {}) >new Promise(function(resolve, reject) {}) .finally : (onfinally?: () => void) => Promise<{}> >new Promise(function(resolve, reject) {}) : Promise<{}> >Promise : PromiseConstructor ->function(resolve, reject) {} : (resolve: (value?: {} | PromiseLike<{}>) => void, reject: (reason?: any) => void) => void ->resolve : (value?: {} | PromiseLike<{}>) => void +>function(resolve, reject) {} : (resolve: (value?: {}) => void, reject: (reason?: any) => void) => void +>resolve : (value?: {}) => void >reject : (reason?: any) => void .finally(function() {});