diff --git a/tests/baselines/reference/asyncFunctionDeclaration10_es2017.errors.txt b/tests/baselines/reference/asyncFunctionDeclaration10_es2017.errors.txt index 33cd913a2eb..12f9974484b 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration10_es2017.errors.txt +++ b/tests/baselines/reference/asyncFunctionDeclaration10_es2017.errors.txt @@ -4,11 +4,12 @@ tests/cases/conformance/async/es2017/functionDeclarations/asyncFunctionDeclarati tests/cases/conformance/async/es2017/functionDeclarations/asyncFunctionDeclaration10_es2017.ts(1,33): error TS2304: Cannot find name 'await'. tests/cases/conformance/async/es2017/functionDeclarations/asyncFunctionDeclaration10_es2017.ts(1,38): error TS1005: ';' expected. tests/cases/conformance/async/es2017/functionDeclarations/asyncFunctionDeclaration10_es2017.ts(1,39): error TS1128: Declaration or statement expected. +tests/cases/conformance/async/es2017/functionDeclarations/asyncFunctionDeclaration10_es2017.ts(1,41): error TS2365: Operator '>' cannot be applied to types 'boolean' and '{}'. tests/cases/conformance/async/es2017/functionDeclarations/asyncFunctionDeclaration10_es2017.ts(1,49): error TS2532: Object is possibly 'undefined'. tests/cases/conformance/async/es2017/functionDeclarations/asyncFunctionDeclaration10_es2017.ts(1,53): error TS1109: Expression expected. -==== tests/cases/conformance/async/es2017/functionDeclarations/asyncFunctionDeclaration10_es2017.ts (8 errors) ==== +==== tests/cases/conformance/async/es2017/functionDeclarations/asyncFunctionDeclaration10_es2017.ts (9 errors) ==== async function foo(a = await => await): Promise { ~~~~~~~~~ !!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. @@ -22,8 +23,11 @@ tests/cases/conformance/async/es2017/functionDeclarations/asyncFunctionDeclarati !!! error TS1005: ';' expected. ~ !!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~ ~~~~ !!! error TS2532: Object is possibly 'undefined'. ~ !!! error TS1109: Expression expected. - } \ No newline at end of file + } + ~ +!!! error TS2365: Operator '>' cannot be applied to types 'boolean' and '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/asyncFunctionDeclaration10_es5.errors.txt b/tests/baselines/reference/asyncFunctionDeclaration10_es5.errors.txt index b974eacd882..155119784ba 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration10_es5.errors.txt +++ b/tests/baselines/reference/asyncFunctionDeclaration10_es5.errors.txt @@ -4,11 +4,12 @@ tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration1 tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration10_es5.ts(1,33): error TS2304: Cannot find name 'await'. tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration10_es5.ts(1,38): error TS1005: ';' expected. tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration10_es5.ts(1,39): error TS1128: Declaration or statement expected. +tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration10_es5.ts(1,41): error TS2365: Operator '>' cannot be applied to types 'boolean' and '{}'. tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration10_es5.ts(1,49): error TS2532: Object is possibly 'undefined'. tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration10_es5.ts(1,53): error TS1109: Expression expected. -==== tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration10_es5.ts (8 errors) ==== +==== tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration10_es5.ts (9 errors) ==== async function foo(a = await => await): Promise { ~~~~~~~~~ !!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. @@ -22,8 +23,11 @@ tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration1 !!! error TS1005: ';' expected. ~ !!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~ ~~~~ !!! error TS2532: Object is possibly 'undefined'. ~ !!! error TS1109: Expression expected. - } \ No newline at end of file + } + ~ +!!! error TS2365: Operator '>' cannot be applied to types 'boolean' and '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/asyncFunctionDeclaration10_es6.errors.txt b/tests/baselines/reference/asyncFunctionDeclaration10_es6.errors.txt index b752ec94a45..7f5266f931e 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration10_es6.errors.txt +++ b/tests/baselines/reference/asyncFunctionDeclaration10_es6.errors.txt @@ -4,11 +4,12 @@ tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration1 tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration10_es6.ts(1,33): error TS2304: Cannot find name 'await'. tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration10_es6.ts(1,38): error TS1005: ';' expected. tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration10_es6.ts(1,39): error TS1128: Declaration or statement expected. +tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration10_es6.ts(1,41): error TS2365: Operator '>' cannot be applied to types 'boolean' and '{}'. tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration10_es6.ts(1,49): error TS2532: Object is possibly 'undefined'. tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration10_es6.ts(1,53): error TS1109: Expression expected. -==== tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration10_es6.ts (8 errors) ==== +==== tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration10_es6.ts (9 errors) ==== async function foo(a = await => await): Promise { ~~~~~~~~~ !!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. @@ -22,8 +23,11 @@ tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration1 !!! error TS1005: ';' expected. ~ !!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~ ~~~~ !!! error TS2532: Object is possibly 'undefined'. ~ !!! error TS1109: Expression expected. - } \ No newline at end of file + } + ~ +!!! error TS2365: Operator '>' cannot be applied to types 'boolean' and '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/asyncFunctionDeclaration5_es2017.errors.txt b/tests/baselines/reference/asyncFunctionDeclaration5_es2017.errors.txt index 1fc74dfa0a2..2d110f68127 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration5_es2017.errors.txt +++ b/tests/baselines/reference/asyncFunctionDeclaration5_es2017.errors.txt @@ -2,11 +2,12 @@ tests/cases/conformance/async/es2017/functionDeclarations/asyncFunctionDeclarati tests/cases/conformance/async/es2017/functionDeclarations/asyncFunctionDeclaration5_es2017.ts(1,20): error TS2304: Cannot find name 'await'. tests/cases/conformance/async/es2017/functionDeclarations/asyncFunctionDeclaration5_es2017.ts(1,25): error TS1005: ';' expected. tests/cases/conformance/async/es2017/functionDeclarations/asyncFunctionDeclaration5_es2017.ts(1,26): error TS1128: Declaration or statement expected. +tests/cases/conformance/async/es2017/functionDeclarations/asyncFunctionDeclaration5_es2017.ts(1,28): error TS2365: Operator '>' cannot be applied to types 'boolean' and '{}'. tests/cases/conformance/async/es2017/functionDeclarations/asyncFunctionDeclaration5_es2017.ts(1,36): error TS2532: Object is possibly 'undefined'. tests/cases/conformance/async/es2017/functionDeclarations/asyncFunctionDeclaration5_es2017.ts(1,40): error TS1109: Expression expected. -==== tests/cases/conformance/async/es2017/functionDeclarations/asyncFunctionDeclaration5_es2017.ts (6 errors) ==== +==== tests/cases/conformance/async/es2017/functionDeclarations/asyncFunctionDeclaration5_es2017.ts (7 errors) ==== async function foo(await): Promise { ~~~~~ !!! error TS1138: Parameter declaration expected. @@ -16,8 +17,11 @@ tests/cases/conformance/async/es2017/functionDeclarations/asyncFunctionDeclarati !!! error TS1005: ';' expected. ~ !!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~ ~~~~ !!! error TS2532: Object is possibly 'undefined'. ~ !!! error TS1109: Expression expected. - } \ No newline at end of file + } + ~ +!!! error TS2365: Operator '>' cannot be applied to types 'boolean' and '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/asyncFunctionDeclaration5_es5.errors.txt b/tests/baselines/reference/asyncFunctionDeclaration5_es5.errors.txt index 48299773218..6607ec7ff5c 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration5_es5.errors.txt +++ b/tests/baselines/reference/asyncFunctionDeclaration5_es5.errors.txt @@ -2,11 +2,12 @@ tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration5 tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration5_es5.ts(1,20): error TS2304: Cannot find name 'await'. tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration5_es5.ts(1,25): error TS1005: ';' expected. tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration5_es5.ts(1,26): error TS1128: Declaration or statement expected. +tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration5_es5.ts(1,28): error TS2365: Operator '>' cannot be applied to types 'boolean' and '{}'. tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration5_es5.ts(1,36): error TS2532: Object is possibly 'undefined'. tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration5_es5.ts(1,40): error TS1109: Expression expected. -==== tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration5_es5.ts (6 errors) ==== +==== tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration5_es5.ts (7 errors) ==== async function foo(await): Promise { ~~~~~ !!! error TS1138: Parameter declaration expected. @@ -16,8 +17,11 @@ tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration5 !!! error TS1005: ';' expected. ~ !!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~ ~~~~ !!! error TS2532: Object is possibly 'undefined'. ~ !!! error TS1109: Expression expected. - } \ No newline at end of file + } + ~ +!!! error TS2365: Operator '>' cannot be applied to types 'boolean' and '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/asyncFunctionDeclaration5_es6.errors.txt b/tests/baselines/reference/asyncFunctionDeclaration5_es6.errors.txt index 2e907d13400..ccddf6d5c04 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration5_es6.errors.txt +++ b/tests/baselines/reference/asyncFunctionDeclaration5_es6.errors.txt @@ -2,11 +2,12 @@ tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration5 tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration5_es6.ts(1,20): error TS2304: Cannot find name 'await'. tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration5_es6.ts(1,25): error TS1005: ';' expected. tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration5_es6.ts(1,26): error TS1128: Declaration or statement expected. +tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration5_es6.ts(1,28): error TS2365: Operator '>' cannot be applied to types 'boolean' and '{}'. tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration5_es6.ts(1,36): error TS2532: Object is possibly 'undefined'. tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration5_es6.ts(1,40): error TS1109: Expression expected. -==== tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration5_es6.ts (6 errors) ==== +==== tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration5_es6.ts (7 errors) ==== async function foo(await): Promise { ~~~~~ !!! error TS1138: Parameter declaration expected. @@ -16,8 +17,11 @@ tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration5 !!! error TS1005: ';' expected. ~ !!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~ ~~~~ !!! error TS2532: Object is possibly 'undefined'. ~ !!! error TS1109: Expression expected. - } \ No newline at end of file + } + ~ +!!! error TS2365: Operator '>' cannot be applied to types 'boolean' and '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types index f3ea48e637b..9d4d49ba2fd 100644 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types @@ -46,8 +46,8 @@ var r = true ? 1 : 2; >2 : 2 var r3 = true ? 1 : {}; ->r3 : {} ->true ? 1 : {} : {} +>r3 : number | {} +>true ? 1 : {} : 1 | {} >true : true >1 : 1 >{} : {} diff --git a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.types b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.types index 3a655853163..e9b527860d4 100644 --- a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.types +++ b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.types @@ -45,7 +45,7 @@ var result1 = true ? x : a; //Expr1 and Expr2 are literals true ? {} : 1; ->true ? {} : 1 : {} +>true ? {} : 1 : 1 | {} >true : true >{} : {} >1 : 1 @@ -63,14 +63,14 @@ true ? { a: 1 } : { a: 2, b: 'string' }; >'string' : "string" var result2 = true ? {} : 1; ->result2 : {} ->true ? {} : 1 : {} +>result2 : number | {} +>true ? {} : 1 : 1 | {} >true : true >{} : {} >1 : 1 var result3 = true ? { a: 1 } : { a: 2, b: 'string' }; ->result3 : { a: number; } | { a: number; b: string; } +>result3 : { a: number; b?: undefined; } | { a: number; b: string; } >true ? { a: 1 } : { a: 2, b: 'string' } : { a: number; } | { a: number; b: string; } >true : true >{ a: 1 } : { a: number; } @@ -125,7 +125,7 @@ var result5 = true ? a : x; //Expr1 and Expr2 are literals true ? 1 : {}; ->true ? 1 : {} : {} +>true ? 1 : {} : 1 | {} >true : true >1 : 1 >{} : {} @@ -143,14 +143,14 @@ true ? { a: 2, b: 'string' } : { a: 1 }; >1 : 1 var result6 = true ? 1 : {}; ->result6 : {} ->true ? 1 : {} : {} +>result6 : number | {} +>true ? 1 : {} : 1 | {} >true : true >1 : 1 >{} : {} var result7 = true ? { a: 2, b: 'string' } : { a: 1 }; ->result7 : { a: number; b: string; } | { a: number; } +>result7 : { a: number; b: string; } | { a: number; b?: undefined; } >true ? { a: 2, b: 'string' } : { a: 1 } : { a: number; b: string; } | { a: number; } >true : true >{ a: 2, b: 'string' } : { a: number; b: string; } diff --git a/tests/baselines/reference/heterogeneousArrayLiterals.types b/tests/baselines/reference/heterogeneousArrayLiterals.types index f1c5b6b8dfc..51d965b444c 100644 --- a/tests/baselines/reference/heterogeneousArrayLiterals.types +++ b/tests/baselines/reference/heterogeneousArrayLiterals.types @@ -21,14 +21,14 @@ var c = [1, '', null]; // {}[] >null : null var d = [{}, 1]; // {}[] ->d : {}[] ->[{}, 1] : {}[] +>d : (number | {})[] +>[{}, 1] : (number | {})[] >{} : {} >1 : 1 var e = [{}, Object]; // {}[] ->e : {}[] ->[{}, Object] : {}[] +>e : (ObjectConstructor | {})[] +>[{}, Object] : (ObjectConstructor | {})[] >{} : {} >Object : ObjectConstructor @@ -48,7 +48,7 @@ var g = [[1], ['']]; // {}[] >'' : "" var h = [{ foo: 1, bar: '' }, { foo: 2 }]; // {foo: number}[] ->h : ({ foo: number; bar: string; } | { foo: number; })[] +>h : ({ foo: number; bar: string; } | { foo: number; bar?: undefined; })[] >[{ foo: 1, bar: '' }, { foo: 2 }] : ({ foo: number; bar: string; } | { foo: number; })[] >{ foo: 1, bar: '' } : { foo: number; bar: string; } >foo : number @@ -60,7 +60,7 @@ var h = [{ foo: 1, bar: '' }, { foo: 2 }]; // {foo: number}[] >2 : 2 var i = [{ foo: 1, bar: '' }, { foo: '' }]; // {}[] ->i : ({ foo: number; bar: string; } | { foo: string; })[] +>i : ({ foo: number; bar: string; } | { foo: string; bar?: undefined; })[] >[{ foo: 1, bar: '' }, { foo: '' }] : ({ foo: number; bar: string; } | { foo: string; })[] >{ foo: 1, bar: '' } : { foo: number; bar: string; } >foo : number @@ -145,7 +145,7 @@ module Derived { >Derived : typeof Derived var h = [{ foo: base, basear: derived }, { foo: base }]; // {foo: Base}[] ->h : ({ foo: Base; basear: Derived; } | { foo: Base; })[] +>h : ({ foo: Base; basear: Derived; } | { foo: Base; basear?: undefined; })[] >[{ foo: base, basear: derived }, { foo: base }] : ({ foo: Base; basear: Derived; } | { foo: Base; })[] >{ foo: base, basear: derived } : { foo: Base; basear: Derived; } >foo : Base @@ -157,7 +157,7 @@ module Derived { >base : Base var i = [{ foo: base, basear: derived }, { foo: derived }]; // {foo: Derived}[] ->i : ({ foo: Base; basear: Derived; } | { foo: Derived; })[] +>i : ({ foo: Base; basear: Derived; } | { foo: Derived; basear?: undefined; })[] >[{ foo: base, basear: derived }, { foo: derived }] : ({ foo: Base; basear: Derived; } | { foo: Derived; })[] >{ foo: base, basear: derived } : { foo: Base; basear: Derived; } >foo : Base diff --git a/tests/baselines/reference/incompatibleTypes.types b/tests/baselines/reference/incompatibleTypes.types index 053bf6bf099..d88a09a4b72 100644 --- a/tests/baselines/reference/incompatibleTypes.types +++ b/tests/baselines/reference/incompatibleTypes.types @@ -176,7 +176,7 @@ var o1: { a: { a: string; }; b: string; } = { e: 0, f: 0 }; >0 : 0 var a1 = [{ e: 0, f: 0 }, { e: 0, f: 0 }, { e: 0, g: 0 }]; ->a1 : ({ e: number; f: number; } | { e: number; g: number; })[] +>a1 : ({ e: number; f: number; g?: undefined; } | { e: number; g: number; f?: undefined; })[] >[{ e: 0, f: 0 }, { e: 0, f: 0 }, { e: 0, g: 0 }] : ({ e: number; f: number; } | { e: number; g: number; })[] >{ e: 0, f: 0 } : { e: number; f: number; } >e : number diff --git a/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types b/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types index ecd3fc52709..bc7bcbf4c2e 100644 --- a/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types +++ b/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types @@ -107,8 +107,8 @@ function fn3u : U var r3 = t || { a: '' }; ->r3 : { a: string; } ->t || { a: '' } : { a: string; } +>r3 : T | { a: string; } +>t || { a: '' } : T | { a: string; } >t : T >{ a: '' } : { a: string; } >a : string diff --git a/tests/baselines/reference/primitiveMembers.types b/tests/baselines/reference/primitiveMembers.types index 70ca0eb34e7..b30dac5963c 100644 --- a/tests/baselines/reference/primitiveMembers.types +++ b/tests/baselines/reference/primitiveMembers.types @@ -77,8 +77,8 @@ var b: Boolean = true; >true : true var n3 = 5 || {}; ->n3 : {} ->5 || {} : {} +>n3 : number | {} +>5 || {} : 5 | {} >5 : 5 >{} : {} diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.types b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.types index 23ac78ec013..5c008a91e5d 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.types +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.types @@ -675,15 +675,15 @@ function f21(x: T) { >T : T var r20 = true ? {} : x; // ok ->r20 : {} ->true ? {} : x : {} +>r20 : T | {} +>true ? {} : x : T | {} >true : true >{} : {} >x : T var r20 = true ? x : {}; // ok ->r20 : {} ->true ? x : {} : {} +>r20 : T | {} +>true ? x : {} : T | {} >true : true >x : T >{} : {} diff --git a/tests/baselines/reference/symbolType1.types b/tests/baselines/reference/symbolType1.types index 5974b9b801c..d55c95d3685 100644 --- a/tests/baselines/reference/symbolType1.types +++ b/tests/baselines/reference/symbolType1.types @@ -13,8 +13,8 @@ Symbol instanceof Symbol(); (Symbol() || {}) instanceof Object; // This one should be okay, it's a valid way of distinguishing types >(Symbol() || {}) instanceof Object : boolean ->(Symbol() || {}) : {} ->Symbol() || {} : {} +>(Symbol() || {}) : symbol | {} +>Symbol() || {} : symbol | {} >Symbol() : symbol >Symbol : SymbolConstructor >{} : {} @@ -23,8 +23,8 @@ Symbol instanceof Symbol(); Symbol instanceof (Symbol() || {}); >Symbol instanceof (Symbol() || {}) : boolean >Symbol : SymbolConstructor ->(Symbol() || {}) : {} ->Symbol() || {} : {} +>(Symbol() || {}) : symbol | {} +>Symbol() || {} : symbol | {} >Symbol() : symbol >Symbol : SymbolConstructor >{} : {} diff --git a/tests/baselines/reference/symbolType11.types b/tests/baselines/reference/symbolType11.types index ec474dcdb54..bbee323b065 100644 --- a/tests/baselines/reference/symbolType11.types +++ b/tests/baselines/reference/symbolType11.types @@ -33,7 +33,7 @@ s || 1; >1 : 1 ({}) || s; ->({}) || s : {} +>({}) || s : symbol | {} >({}) : {} >{} : {} >s : symbol diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt index 16ad3358038..7e4062ae10a 100644 --- a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt @@ -1,6 +1,5 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(62,36): error TS2345: Argument of type '0' is not assignable to parameter of type '""'. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(75,79): error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: number; z: Date; }'. - Object literal may only specify known properties, and 'y' does not exist in type '{ x: number; z: Date; }'. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(76,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts 74:4, but here has type '{}'. ==== tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts (2 errors) ==== @@ -81,10 +80,9 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference } var a9e = someGenerics9 `${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: '' } }`; - ~~~~~ -!!! error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: number; z: Date; }'. -!!! error TS2345: Object literal may only specify known properties, and 'y' does not exist in type '{ x: number; z: Date; }'. var a9e: {}; + ~~~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts 74:4, but here has type '{}'. // Generic tag with multiple parameters of generic type passed arguments with a single best common type var a9d = someGenerics9 `${ { x: 3 }}${ { x: 6 }}${ { x: 6 } }`; diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.types b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.types index 5c98fb4e7de..d1be9c77cb9 100644 --- a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.types +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.types @@ -395,8 +395,8 @@ interface A92 { } var a9e = someGenerics9 `${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: '' } }`; ->a9e : any ->someGenerics9 `${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: '' } }` : any +>a9e : { x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; } +>someGenerics9 `${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: '' } }` : { x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; } >someGenerics9 : (strs: TemplateStringsArray, a: T, b: T, c: T) => T >`${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: '' } }` : string >undefined : undefined @@ -413,7 +413,7 @@ var a9e = someGenerics9 `${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: >'' : "" var a9e: {}; ->a9e : any +>a9e : { x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; } // Generic tag with multiple parameters of generic type passed arguments with a single best common type var a9d = someGenerics9 `${ { x: 3 }}${ { x: 6 }}${ { x: 6 } }`; diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.errors.txt index 0d43f3d39b2..9112a0542b5 100644 --- a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.errors.txt @@ -1,6 +1,5 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts(62,36): error TS2345: Argument of type '0' is not assignable to parameter of type '""'. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts(75,79): error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: number; z: Date; }'. - Object literal may only specify known properties, and 'y' does not exist in type '{ x: number; z: Date; }'. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts(76,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts 74:4, but here has type '{}'. ==== tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts (2 errors) ==== @@ -81,10 +80,9 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference } var a9e = someGenerics9 `${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: '' } }`; - ~~~~~ -!!! error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: number; z: Date; }'. -!!! error TS2345: Object literal may only specify known properties, and 'y' does not exist in type '{ x: number; z: Date; }'. var a9e: {}; + ~~~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts 74:4, but here has type '{}'. // Generic tag with multiple parameters of generic type passed arguments with a single best common type var a9d = someGenerics9 `${ { x: 3 }}${ { x: 6 }}${ { x: 6 } }`; diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.types b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.types index 9f7df761320..e0a1d339376 100644 --- a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.types +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.types @@ -395,8 +395,8 @@ interface A92 { } var a9e = someGenerics9 `${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: '' } }`; ->a9e : any ->someGenerics9 `${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: '' } }` : any +>a9e : { x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; } +>someGenerics9 `${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: '' } }` : { x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; } >someGenerics9 : (strs: TemplateStringsArray, a: T, b: T, c: T) => T >`${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: '' } }` : string >undefined : undefined @@ -413,7 +413,7 @@ var a9e = someGenerics9 `${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: >'' : "" var a9e: {}; ->a9e : any +>a9e : { x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; } // Generic tag with multiple parameters of generic type passed arguments with a single best common type var a9d = someGenerics9 `${ { x: 3 }}${ { x: 6 }}${ { x: 6 } }`; diff --git a/tests/baselines/reference/typeArgInference2.errors.txt b/tests/baselines/reference/typeArgInference2.errors.txt deleted file mode 100644 index 41fdd9b0783..00000000000 --- a/tests/baselines/reference/typeArgInference2.errors.txt +++ /dev/null @@ -1,20 +0,0 @@ -tests/cases/compiler/typeArgInference2.ts(12,52): error TS2345: Argument of type '{ name: string; b: number; }' is not assignable to parameter of type '{ name: string; a: number; }'. - Object literal may only specify known properties, and 'b' does not exist in type '{ name: string; a: number; }'. - - -==== tests/cases/compiler/typeArgInference2.ts (1 errors) ==== - interface Item { - name: string; - } - - declare function foo(x?: T, y?: T): T; - - var z1 = foo(null); // any - var z2 = foo(); // Item - var z3 = foo({ name: null }); // { name: any } - var z4 = foo({ name: "abc" }); // { name: string } - var z5 = foo({ name: "abc", a: 5 }); // { name: string; a: number } - var z6 = foo({ name: "abc", a: 5 }, { name: "def", b: 5 }); // error - ~~~~ -!!! error TS2345: Argument of type '{ name: string; b: number; }' is not assignable to parameter of type '{ name: string; a: number; }'. -!!! error TS2345: Object literal may only specify known properties, and 'b' does not exist in type '{ name: string; a: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/typeArgInference2.types b/tests/baselines/reference/typeArgInference2.types index 12262c1896f..2b985a7c208 100644 --- a/tests/baselines/reference/typeArgInference2.types +++ b/tests/baselines/reference/typeArgInference2.types @@ -54,8 +54,8 @@ var z5 = foo({ name: "abc", a: 5 }); // { name: string; a: number } >5 : 5 var z6 = foo({ name: "abc", a: 5 }, { name: "def", b: 5 }); // error ->z6 : any ->foo({ name: "abc", a: 5 }, { name: "def", b: 5 }) : any +>z6 : { name: string; a: number; b?: undefined; } | { name: string; b: number; a?: undefined; } +>foo({ name: "abc", a: 5 }, { name: "def", b: 5 }) : { name: string; a: number; b?: undefined; } | { name: string; b: number; a?: undefined; } >foo : (x?: T, y?: T) => T >{ name: "abc", a: 5 } : { name: string; a: number; } >name : string diff --git a/tests/baselines/reference/typeArgumentInference.errors.txt b/tests/baselines/reference/typeArgumentInference.errors.txt index 4daa055d20a..cfed6cc640b 100644 --- a/tests/baselines/reference/typeArgumentInference.errors.txt +++ b/tests/baselines/reference/typeArgumentInference.errors.txt @@ -1,6 +1,5 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(68,29): error TS2345: Argument of type '0' is not assignable to parameter of type '""'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(82,69): error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: number; z: Date; }'. - Object literal may only specify known properties, and 'y' does not exist in type '{ x: number; z: Date; }'. +tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(83,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts 81:4, but here has type '{}'. tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(84,74): error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type 'A92'. Object literal may only specify known properties, and 'y' does not exist in type 'A92'. @@ -90,10 +89,9 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(84,74 z?: Date; } var a9e = someGenerics9(undefined, { x: 6, z: new Date() }, { x: 6, y: '' }); - ~~~~~ -!!! error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: number; z: Date; }'. -!!! error TS2345: Object literal may only specify known properties, and 'y' does not exist in type '{ x: number; z: Date; }'. var a9e: {}; + ~~~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts 81:4, but here has type '{}'. var a9f = someGenerics9(undefined, { x: 6, z: new Date() }, { x: 6, y: '' }); ~~~~~ !!! error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type 'A92'. diff --git a/tests/baselines/reference/typeArgumentInference.types b/tests/baselines/reference/typeArgumentInference.types index 02326834d3b..1f39235ae36 100644 --- a/tests/baselines/reference/typeArgumentInference.types +++ b/tests/baselines/reference/typeArgumentInference.types @@ -421,8 +421,8 @@ interface A92 { >Date : Date } var a9e = someGenerics9(undefined, { x: 6, z: new Date() }, { x: 6, y: '' }); ->a9e : any ->someGenerics9(undefined, { x: 6, z: new Date() }, { x: 6, y: '' }) : any +>a9e : { x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; } +>someGenerics9(undefined, { x: 6, z: new Date() }, { x: 6, y: '' }) : { x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; } >someGenerics9 : (a: T, b: T, c: T) => T >undefined : undefined >{ x: 6, z: new Date() } : { x: number; z: Date; } @@ -438,7 +438,7 @@ var a9e = someGenerics9(undefined, { x: 6, z: new Date() }, { x: 6, y: '' }); >'' : "" var a9e: {}; ->a9e : any +>a9e : { x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; } var a9f = someGenerics9(undefined, { x: 6, z: new Date() }, { x: 6, y: '' }); >a9f : any diff --git a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt index da5558afdf7..ef0c93f20cd 100644 --- a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt @@ -12,8 +12,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstruct tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(106,33): error TS2345: Argument of type '0' is not assignable to parameter of type '""'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(118,9): error TS2304: Cannot find name 'Window'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(120,51): error TS2304: Cannot find name 'window'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(120,69): error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: number; z: any; }'. - Object literal may only specify known properties, and 'y' does not exist in type '{ x: number; z: any; }'. +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(121,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts 119:4, but here has type '{}'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(122,56): error TS2304: Cannot find name 'window'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(122,74): error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type 'A92'. Object literal may only specify known properties, and 'y' does not exist in type 'A92'. @@ -162,10 +161,9 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstruct var a9e = new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); ~~~~~~ !!! error TS2304: Cannot find name 'window'. - ~~~~~ -!!! error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: number; z: any; }'. -!!! error TS2345: Object literal may only specify known properties, and 'y' does not exist in type '{ x: number; z: any; }'. var a9e: {}; + ~~~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts 119:4, but here has type '{}'. var a9f = new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); ~~~~~~ !!! error TS2304: Cannot find name 'window'. diff --git a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.types b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.types index 8981c077b48..04dae1dafa7 100644 --- a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.types +++ b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.types @@ -524,8 +524,8 @@ interface A92 { >Window : No type information available! } var a9e = new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); ->a9e : any ->new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }) : any +>a9e : { x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; } +>new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }) : { x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; } >someGenerics9 : someGenerics9 >undefined : undefined >{ x: 6, z: window } : { x: number; z: any; } @@ -540,7 +540,7 @@ var a9e = new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); >'' : "" var a9e: {}; ->a9e : any +>a9e : { x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; } var a9f = new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); >a9f : any diff --git a/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt b/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt index 6cc81171bcc..2b305390689 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt @@ -17,8 +17,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConst tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(73,29): error TS2345: Argument of type '0' is not assignable to parameter of type '""'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(85,9): error TS2304: Cannot find name 'Window'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(87,47): error TS2304: Cannot find name 'window'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(87,65): error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: number; z: any; }'. - Object literal may only specify known properties, and 'y' does not exist in type '{ x: number; z: any; }'. +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(88,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts 86:4, but here has type '{}'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(89,52): error TS2304: Cannot find name 'window'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(89,70): error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type 'A92'. Object literal may only specify known properties, and 'y' does not exist in type 'A92'. @@ -144,10 +143,9 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConst var a9e = someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); ~~~~~~ !!! error TS2304: Cannot find name 'window'. - ~~~~~ -!!! error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: number; z: any; }'. -!!! error TS2345: Object literal may only specify known properties, and 'y' does not exist in type '{ x: number; z: any; }'. var a9e: {}; + ~~~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts 86:4, but here has type '{}'. var a9f = someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); ~~~~~~ !!! error TS2304: Cannot find name 'window'. diff --git a/tests/baselines/reference/typeArgumentInferenceWithConstraints.types b/tests/baselines/reference/typeArgumentInferenceWithConstraints.types index 4e120b70eb5..4ca65f02b02 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithConstraints.types +++ b/tests/baselines/reference/typeArgumentInferenceWithConstraints.types @@ -464,8 +464,8 @@ interface A92 { >Window : No type information available! } var a9e = someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); ->a9e : any ->someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }) : any +>a9e : { x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; } +>someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }) : { x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; } >someGenerics9 : (a: T, b: T, c: T) => T >undefined : undefined >{ x: 6, z: window } : { x: number; z: any; } @@ -480,7 +480,7 @@ var a9e = someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); >'' : "" var a9e: {}; ->a9e : any +>a9e : { x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; } var a9f = someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); >a9f : any