From 0ab2b2a0693226cde64060c54f26c3c70cd4d5f0 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 29 Jul 2015 11:32:01 -0700 Subject: [PATCH] Accepting new baselines --- .../reference/assignmentCompat1.errors.txt | 9 +--- .../assignmentCompatability36.errors.txt | 17 -------- .../assignmentCompatability36.symbols | 39 +++++++++++++++++ .../reference/assignmentCompatability36.types | 42 +++++++++++++++++++ .../reference/indexTypeCheck.errors.txt | 5 +-- .../reference/intTypeCheck.errors.txt | 42 +------------------ 6 files changed, 85 insertions(+), 69 deletions(-) delete mode 100644 tests/baselines/reference/assignmentCompatability36.errors.txt create mode 100644 tests/baselines/reference/assignmentCompatability36.symbols create mode 100644 tests/baselines/reference/assignmentCompatability36.types diff --git a/tests/baselines/reference/assignmentCompat1.errors.txt b/tests/baselines/reference/assignmentCompat1.errors.txt index 6734e6fc96..8e704400db 100644 --- a/tests/baselines/reference/assignmentCompat1.errors.txt +++ b/tests/baselines/reference/assignmentCompat1.errors.txt @@ -1,10 +1,8 @@ tests/cases/compiler/assignmentCompat1.ts(4,1): error TS2322: Type '{ [index: string]: any; }' is not assignable to type '{ one: number; }'. Property 'one' is missing in type '{ [index: string]: any; }'. -tests/cases/compiler/assignmentCompat1.ts(5,1): error TS2322: Type '{ one: number; }' is not assignable to type '{ [index: string]: any; }'. - Index signature is missing in type '{ one: number; }'. -==== tests/cases/compiler/assignmentCompat1.ts (2 errors) ==== +==== tests/cases/compiler/assignmentCompat1.ts (1 errors) ==== var x = {one: 1}; var y: {[index:string]: any}; @@ -12,7 +10,4 @@ tests/cases/compiler/assignmentCompat1.ts(5,1): error TS2322: Type '{ one: numbe ~ !!! error TS2322: Type '{ [index: string]: any; }' is not assignable to type '{ one: number; }'. !!! error TS2322: Property 'one' is missing in type '{ [index: string]: any; }'. - y = x; - ~ -!!! error TS2322: Type '{ one: number; }' is not assignable to type '{ [index: string]: any; }'. -!!! error TS2322: Index signature is missing in type '{ one: number; }'. \ No newline at end of file + y = x; \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability36.errors.txt b/tests/baselines/reference/assignmentCompatability36.errors.txt deleted file mode 100644 index 591dc072fa..0000000000 --- a/tests/baselines/reference/assignmentCompatability36.errors.txt +++ /dev/null @@ -1,17 +0,0 @@ -tests/cases/compiler/assignmentCompatability36.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [index: string]: any; }'. - Index signature is missing in type 'interfaceWithPublicAndOptional'. - - -==== tests/cases/compiler/assignmentCompatability36.ts (1 errors) ==== - module __test1__ { - export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; - export var __val__obj4 = obj4; - } - module __test2__ { - export var aa:{[index:string]:any;};; - export var __val__aa = aa; - } - __test2__.__val__aa = __test1__.__val__obj4 - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [index: string]: any; }'. -!!! error TS2322: Index signature is missing in type 'interfaceWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability36.symbols b/tests/baselines/reference/assignmentCompatability36.symbols new file mode 100644 index 0000000000..4b4b7d75a5 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability36.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/assignmentCompatability36.ts === +module __test1__ { +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability36.ts, 0, 0)) + + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability36.ts, 0, 18)) +>T : Symbol(T, Decl(assignmentCompatability36.ts, 1, 52)) +>U : Symbol(U, Decl(assignmentCompatability36.ts, 1, 54)) +>one : Symbol(one, Decl(assignmentCompatability36.ts, 1, 58)) +>T : Symbol(T, Decl(assignmentCompatability36.ts, 1, 52)) +>two : Symbol(two, Decl(assignmentCompatability36.ts, 1, 66)) +>U : Symbol(U, Decl(assignmentCompatability36.ts, 1, 54)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability36.ts, 1, 83)) +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability36.ts, 0, 18)) +>one : Symbol(one, Decl(assignmentCompatability36.ts, 1, 139)) + + export var __val__obj4 = obj4; +>__val__obj4 : Symbol(__val__obj4, Decl(assignmentCompatability36.ts, 2, 14)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability36.ts, 1, 83)) +} +module __test2__ { +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability36.ts, 3, 1)) + + export var aa:{[index:string]:any;};; +>aa : Symbol(aa, Decl(assignmentCompatability36.ts, 5, 14)) +>index : Symbol(index, Decl(assignmentCompatability36.ts, 5, 20)) + + export var __val__aa = aa; +>__val__aa : Symbol(__val__aa, Decl(assignmentCompatability36.ts, 6, 14)) +>aa : Symbol(aa, Decl(assignmentCompatability36.ts, 5, 14)) +} +__test2__.__val__aa = __test1__.__val__obj4 +>__test2__.__val__aa : Symbol(__test2__.__val__aa, Decl(assignmentCompatability36.ts, 6, 14)) +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability36.ts, 3, 1)) +>__val__aa : Symbol(__test2__.__val__aa, Decl(assignmentCompatability36.ts, 6, 14)) +>__test1__.__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability36.ts, 2, 14)) +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability36.ts, 0, 0)) +>__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability36.ts, 2, 14)) + diff --git a/tests/baselines/reference/assignmentCompatability36.types b/tests/baselines/reference/assignmentCompatability36.types new file mode 100644 index 0000000000..b67be38e2b --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability36.types @@ -0,0 +1,42 @@ +=== tests/cases/compiler/assignmentCompatability36.ts === +module __test1__ { +>__test1__ : typeof __test1__ + + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; +>interfaceWithPublicAndOptional : interfaceWithPublicAndOptional +>T : T +>U : U +>one : T +>T : T +>two : U +>U : U +>obj4 : interfaceWithPublicAndOptional +>interfaceWithPublicAndOptional : interfaceWithPublicAndOptional +>{ one: 1 } : { one: number; } +>one : number +>1 : number + + export var __val__obj4 = obj4; +>__val__obj4 : interfaceWithPublicAndOptional +>obj4 : interfaceWithPublicAndOptional +} +module __test2__ { +>__test2__ : typeof __test2__ + + export var aa:{[index:string]:any;};; +>aa : { [index: string]: any; } +>index : string + + export var __val__aa = aa; +>__val__aa : { [index: string]: any; } +>aa : { [index: string]: any; } +} +__test2__.__val__aa = __test1__.__val__obj4 +>__test2__.__val__aa = __test1__.__val__obj4 : __test1__.interfaceWithPublicAndOptional +>__test2__.__val__aa : { [index: string]: any; } +>__test2__ : typeof __test2__ +>__val__aa : { [index: string]: any; } +>__test1__.__val__obj4 : __test1__.interfaceWithPublicAndOptional +>__test1__ : typeof __test1__ +>__val__obj4 : __test1__.interfaceWithPublicAndOptional + diff --git a/tests/baselines/reference/indexTypeCheck.errors.txt b/tests/baselines/reference/indexTypeCheck.errors.txt index 9f4b403ca2..9e003197e4 100644 --- a/tests/baselines/reference/indexTypeCheck.errors.txt +++ b/tests/baselines/reference/indexTypeCheck.errors.txt @@ -1,14 +1,13 @@ tests/cases/compiler/indexTypeCheck.ts(2,2): error TS1021: An index signature must have a type annotation. tests/cases/compiler/indexTypeCheck.ts(3,2): error TS1021: An index signature must have a type annotation. tests/cases/compiler/indexTypeCheck.ts(17,2): error TS2413: Numeric index type 'number' is not assignable to string index type 'string'. -tests/cases/compiler/indexTypeCheck.ts(22,2): error TS2413: Numeric index type 'Orange' is not assignable to string index type 'Yellow'. tests/cases/compiler/indexTypeCheck.ts(27,2): error TS2413: Numeric index type 'number' is not assignable to string index type 'string'. tests/cases/compiler/indexTypeCheck.ts(32,3): error TS1096: An index signature must have exactly one parameter. tests/cases/compiler/indexTypeCheck.ts(36,3): error TS1023: An index signature parameter type must be 'string' or 'number'. tests/cases/compiler/indexTypeCheck.ts(51,1): error TS2342: An index expression argument must be of type 'string', 'number', 'symbol, or 'any'. -==== tests/cases/compiler/indexTypeCheck.ts (8 errors) ==== +==== tests/cases/compiler/indexTypeCheck.ts (7 errors) ==== interface Red { [n:number]; // ok ~~~~~~~~~~~ @@ -37,8 +36,6 @@ tests/cases/compiler/indexTypeCheck.ts(51,1): error TS2342: An index expression interface Green { [n:number]: Orange; // error - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2413: Numeric index type 'Orange' is not assignable to string index type 'Yellow'. [s:string]: Yellow; // ok } diff --git a/tests/baselines/reference/intTypeCheck.errors.txt b/tests/baselines/reference/intTypeCheck.errors.txt index bd8b204804..7f1cc88e2a 100644 --- a/tests/baselines/reference/intTypeCheck.errors.txt +++ b/tests/baselines/reference/intTypeCheck.errors.txt @@ -29,15 +29,7 @@ tests/cases/compiler/intTypeCheck.ts(134,5): error TS2322: Type 'boolean' is not tests/cases/compiler/intTypeCheck.ts(134,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(134,22): error TS2304: Cannot find name 'i3'. tests/cases/compiler/intTypeCheck.ts(135,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(141,5): error TS2322: Type 'Object' is not assignable to type 'i4'. - Index signature is missing in type 'Object'. tests/cases/compiler/intTypeCheck.ts(142,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(143,5): error TS2322: Type 'Base' is not assignable to type 'i4'. - Index signature is missing in type 'Base'. -tests/cases/compiler/intTypeCheck.ts(145,5): error TS2322: Type '() => void' is not assignable to type 'i4'. - Index signature is missing in type '() => void'. -tests/cases/compiler/intTypeCheck.ts(148,5): error TS2322: Type 'boolean' is not assignable to type 'i4'. - Index signature is missing in type 'Boolean'. tests/cases/compiler/intTypeCheck.ts(148,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(148,22): error TS2304: Cannot find name 'i4'. tests/cases/compiler/intTypeCheck.ts(149,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. @@ -73,21 +65,13 @@ tests/cases/compiler/intTypeCheck.ts(190,5): error TS2322: Type 'boolean' is not tests/cases/compiler/intTypeCheck.ts(190,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(190,22): error TS2304: Cannot find name 'i7'. tests/cases/compiler/intTypeCheck.ts(191,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(197,5): error TS2322: Type 'Object' is not assignable to type 'i8'. - Index signature is missing in type 'Object'. tests/cases/compiler/intTypeCheck.ts(198,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(199,5): error TS2322: Type 'Base' is not assignable to type 'i8'. - Index signature is missing in type 'Base'. -tests/cases/compiler/intTypeCheck.ts(201,5): error TS2322: Type '() => void' is not assignable to type 'i8'. - Index signature is missing in type '() => void'. -tests/cases/compiler/intTypeCheck.ts(204,5): error TS2322: Type 'boolean' is not assignable to type 'i8'. - Index signature is missing in type 'Boolean'. tests/cases/compiler/intTypeCheck.ts(204,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(204,22): error TS2304: Cannot find name 'i8'. tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -==== tests/cases/compiler/intTypeCheck.ts (69 errors) ==== +==== tests/cases/compiler/intTypeCheck.ts (61 errors) ==== interface i1 { //Property Signatures p; @@ -287,27 +271,15 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit var obj33: i4; var obj34: i4 = {}; var obj35: i4 = new Object(); - ~~~~~ -!!! error TS2322: Type 'Object' is not assignable to type 'i4'. -!!! error TS2322: Index signature is missing in type 'Object'. var obj36: i4 = new obj33; ~~~~~~~~~ !!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. var obj37: i4 = new Base; - ~~~~~ -!!! error TS2322: Type 'Base' is not assignable to type 'i4'. -!!! error TS2322: Index signature is missing in type 'Base'. var obj38: i4 = null; var obj39: i4 = function () { }; - ~~~~~ -!!! error TS2322: Type '() => void' is not assignable to type 'i4'. -!!! error TS2322: Index signature is missing in type '() => void'. //var obj40: i4 = function foo() { }; var obj41: i4 = anyVar; var obj42: i4 = new anyVar; - ~~~~~ -!!! error TS2322: Type 'boolean' is not assignable to type 'i4'. -!!! error TS2322: Index signature is missing in type 'Boolean'. ~ !!! error TS1109: Expression expected. ~~ @@ -421,27 +393,15 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit var obj77: i8; var obj78: i8 = {}; var obj79: i8 = new Object(); - ~~~~~ -!!! error TS2322: Type 'Object' is not assignable to type 'i8'. -!!! error TS2322: Index signature is missing in type 'Object'. var obj80: i8 = new obj77; ~~~~~~~~~ !!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. var obj81: i8 = new Base; - ~~~~~ -!!! error TS2322: Type 'Base' is not assignable to type 'i8'. -!!! error TS2322: Index signature is missing in type 'Base'. var obj82: i8 = null; var obj83: i8 = function () { }; - ~~~~~ -!!! error TS2322: Type '() => void' is not assignable to type 'i8'. -!!! error TS2322: Index signature is missing in type '() => void'. //var obj84: i8 = function foo() { }; var obj85: i8 = anyVar; var obj86: i8 = new anyVar; - ~~~~~ -!!! error TS2322: Type 'boolean' is not assignable to type 'i8'. -!!! error TS2322: Index signature is missing in type 'Boolean'. ~ !!! error TS1109: Expression expected. ~~