Accept new baselines

This commit is contained in:
Anders Hejlsberg
2016-09-29 13:05:34 -07:00
parent 0621f7e9a1
commit 52d2aa5b60
12 changed files with 50 additions and 38 deletions
@@ -59,9 +59,9 @@ var e = undefined;
>undefined : undefined
x = e;
>x = e : any
>x = e : undefined
>x : any
>e : any
>e : undefined
var e2: typeof undefined;
>e2 : any
+10 -1
View File
@@ -1,17 +1,24 @@
tests/cases/compiler/forIn.ts(2,10): error TS2404: The left-hand side of a 'for...in' statement cannot use a type annotation.
tests/cases/compiler/forIn.ts(2,22): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.
tests/cases/compiler/forIn.ts(7,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.
tests/cases/compiler/forIn.ts(18,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.
tests/cases/compiler/forIn.ts(20,4): error TS2304: Cannot find name 'k'.
==== tests/cases/compiler/forIn.ts (2 errors) ====
==== tests/cases/compiler/forIn.ts (5 errors) ====
var arr = null;
for (var i:number in arr) { // error
~
!!! error TS2404: The left-hand side of a 'for...in' statement cannot use a type annotation.
~~~
!!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.
var x1 = arr[i];
var y1 = arr[i];
}
for (var j in arr) { // ok
~~~
!!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.
var x2 = arr[j];
var y2 = arr[j];
}
@@ -23,6 +30,8 @@ tests/cases/compiler/forIn.ts(20,4): error TS2304: Cannot find name 'k'.
}
for (var l in arr) {
~~~
!!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.
// error in the body
k[l] = 1;
~
@@ -1,4 +1,4 @@
tests/cases/compiler/implicitAnyDeclareVariablesWithoutTypeAndInit.ts(3,5): error TS7034: Variable 'y' implicitly has type 'any' and is referenced in a nested function.
tests/cases/compiler/implicitAnyDeclareVariablesWithoutTypeAndInit.ts(3,5): error TS7034: Variable 'y' implicitly has type 'any' in some locations where its type cannot be determined.
tests/cases/compiler/implicitAnyDeclareVariablesWithoutTypeAndInit.ts(4,13): error TS7005: Variable 'foo' implicitly has an 'any' type.
tests/cases/compiler/implicitAnyDeclareVariablesWithoutTypeAndInit.ts(5,15): error TS7006: Parameter 'k' implicitly has an 'any' type.
@@ -8,7 +8,7 @@ tests/cases/compiler/implicitAnyDeclareVariablesWithoutTypeAndInit.ts(5,15): err
var x; // no error, control flow typed
var y; // error because captured
~
!!! error TS7034: Variable 'y' implicitly has type 'any' and is referenced in a nested function.
!!! error TS7034: Variable 'y' implicitly has type 'any' in some locations where its type cannot be determined.
declare var foo; // error at "foo"
~~~
!!! error TS7005: Variable 'foo' implicitly has an 'any' type.
@@ -1,4 +1,3 @@
tests/cases/compiler/implicitAnyFunctionInvocationWithAnyArguements.ts(2,5): error TS7005: Variable 'arg0' implicitly has an 'any' type.
tests/cases/compiler/implicitAnyFunctionInvocationWithAnyArguements.ts(3,5): error TS7005: Variable 'anyArray' implicitly has an 'any[]' type.
tests/cases/compiler/implicitAnyFunctionInvocationWithAnyArguements.ts(4,13): error TS7008: Member 'v' implicitly has an 'any' type.
tests/cases/compiler/implicitAnyFunctionInvocationWithAnyArguements.ts(4,16): error TS7008: Member 'w' implicitly has an 'any' type.
@@ -7,11 +6,9 @@ tests/cases/compiler/implicitAnyFunctionInvocationWithAnyArguements.ts(6,16): er
tests/cases/compiler/implicitAnyFunctionInvocationWithAnyArguements.ts(10,36): error TS7006: Parameter 'y2' implicitly has an 'any' type.
==== tests/cases/compiler/implicitAnyFunctionInvocationWithAnyArguements.ts (7 errors) ====
==== tests/cases/compiler/implicitAnyFunctionInvocationWithAnyArguements.ts (6 errors) ====
// this should be errors
var arg0 = null; // error at "arg0"
~~~~
!!! error TS7005: Variable 'arg0' implicitly has an 'any' type.
var anyArray = [null, undefined]; // error at array literal
~~~~~~~~
!!! error TS7005: Variable 'anyArray' implicitly has an 'any[]' type.
@@ -1,17 +1,11 @@
tests/cases/compiler/implicitAnyWidenToAny.ts(2,5): error TS7005: Variable 'x' implicitly has an 'any' type.
tests/cases/compiler/implicitAnyWidenToAny.ts(3,5): error TS7005: Variable 'x1' implicitly has an 'any' type.
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 (4 errors) ====
==== tests/cases/compiler/implicitAnyWidenToAny.ts (2 errors) ====
// these should be errors
var x = null; // error at "x"
~
!!! error TS7005: Variable 'x' implicitly has an 'any' type.
var x1 = undefined; // error at "x1"
~~
!!! error TS7005: Variable 'x1' implicitly has an 'any' type.
var widenArray = [null, undefined]; // error at "widenArray"
~~~~~~~~~~
!!! error TS7005: Variable 'widenArray' implicitly has an 'any[]' type.
@@ -1,7 +1,7 @@
=== tests/cases/compiler/json.stringify.ts ===
var value = null;
>value : null
>value : any
>null : null
JSON.stringify(value, undefined, 2);
@@ -6,8 +6,6 @@ tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration.ts(3,5): error TS1
tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration.ts(3,6): error TS7031: Binding element 'a1' implicitly has an 'any' type.
tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration.ts(3,23): error TS1182: A destructuring declaration must have an initializer.
tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration.ts(3,24): error TS7031: Binding element 'b1' implicitly has an 'any' type.
tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration.ts(3,36): error TS7005: Variable 'c1' implicitly has an 'any' type.
tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration.ts(3,52): error TS7005: Variable 'd1' implicitly has an 'any' type.
tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration.ts(5,5): error TS1182: A destructuring declaration must have an initializer.
tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration.ts(5,18): error TS1182: A destructuring declaration must have an initializer.
tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration.ts(7,5): error TS1182: A destructuring declaration must have an initializer.
@@ -15,12 +13,10 @@ tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration.ts(7,13): error TS
tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration.ts(7,25): error TS7008: Member 'b3' implicitly has an 'any' type.
tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration.ts(9,6): error TS7031: Binding element 'a4' implicitly has an 'any' type.
tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration.ts(9,26): error TS7031: Binding element 'b4' implicitly has an 'any' type.
tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration.ts(9,46): error TS7005: Variable 'c4' implicitly has an 'any' type.
tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration.ts(9,62): error TS7005: Variable 'd4' implicitly has an 'any' type.
tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration.ts(11,6): error TS7031: Binding element 'a5' implicitly has an 'any' type.
==== tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration.ts (20 errors) ====
==== tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration.ts (16 errors) ====
var [a], {b}, c, d; // error
~~~
!!! error TS1182: A destructuring declaration must have an initializer.
@@ -40,10 +36,6 @@ tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration.ts(11,6): error TS
!!! error TS1182: A destructuring declaration must have an initializer.
~~
!!! error TS7031: Binding element 'b1' implicitly has an 'any' type.
~~
!!! error TS7005: Variable 'c1' implicitly has an 'any' type.
~~
!!! error TS7005: Variable 'd1' implicitly has an 'any' type.
var [a2]: [any], {b2}: { b2: any }, c2: any, d2: any;
~~~~
@@ -64,10 +56,6 @@ tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration.ts(11,6): error TS
!!! error TS7031: Binding element 'a4' implicitly has an 'any' type.
~~
!!! error TS7031: Binding element 'b4' implicitly has an 'any' type.
~~
!!! error TS7005: Variable 'c4' implicitly has an 'any' type.
~~
!!! error TS7005: Variable 'd4' implicitly has an 'any' type.
var [a5 = undefined] = []; // error
~~
+3 -3
View File
@@ -5,10 +5,10 @@ var x=null;
>null : null
var y=3+x;
>y : any
>3+x : any
>y : number
>3+x : number
>3 : 3
>x : any
>x : null
var z=3+null;
>z : number
@@ -25,6 +25,9 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(776,42): e
tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(781,23): error TS2503: Cannot find namespace 'TypeScript'.
tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(794,49): error TS2304: Cannot find name 'TypeScript'.
tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(795,49): error TS2304: Cannot find name 'TypeScript'.
tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(820,31): error TS2339: Property 'length' does not exist on type 'null'.
tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(976,28): error TS2339: Property 'length' does not exist on type 'null'.
tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(977,82): error TS2339: Property 'join' does not exist on type 'null'.
tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(987,53): error TS2304: Cannot find name 'TypeScript'.
tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(987,89): error TS2304: Cannot find name 'TypeScript'.
tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(987,115): error TS2503: Cannot find namespace 'TypeScript'.
@@ -110,7 +113,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1787,68):
tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): error TS2304: Cannot find name 'Diff'.
==== tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts (110 errors) ====
==== tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts (113 errors) ====
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
@@ -985,6 +988,8 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32):
})
return errors.length === 0;
~~~~~~
!!! error TS2339: Property 'length' does not exist on type 'null'.
}
public isSubtypeOf(other: Type) {
@@ -1141,7 +1146,11 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32):
})
if (errors.length > 0)
~~~~~~
!!! error TS2339: Property 'length' does not exist on type 'null'.
throw new Error("Type definition contains errors: " + errors.join(","));
~~~~
!!! error TS2339: Property 'join' does not exist on type 'null'.
var matchingIdentifiers: Type[] = [];
@@ -14,11 +14,11 @@ var WorkspacePrototype = {
}
};
WorkspacePrototype['__proto__'] = EntityPrototype;
>WorkspacePrototype['__proto__'] = EntityPrototype : any
>WorkspacePrototype['__proto__'] = EntityPrototype : undefined
>WorkspacePrototype['__proto__'] : any
>WorkspacePrototype : { serialize: () => any; }
>'__proto__' : "___proto__"
>EntityPrototype : any
>EntityPrototype : undefined
var o = {
>o : { "__proto__": number; }
@@ -1,11 +1,11 @@
=== tests/cases/conformance/types/typeRelationships/widenedTypes/strictNullChecksNoWidening.ts ===
var a1 = null;
>a1 : null
>a1 : any
>null : null
var a2 = undefined;
>a2 : undefined
>a2 : any
>undefined : undefined
var a3 = void 0;
@@ -0,0 +1,15 @@
tests/cases/compiler/file1.ts(3,12): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
==== tests/cases/compiler/file2.ts (0 errors) ====
import f = require('./file1');
f.foo();
==== tests/cases/compiler/file1.ts (1 errors) ====
export function foo() {
var classes = undefined;
return new classes(null);
~~~~~~~~~~~~~~~~~
!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
}