Accept new baselines

This commit is contained in:
Anders Hejlsberg 2016-10-06 11:05:55 -07:00
parent 9ca2569363
commit b5c10553b5
8 changed files with 39 additions and 42 deletions

View File

@ -193,10 +193,10 @@ var d5 = [...temp3];
>temp3 : any[]
var d6 = [...temp4];
>d6 : any[]
>[...temp4] : any[]
>...temp4 : any
>temp4 : any[]
>d6 : never[]
>[...temp4] : never[]
>...temp4 : never
>temp4 : never[]
var d7 = [...[...temp1]];
>d7 : number[]

View File

@ -105,7 +105,7 @@ function filter<A>(f: (a: A) => boolean, ar: A[]): A[] {
} );
return ret;
>ret : any[]
>ret : never[]
}
// length :: [a] -> Num

View File

@ -13,7 +13,7 @@ var parts = [];
// Ensure that the generated code is correct
parts[0];
>parts[0] : any
>parts : any[]
>parts[0] : never
>parts : never[]
>0 : 0

View File

@ -1,8 +1,7 @@
tests/cases/compiler/implicitAnyWidenToAny.ts(4,5): error TS7005: Variable 'widenArray' implicitly has an 'any[]' type.
tests/cases/compiler/implicitAnyWidenToAny.ts(5,5): error TS7005: Variable 'emptyArray' implicitly has an 'any[]' type.
==== tests/cases/compiler/implicitAnyWidenToAny.ts (2 errors) ====
==== tests/cases/compiler/implicitAnyWidenToAny.ts (1 errors) ====
// these should be errors
var x = null; // error at "x"
var x1 = undefined; // error at "x1"
@ -10,8 +9,6 @@ tests/cases/compiler/implicitAnyWidenToAny.ts(5,5): error TS7005: Variable 'empt
~~~~~~~~~~
!!! error TS7005: Variable 'widenArray' implicitly has an 'any[]' type.
var emptyArray = []; // error at "emptyArray"
~~~~~~~~~~
!!! error TS7005: Variable 'emptyArray' implicitly has an 'any[]' type.
// these should not be error
class AnimalObj {

View File

@ -35,12 +35,12 @@ use(data[0]() === data[1]());
>use(data[0]() === data[1]()) : any
>use : (a: any) => any
>data[0]() === data[1]() : boolean
>data[0]() : any
>data[0] : any
>data : any[]
>data[0]() : typeof C
>data[0] : () => typeof C
>data : (() => typeof C)[]
>0 : 0
>data[1]() : any
>data[1] : any
>data : any[]
>data[1]() : typeof C
>data[1] : () => typeof C
>data : (() => typeof C)[]
>1 : 1

View File

@ -36,12 +36,12 @@ use(data[0]() === data[1]());
>use(data[0]() === data[1]()) : any
>use : (a: any) => any
>data[0]() === data[1]() : boolean
>data[0]() : any
>data[0] : any
>data : any[]
>data[0]() : typeof C
>data[0] : () => typeof C
>data : (() => typeof C)[]
>0 : 0
>data[1]() : any
>data[1] : any
>data : any[]
>data[1]() : typeof C
>data[1] : () => typeof C
>data : (() => typeof C)[]
>1 : 1

View File

@ -14,7 +14,7 @@ var a3 = void 0;
>0 : 0
var b1 = [];
>b1 : never[]
>b1 : any[]
>[] : never[]
var b2 = [,];

View File

@ -1,7 +1,7 @@
=== tests/cases/compiler/typedArrays.ts ===
function CreateTypedArrayTypes() {
>CreateTypedArrayTypes : () => any[]
>CreateTypedArrayTypes : () => (Int8ArrayConstructor | Uint8ArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Int32ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor | Uint8ClampedArrayConstructor)[]
var typedArrays = [];
>typedArrays : any[]
@ -71,11 +71,11 @@ function CreateTypedArrayTypes() {
>Uint8ClampedArray : Uint8ClampedArrayConstructor
return typedArrays;
>typedArrays : any[]
>typedArrays : (Int8ArrayConstructor | Uint8ArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Int32ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor | Uint8ClampedArrayConstructor)[]
}
function CreateTypedArrayInstancesFromLength(obj: number) {
>CreateTypedArrayInstancesFromLength : (obj: number) => any[]
>CreateTypedArrayInstancesFromLength : (obj: number) => (Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array)[]
>obj : number
var typedArrays = [];
@ -164,11 +164,11 @@ function CreateTypedArrayInstancesFromLength(obj: number) {
>obj : number
return typedArrays;
>typedArrays : any[]
>typedArrays : (Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array)[]
}
function CreateTypedArrayInstancesFromArray(obj: number[]) {
>CreateTypedArrayInstancesFromArray : (obj: number[]) => any[]
>CreateTypedArrayInstancesFromArray : (obj: number[]) => (Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array)[]
>obj : number[]
var typedArrays = [];
@ -257,11 +257,11 @@ function CreateTypedArrayInstancesFromArray(obj: number[]) {
>obj : number[]
return typedArrays;
>typedArrays : any[]
>typedArrays : (Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array)[]
}
function CreateIntegerTypedArraysFromArray2(obj:number[]) {
>CreateIntegerTypedArraysFromArray2 : (obj: number[]) => any[]
>CreateIntegerTypedArraysFromArray2 : (obj: number[]) => (Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array)[]
>obj : number[]
var typedArrays = [];
@ -368,11 +368,11 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) {
>obj : number[]
return typedArrays;
>typedArrays : any[]
>typedArrays : (Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array)[]
}
function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike<number>) {
>CreateIntegerTypedArraysFromArrayLike : (obj: ArrayLike<number>) => any[]
>CreateIntegerTypedArraysFromArrayLike : (obj: ArrayLike<number>) => (Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array)[]
>obj : ArrayLike<number>
>ArrayLike : ArrayLike<T>
@ -480,11 +480,11 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike<number>) {
>obj : ArrayLike<number>
return typedArrays;
>typedArrays : any[]
>typedArrays : (Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array)[]
}
function CreateTypedArraysOf(obj) {
>CreateTypedArraysOf : (obj: any) => any[]
>CreateTypedArraysOf : (obj: any) => (Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array)[]
>obj : any
var typedArrays = [];
@ -600,11 +600,11 @@ function CreateTypedArraysOf(obj) {
>obj : any
return typedArrays;
>typedArrays : any[]
>typedArrays : (Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array)[]
}
function CreateTypedArraysOf2() {
>CreateTypedArraysOf2 : () => any[]
>CreateTypedArraysOf2 : () => (Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array)[]
var typedArrays = [];
>typedArrays : any[]
@ -737,11 +737,11 @@ function CreateTypedArraysOf2() {
>4 : 4
return typedArrays;
>typedArrays : any[]
>typedArrays : (Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array)[]
}
function CreateTypedArraysFromMapFn(obj:ArrayLike<number>, mapFn: (n:number, v:number)=> number) {
>CreateTypedArraysFromMapFn : (obj: ArrayLike<number>, mapFn: (n: number, v: number) => number) => any[]
>CreateTypedArraysFromMapFn : (obj: ArrayLike<number>, mapFn: (n: number, v: number) => number) => (Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array)[]
>obj : ArrayLike<number>
>ArrayLike : ArrayLike<T>
>mapFn : (n: number, v: number) => number
@ -861,11 +861,11 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike<number>, mapFn: (n:number, v:n
>mapFn : (n: number, v: number) => number
return typedArrays;
>typedArrays : any[]
>typedArrays : (Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array)[]
}
function CreateTypedArraysFromThisObj(obj:ArrayLike<number>, mapFn: (n:number, v:number)=> number, thisArg: {}) {
>CreateTypedArraysFromThisObj : (obj: ArrayLike<number>, mapFn: (n: number, v: number) => number, thisArg: {}) => any[]
>CreateTypedArraysFromThisObj : (obj: ArrayLike<number>, mapFn: (n: number, v: number) => number, thisArg: {}) => (Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array)[]
>obj : ArrayLike<number>
>ArrayLike : ArrayLike<T>
>mapFn : (n: number, v: number) => number
@ -995,5 +995,5 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike<number>, mapFn: (n:number, v
>thisArg : {}
return typedArrays;
>typedArrays : any[]
>typedArrays : (Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array)[]
}