Accept new baselines

This commit is contained in:
Anders Hejlsberg
2018-05-24 12:49:20 -07:00
parent bac117d64d
commit 9e362b949e
43 changed files with 168 additions and 197 deletions
@@ -23,7 +23,7 @@ interface IAsyncEnumerator<T> {
>AsyncEnumeratorDone : AsyncEnumeratorDone
next3(): Promise<T | {}>;
>next3 : () => Promise<{} | T>
>next3 : () => Promise<{}>
>Promise : Promise<T>
>T : T
@@ -59,12 +59,12 @@ async function main() {
>next2 : () => Promise<AsyncEnumeratorDone> | Promise<number>
let c = await x.next3();
>c : number | {}
>await x.next3() : number | {}
>x.next3() : Promise<number | {}>
>x.next3 : () => Promise<number | {}>
>c : {}
>await x.next3() : {}
>x.next3() : Promise<{}>
>x.next3 : () => Promise<{}>
>x : IAsyncEnumerator<number>
>next3 : () => Promise<number | {}>
>next3 : () => Promise<{}>
let d = await x.next4();
>d : number | { x: string; }
@@ -35,18 +35,18 @@ class Button extends React.Component<ButtonProp, any> {
return <InnerButton {...this.props} />
><InnerButton {...this.props} /> : 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 (<InnerButton {...this.props} >
>(<InnerButton {...this.props} > <div>Hello World</div> </InnerButton>) : JSX.Element
><InnerButton {...this.props} > <div>Hello World</div> </InnerButton> : 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?: {}; }
<div>Hello World</div>
><div>Hello World</div> : JSX.Element
@@ -31,9 +31,9 @@ class Button extends React.Component<ButtonProp, any> {
>(<InnerButton {...this.props} children="hi"> <div>Hello World</div> </InnerButton>) : JSX.Element
><InnerButton {...this.props} children="hi"> <div>Hello World</div> </InnerButton> : 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
<div>Hello World</div>
@@ -38,11 +38,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) & true) | (((user: IUser) => JSX.Element) & false) | (((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.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<any>) | (((user: IUser) => JSX.Element) & (string | number | boolean | any[] | React.ReactElement<any>)[])
>props : IFetchUserProps & { children?: {}; }
>children : (user: IUser) => JSX.Element
>this.state.result : any
>this.state : any
>this : this
@@ -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<FetchUser> & 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<FetchUser> & 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 (
<FetchUser>
~~~~~~~~~
!!! error TS2322: Type '{ children: ((user: IUser) => Element)[]; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<FetchUser> & IFetchUserProps & { children?: ReactNode; }'.
!!! error TS2322: Type '{ children: ((user: IUser) => Element)[]; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<FetchUser> & 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'.
@@ -38,11 +38,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) & true) | (((user: IUser) => JSX.Element) & false) | (((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.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<any>) | (((user: IUser) => JSX.Element) & (string | number | boolean | any[] | React.ReactElement<any>)[])
>props : IFetchUserProps & { children?: {}; }
>children : (user: IUser) => JSX.Element
>this.state.result : any
>this.state : any
>this : this
@@ -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'.
}
@@ -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, --, --))
}
@@ -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
}
@@ -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;
@@ -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;
@@ -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.
@@ -9,7 +9,7 @@ class A<T extends Object>{
>T : T
}
var a = new A();
>a : A<{}>
>new A() : A<{}>
>a : A<Object>
>new A() : A<Object>
>A : typeof A
@@ -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, U extends T>(t: T) => U
>null : null
var r3 = foo(new Object()); // {}
>r3 : {}
>foo(new Object()) : {}
>r3 : Object
>foo(new Object()) : Object
>foo : <T, U extends T>(t: T) => U
>new Object() : Object
>Object : ObjectConstructor
@@ -1004,7 +1004,7 @@ declare function f11<T, U = T | B>(a?: T, b?: U): [T, U];
// inference
f11();
>f11() : [{}, {} | B]
>f11() : [{}, {}]
>f11 : <T, U = B | T>(a?: T, b?: U) => [T, U]
f11(a);
@@ -1607,7 +1607,7 @@ declare function f17<T = U, U = T | B>(a?: T, b?: U): [T, U];
// inference
f17();
>f17() : [{}, {} | B]
>f17() : [{}, {}]
>f17 : <T = U, U = B | T>(a?: T, b?: U) => [T, U]
f17(a);
@@ -1702,11 +1702,11 @@ declare function f18<T, U = V, V = U | C>(a?: T, b?: U, c?: V): [T, U, V];
// inference
f18();
>f18() : [{}, {}, {} | C]
>f18() : [{}, {}, {}]
>f18 : <T, U = V, V = C | U>(a?: T, b?: U, c?: V) => [T, U, V]
f18(a);
>f18(a) : [A, {}, {} | C]
>f18(a) : [A, {}, {}]
>f18 : <T, U = V, V = C | U>(a?: T, b?: U, c?: V) => [T, U, V]
>a : A
@@ -1732,25 +1732,25 @@ f18(a, b, c);
// no inference, partially supplied
f18<A>();
>f18<A>() : [A, {}, {} | C]
>f18<A>() : [A, {}, {}]
>f18 : <T, U = V, V = C | U>(a?: T, b?: U, c?: V) => [T, U, V]
>A : A
f18<A>(a);
>f18<A>(a) : [A, {}, {} | C]
>f18<A>(a) : [A, {}, {}]
>f18 : <T, U = V, V = C | U>(a?: T, b?: U, c?: V) => [T, U, V]
>A : A
>a : A
f18<A>(a, b);
>f18<A>(a, b) : [A, {}, {} | C]
>f18<A>(a, b) : [A, {}, {}]
>f18 : <T, U = V, V = C | U>(a?: T, b?: U, c?: V) => [T, U, V]
>A : A
>a : A
>b : B
f18<A>(a, b, b);
>f18<A>(a, b, b) : [A, {}, {} | C]
>f18<A>(a, b, b) : [A, {}, {}]
>f18 : <T, U = V, V = C | U>(a?: T, b?: U, c?: V) => [T, U, V]
>A : A
>a : A
@@ -1758,7 +1758,7 @@ f18<A>(a, b, b);
>b : B
f18<A>(a, b, c);
>f18<A>(a, b, c) : [A, {}, {} | C]
>f18<A>(a, b, c) : [A, {}, {}]
>f18 : <T, U = V, V = C | U>(a?: T, b?: U, c?: V) => [T, U, V]
>A : A
>a : A
@@ -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
}
@@ -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
});
@@ -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
}
@@ -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
}
@@ -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
}
+3 -3
View File
@@ -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; }
@@ -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 '{}'.
+11 -11
View File
@@ -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
@@ -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({
@@ -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({
@@ -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<BigGreeter> & { children?: ReactNode; }'.
tests/cases/conformance/jsx/file.tsx(11,10): error TS2559: Type '{ prop1: string; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<BigGreeter> & { 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 = <BigGreeter prop1="hello" />
~~~~~~~~~~
!!! error TS2559: Type '{ prop1: string; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<BigGreeter> & { children?: ReactNode; }'.
!!! error TS2559: Type '{ prop1: string; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<BigGreeter> & { children?: {}; }'.
// OK
let b = <BigGreeter ref={(input) => { this.textInput = input; }} />
@@ -15,11 +15,11 @@ const decorator = function <T>(Component: React.StatelessComponent<T>): React.St
>T : T
return (props) => <Component {...props}></Component>
>(props) => <Component {...props}></Component> : (props: T & { children?: React.ReactNode; }) => JSX.Element
>props : T & { children?: React.ReactNode; }
>(props) => <Component {...props}></Component> : (props: T & { children?: {}; }) => JSX.Element
>props : T & { children?: {}; }
><Component {...props}></Component> : JSX.Element
>Component : React.StatelessComponent<T>
>props : T & { children?: React.ReactNode; }
>props : T & { children?: {}; }
>Component : React.StatelessComponent<T>
};
@@ -38,11 +38,11 @@ const decorator2 = function <T extends { x: number }>(Component: React.Stateless
>T : T
return (props) => <Component {...props} x={2} ></Component>
>(props) => <Component {...props} x={2} ></Component> : (props: T & { children?: React.ReactNode; }) => JSX.Element
>props : T & { children?: React.ReactNode; }
>(props) => <Component {...props} x={2} ></Component> : (props: T & { children?: {}; }) => JSX.Element
>props : T & { children?: {}; }
><Component {...props} x={2} ></Component> : JSX.Element
>Component : React.StatelessComponent<T>
>props : T & { children?: React.ReactNode; }
>props : T & { children?: {}; }
>x : number
>2 : 2
>Component : React.StatelessComponent<T>
@@ -65,13 +65,13 @@ const decorator3 = function <T extends { x: number }, U extends { x: number } >(
>T : T
return (props) => <Component x={2} {...props} ></Component>
>(props) => <Component x={2} {...props} ></Component> : (props: T & { children?: React.ReactNode; }) => JSX.Element
>props : T & { children?: React.ReactNode; }
>(props) => <Component x={2} {...props} ></Component> : (props: T & { children?: {}; }) => JSX.Element
>props : T & { children?: {}; }
><Component x={2} {...props} ></Component> : JSX.Element
>Component : React.StatelessComponent<T>
>x : number
>2 : 2
>props : T & { children?: React.ReactNode; }
>props : T & { children?: {}; }
>Component : React.StatelessComponent<T>
};
@@ -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 <T extends { x: number }>(Component: React.StatelessComponent<T>): React.StatelessComponent<T> {
return (props) => <Component {...props} y={"blah"} ></Component>
~~~~~~~~~~
!!! 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?: {}; }'.
};
@@ -16,11 +16,11 @@ const decorator4 = function <T extends { x: number }>(Component: React.Stateless
>T : T
return (props) => <Component {...props} y={"blah"} ></Component>
>(props) => <Component {...props} y={"blah"} ></Component> : (props: T & { children?: React.ReactNode; }) => JSX.Element
>props : T & { children?: React.ReactNode; }
>(props) => <Component {...props} y={"blah"} ></Component> : (props: T & { children?: {}; }) => JSX.Element
>props : T & { children?: {}; }
><Component {...props} y={"blah"} ></Component> : JSX.Element
>Component : React.StatelessComponent<T>
>props : T & { children?: React.ReactNode; }
>props : T & { children?: {}; }
>y : string
>"blah" : "blah"
>Component : React.StatelessComponent<T>
@@ -35,9 +35,9 @@ class B<U> extends React.Component<U, {}> {
return <B1 {...this.props} x="hi" />;
><B1 {...this.props} x="hi" /> : 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
}
}
@@ -34,9 +34,9 @@ class B<U> extends React.Component<U, {}> {
return <B1 {...this.props} x="hi" />;
><B1 {...this.props} x="hi" /> : 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
}
}
@@ -28,9 +28,9 @@ export function makeP<P>(Ctor: React.ComponentClass<P>) {
<Ctor {...this.props } />
><Ctor {...this.props } /> : JSX.Element
>Ctor : React.ComponentClass<P>
>this.props : P & { children?: React.ReactNode; }
>this.props : P & { children?: {}; }
>this : this
>props : P & { children?: React.ReactNode; }
>props : P & { children?: {}; }
);
}
@@ -1,4 +1,4 @@
tests/cases/conformance/jsx/file.tsx(13,11): error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<MyComp<Prop>> & Prop & { children?: ReactNode; }'.
tests/cases/conformance/jsx/file.tsx(13,11): error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<MyComp<Prop>> & 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 = <MyComp />
~~~~~~
!!! error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<MyComp<Prop>> & Prop & { children?: ReactNode; }'.
!!! error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<MyComp<Prop>> & Prop & { children?: {}; }'.
!!! error TS2322: Type '{}' is not assignable to type 'Prop'.
!!! error TS2322: Property 'a' is missing in type '{}'.
@@ -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<OverWriteAttr> & 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<OverWriteAttr> & 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 = <OverWriteAttr {...anyobj} x={3} />
let x3 = <OverWriteAttr overwrite="hi" {...obj1} {...{y: true}} />
~~~~~~~~~~~~~
!!! error TS2322: Type '{ y: true; x: 2; overwrite: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<OverWriteAttr> & Prop & { children?: ReactNode; }'.
!!! error TS2322: Type '{ y: true; x: 2; overwrite: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<OverWriteAttr> & 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'.
@@ -1,18 +1,18 @@
tests/cases/conformance/jsx/file.tsx(17,10): error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & PoisonedProp & { children?: ReactNode; }'.
tests/cases/conformance/jsx/file.tsx(17,10): error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & 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<Poisoned> & PoisonedProp & { children?: ReactNode; }'.
tests/cases/conformance/jsx/file.tsx(18,10): error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & 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<Poisoned> & 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<Poisoned> & 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<Poisoned> & 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<Poisoned> & 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 = <Poisoned {...obj} />;
~~~~~~~~
!!! error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & PoisonedProp & { children?: ReactNode; }'.
!!! error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & PoisonedProp & { children?: {}; }'.
!!! error TS2322: Type '{}' is not assignable to type 'PoisonedProp'.
!!! error TS2322: Property 'x' is missing in type '{}'.
let y = <Poisoned />;
~~~~~~~~
!!! error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & PoisonedProp & { children?: ReactNode; }'.
!!! error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & PoisonedProp & { children?: {}; }'.
!!! error TS2322: Type '{}' is not assignable to type 'PoisonedProp'.
!!! error TS2322: Property 'x' is missing in type '{}'.
let z = <Poisoned x y/>;
@@ -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 = <Poisoned {...{x: 5, y: "2"}}/>;
~~~~~~~~
!!! error TS2322: Type '{ x: number; y: "2"; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & PoisonedProp & { children?: ReactNode; }'.
!!! error TS2322: Type '{ x: number; y: "2"; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & 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 = <Poisoned {...{x: 5, y: "2"}} X="hi" />;
~~~~~~~~
!!! error TS2322: Type '{ X: string; x: number; y: "2"; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & PoisonedProp & { children?: ReactNode; }'.
!!! error TS2322: Type '{ X: string; x: number; y: "2"; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & 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'.
@@ -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<Poisoned> & 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<Poisoned> & 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<EmptyProp> & { children?: ReactNode; }'.
tests/cases/conformance/jsx/file.tsx(33,10): error TS2559: Type '{ prop1: boolean; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<EmptyProp> & { 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 = <Poisoned {...obj} />;
~~~~~~~~
!!! error TS2322: Type '{ x: string; y: number; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & PoisonedProp & { children?: ReactNode; }'.
!!! error TS2322: Type '{ x: string; y: number; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & 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 = <EmptyProp {...o} />;
~~~~~~~~~
!!! error TS2559: Type '{ prop1: boolean; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<EmptyProp> & { children?: ReactNode; }'.
!!! error TS2559: Type '{ prop1: boolean; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<EmptyProp> & { children?: {}; }'.
@@ -1,5 +1,5 @@
tests/cases/conformance/jsx/file.tsx(13,10): error TS2322: Type '{ editable: true; }' is not assignable to type '(IntrinsicAttributes & IntrinsicClassAttributes<TextComponent> & { editable: false; } & { children?: ReactNode; }) | (IntrinsicAttributes & IntrinsicClassAttributes<TextComponent> & { editable: true; onEdit: (newText: string) => void; } & { children?: ReactNode; })'.
Type '{ editable: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<TextComponent> & { 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<TextComponent> & { editable: false; } & { children?: {}; }) | (IntrinsicAttributes & IntrinsicClassAttributes<TextComponent> & { editable: true; onEdit: (newText: string) => void; } & { children?: {}; })'.
Type '{ editable: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<TextComponent> & { 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 = <TextComponent editable={true} />
~~~~~~~~~~~~~
!!! error TS2322: Type '{ editable: true; }' is not assignable to type '(IntrinsicAttributes & IntrinsicClassAttributes<TextComponent> & { editable: false; } & { children?: ReactNode; }) | (IntrinsicAttributes & IntrinsicClassAttributes<TextComponent> & { editable: true; onEdit: (newText: string) => void; } & { children?: ReactNode; })'.
!!! error TS2322: Type '{ editable: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<TextComponent> & { editable: true; onEdit: (newText: string) => void; } & { children?: ReactNode; }'.
!!! error TS2322: Type '{ editable: true; }' is not assignable to type '(IntrinsicAttributes & IntrinsicClassAttributes<TextComponent> & { editable: false; } & { children?: {}; }) | (IntrinsicAttributes & IntrinsicClassAttributes<TextComponent> & { editable: true; onEdit: (newText: string) => void; } & { children?: {}; })'.
!!! error TS2322: Type '{ editable: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<TextComponent> & { 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; }'.
@@ -21,8 +21,8 @@ var MainMenu: React.StatelessComponent<{}> = (props) => (<div>
>MainMenu : React.StatelessComponent<{}>
>React : any
>StatelessComponent : React.StatelessComponent<P>
>(props) => (<div> <h3>Main Menu</h3></div>) : (props: { children?: React.ReactNode; }) => JSX.Element
>props : { children?: React.ReactNode; }
>(props) => (<div> <h3>Main Menu</h3></div>) : (props: { children?: {}; }) => JSX.Element
>props : { children?: {}; }
>(<div> <h3>Main Menu</h3></div>) : JSX.Element
><div> <h3>Main Menu</h3></div> : JSX.Element
>div : any
@@ -40,7 +40,7 @@ var App: React.StatelessComponent<{ children }> = ({children}) => (
>React : any
>StatelessComponent : React.StatelessComponent<P>
>children : any
>({children}) => ( <div > <MainMenu/> </div>) : ({ children }: { children: any; } & { children?: React.ReactNode; }) => JSX.Element
>({children}) => ( <div > <MainMenu/> </div>) : ({ children }: { children: any; } & { children?: {}; }) => JSX.Element
>children : any
>( <div > <MainMenu/> </div>) : JSX.Element
@@ -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<MyComp2<{ a: string; }, {}>> & { a: string; } & { children?: ReactNode; }'.
tests/cases/conformance/jsx/file.tsx(47,53): error TS2339: Property 'b' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<MyComp2<{ a: string; }, {}>> & { 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<MyComp2<{ a: string; }, {}>> & { a: string; } & { children?: ReactNode; }'.
tests/cases/conformance/jsx/file.tsx(49,53): error TS2339: Property 'b' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<MyComp2<{ a: string; }, {}>> & { 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<MyComp2<{ a: string; }, {}>> & { a: string; } & { children?: ReactNode; }'.
!!! error TS2339: Property 'b' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<MyComp2<{ a: string; }, {}>> & { a: string; } & { children?: {}; }'.
x = <MyComp2<{a: string}, {b: string}, Prop> a="hi" b="hi"></MyComp2>; // error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2558: Expected 1-2 type arguments, but got 3.
~~~~~~
!!! error TS2339: Property 'b' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<MyComp2<{ a: string; }, {}>> & { a: string; } & { children?: ReactNode; }'.
!!! error TS2339: Property 'b' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<MyComp2<{ a: string; }, {}>> & { a: string; } & { children?: {}; }'.
x = <MyComp2<{a: string}, {b: number}> a="hi" b="hi" />; // error
~~~~~~
@@ -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<RC4> & { children?: ReactNode; }'.
tests/cases/conformance/jsx/file.tsx(34,10): error TS2559: Type '{ prop: true; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<RC3> & { children?: ReactNode; }'.
tests/cases/conformance/jsx/file.tsx(33,10): error TS2559: Type '{ x: number; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<RC4> & { children?: {}; }'.
tests/cases/conformance/jsx/file.tsx(34,10): error TS2559: Type '{ prop: true; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<RC3> & { 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 = <PartRCComp x={10} />
~~~~~~~~~~
!!! error TS2559: Type '{ x: number; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<RC4> & { children?: ReactNode; }'.
!!! error TS2559: Type '{ x: number; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<RC4> & { children?: {}; }'.
let c = <EmptyRCComp prop />;
~~~~~~~~~~~
!!! error TS2559: Type '{ prop: true; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<RC3> & { children?: ReactNode; }'.
!!! error TS2559: Type '{ prop: true; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<RC3> & { children?: {}; }'.
@@ -25,9 +25,9 @@ class MyComponent extends React.Component<ComponentProps, {}> {
const { AnyComponent } = this.props;
>AnyComponent : React.StatelessComponent<any> | React.ComponentClass<any>
>this.props : ComponentProps & { children?: React.ReactNode; }
>this.props : ComponentProps & { children?: {}; }
>this : this
>props : ComponentProps & { children?: React.ReactNode; }
>props : ComponentProps & { children?: {}; }
return (<AnyComponent />);
>(<AnyComponent />) : JSX.Element
@@ -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]'.
@@ -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() {});