From 837e6dbda36cdf34befbf0536592f4913c59d645 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 9 Feb 2016 14:33:24 -0800 Subject: [PATCH] Accepting new baselines --- ...eAssignmentCompatIndexSignature.errors.txt | 7 +-- ...tionshipObjectsOnIndexSignature.errors.txt | 52 +------------------ ...ontextualTypingOfObjectLiterals.errors.txt | 23 -------- .../contextualTypingOfObjectLiterals.symbols | 32 ++++++++++++ .../contextualTypingOfObjectLiterals.types | 41 +++++++++++++++ .../reference/indexerAssignability.errors.txt | 28 ---------- .../reference/indexerAssignability.symbols | 36 +++++++++++++ .../reference/indexerAssignability.types | 42 +++++++++++++++ .../numericIndexerConstraint2.errors.txt | 6 ++- .../numericIndexerConstraint5.errors.txt | 6 ++- .../stringIndexerAssignments1.errors.txt | 7 +-- 11 files changed, 163 insertions(+), 117 deletions(-) delete mode 100644 tests/baselines/reference/contextualTypingOfObjectLiterals.errors.txt create mode 100644 tests/baselines/reference/contextualTypingOfObjectLiterals.symbols create mode 100644 tests/baselines/reference/contextualTypingOfObjectLiterals.types delete mode 100644 tests/baselines/reference/indexerAssignability.errors.txt create mode 100644 tests/baselines/reference/indexerAssignability.symbols create mode 100644 tests/baselines/reference/indexerAssignability.types diff --git a/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.errors.txt b/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.errors.txt index eb5020e97f9..e99cac7968c 100644 --- a/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.errors.txt +++ b/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.errors.txt @@ -1,10 +1,8 @@ -tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignature.ts(15,5): error TS2322: Type '{}' is not assignable to type '{ [n: number]: Foo; }'. - Index signature is missing in type '{}'. tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignature.ts(19,5): error TS2322: Type '() => void' is not assignable to type '{ [n: number]: Bar; }'. Index signature is missing in type '() => void'. -==== tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignature.ts (2 errors) ==== +==== tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignature.ts (1 errors) ==== interface Foo { a } interface Bar { b } @@ -20,9 +18,6 @@ tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignatur var f = () => { }; var v1: { - ~~ -!!! error TS2322: Type '{}' is not assignable to type '{ [n: number]: Foo; }'. -!!! error TS2322: Index signature is missing in type '{}'. [n: number]: Foo } = o; // Should be allowed diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.errors.txt b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.errors.txt index fe608b14379..2efaf2e5ae2 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.errors.txt +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.errors.txt @@ -1,70 +1,54 @@ tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(26,12): error TS2365: Operator '<' cannot be applied to types '{ [a: string]: string; }' and '{ [b: string]: number; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(27,12): error TS2365: Operator '<' cannot be applied to types '{ [index: string]: Base; }' and '{ [index: string]: C; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(28,12): error TS2365: Operator '<' cannot be applied to types '{ [index: number]: Base; }' and '{ [index: number]: C; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(29,12): error TS2365: Operator '<' cannot be applied to types '{ [index: number]: Derived; }' and '{ [index: string]: Base; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(31,12): error TS2365: Operator '<' cannot be applied to types '{ [b: string]: number; }' and '{ [a: string]: string; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(32,12): error TS2365: Operator '<' cannot be applied to types '{ [index: string]: C; }' and '{ [index: string]: Base; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(33,12): error TS2365: Operator '<' cannot be applied to types '{ [index: number]: C; }' and '{ [index: number]: Base; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(34,12): error TS2365: Operator '<' cannot be applied to types '{ [index: string]: Base; }' and '{ [index: number]: Derived; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(37,12): error TS2365: Operator '>' cannot be applied to types '{ [a: string]: string; }' and '{ [b: string]: number; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(38,12): error TS2365: Operator '>' cannot be applied to types '{ [index: string]: Base; }' and '{ [index: string]: C; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(39,12): error TS2365: Operator '>' cannot be applied to types '{ [index: number]: Base; }' and '{ [index: number]: C; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(40,12): error TS2365: Operator '>' cannot be applied to types '{ [index: number]: Derived; }' and '{ [index: string]: Base; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(42,12): error TS2365: Operator '>' cannot be applied to types '{ [b: string]: number; }' and '{ [a: string]: string; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(43,12): error TS2365: Operator '>' cannot be applied to types '{ [index: string]: C; }' and '{ [index: string]: Base; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(44,12): error TS2365: Operator '>' cannot be applied to types '{ [index: number]: C; }' and '{ [index: number]: Base; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(45,12): error TS2365: Operator '>' cannot be applied to types '{ [index: string]: Base; }' and '{ [index: number]: Derived; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(48,12): error TS2365: Operator '<=' cannot be applied to types '{ [a: string]: string; }' and '{ [b: string]: number; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(49,12): error TS2365: Operator '<=' cannot be applied to types '{ [index: string]: Base; }' and '{ [index: string]: C; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(50,12): error TS2365: Operator '<=' cannot be applied to types '{ [index: number]: Base; }' and '{ [index: number]: C; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(51,12): error TS2365: Operator '<=' cannot be applied to types '{ [index: number]: Derived; }' and '{ [index: string]: Base; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(53,12): error TS2365: Operator '<=' cannot be applied to types '{ [b: string]: number; }' and '{ [a: string]: string; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(54,12): error TS2365: Operator '<=' cannot be applied to types '{ [index: string]: C; }' and '{ [index: string]: Base; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(55,12): error TS2365: Operator '<=' cannot be applied to types '{ [index: number]: C; }' and '{ [index: number]: Base; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(56,12): error TS2365: Operator '<=' cannot be applied to types '{ [index: string]: Base; }' and '{ [index: number]: Derived; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(59,12): error TS2365: Operator '>=' cannot be applied to types '{ [a: string]: string; }' and '{ [b: string]: number; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(60,12): error TS2365: Operator '>=' cannot be applied to types '{ [index: string]: Base; }' and '{ [index: string]: C; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(61,12): error TS2365: Operator '>=' cannot be applied to types '{ [index: number]: Base; }' and '{ [index: number]: C; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(62,12): error TS2365: Operator '>=' cannot be applied to types '{ [index: number]: Derived; }' and '{ [index: string]: Base; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(64,12): error TS2365: Operator '>=' cannot be applied to types '{ [b: string]: number; }' and '{ [a: string]: string; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(65,12): error TS2365: Operator '>=' cannot be applied to types '{ [index: string]: C; }' and '{ [index: string]: Base; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(66,12): error TS2365: Operator '>=' cannot be applied to types '{ [index: number]: C; }' and '{ [index: number]: Base; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(67,12): error TS2365: Operator '>=' cannot be applied to types '{ [index: string]: Base; }' and '{ [index: number]: Derived; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(70,12): error TS2365: Operator '==' cannot be applied to types '{ [a: string]: string; }' and '{ [b: string]: number; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(71,12): error TS2365: Operator '==' cannot be applied to types '{ [index: string]: Base; }' and '{ [index: string]: C; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(72,12): error TS2365: Operator '==' cannot be applied to types '{ [index: number]: Base; }' and '{ [index: number]: C; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(73,12): error TS2365: Operator '==' cannot be applied to types '{ [index: number]: Derived; }' and '{ [index: string]: Base; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(75,12): error TS2365: Operator '==' cannot be applied to types '{ [b: string]: number; }' and '{ [a: string]: string; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(76,12): error TS2365: Operator '==' cannot be applied to types '{ [index: string]: C; }' and '{ [index: string]: Base; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(77,12): error TS2365: Operator '==' cannot be applied to types '{ [index: number]: C; }' and '{ [index: number]: Base; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(78,12): error TS2365: Operator '==' cannot be applied to types '{ [index: string]: Base; }' and '{ [index: number]: Derived; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(81,12): error TS2365: Operator '!=' cannot be applied to types '{ [a: string]: string; }' and '{ [b: string]: number; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(82,12): error TS2365: Operator '!=' cannot be applied to types '{ [index: string]: Base; }' and '{ [index: string]: C; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(83,12): error TS2365: Operator '!=' cannot be applied to types '{ [index: number]: Base; }' and '{ [index: number]: C; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(84,12): error TS2365: Operator '!=' cannot be applied to types '{ [index: number]: Derived; }' and '{ [index: string]: Base; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(86,12): error TS2365: Operator '!=' cannot be applied to types '{ [b: string]: number; }' and '{ [a: string]: string; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(87,12): error TS2365: Operator '!=' cannot be applied to types '{ [index: string]: C; }' and '{ [index: string]: Base; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(88,12): error TS2365: Operator '!=' cannot be applied to types '{ [index: number]: C; }' and '{ [index: number]: Base; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(89,12): error TS2365: Operator '!=' cannot be applied to types '{ [index: string]: Base; }' and '{ [index: number]: Derived; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(92,12): error TS2365: Operator '===' cannot be applied to types '{ [a: string]: string; }' and '{ [b: string]: number; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(93,12): error TS2365: Operator '===' cannot be applied to types '{ [index: string]: Base; }' and '{ [index: string]: C; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(94,12): error TS2365: Operator '===' cannot be applied to types '{ [index: number]: Base; }' and '{ [index: number]: C; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(95,12): error TS2365: Operator '===' cannot be applied to types '{ [index: number]: Derived; }' and '{ [index: string]: Base; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(97,12): error TS2365: Operator '===' cannot be applied to types '{ [b: string]: number; }' and '{ [a: string]: string; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(98,12): error TS2365: Operator '===' cannot be applied to types '{ [index: string]: C; }' and '{ [index: string]: Base; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(99,12): error TS2365: Operator '===' cannot be applied to types '{ [index: number]: C; }' and '{ [index: number]: Base; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(100,12): error TS2365: Operator '===' cannot be applied to types '{ [index: string]: Base; }' and '{ [index: number]: Derived; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(103,12): error TS2365: Operator '!==' cannot be applied to types '{ [a: string]: string; }' and '{ [b: string]: number; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(104,12): error TS2365: Operator '!==' cannot be applied to types '{ [index: string]: Base; }' and '{ [index: string]: C; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(105,12): error TS2365: Operator '!==' cannot be applied to types '{ [index: number]: Base; }' and '{ [index: number]: C; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(106,12): error TS2365: Operator '!==' cannot be applied to types '{ [index: number]: Derived; }' and '{ [index: string]: Base; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(108,12): error TS2365: Operator '!==' cannot be applied to types '{ [b: string]: number; }' and '{ [a: string]: string; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(109,12): error TS2365: Operator '!==' cannot be applied to types '{ [index: string]: C; }' and '{ [index: string]: Base; }'. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(110,12): error TS2365: Operator '!==' cannot be applied to types '{ [index: number]: C; }' and '{ [index: number]: Base; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(111,12): error TS2365: Operator '!==' cannot be applied to types '{ [index: string]: Base; }' and '{ [index: number]: Derived; }'. -==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts (64 errors) ==== +==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts (48 errors) ==== class Base { public a: string; } @@ -100,8 +84,6 @@ tests/cases/conformance/expressions/binaryOperators/comparisonOperator/compariso ~~~~~~~ !!! error TS2365: Operator '<' cannot be applied to types '{ [index: number]: Base; }' and '{ [index: number]: C; }'. var r1a4 = a4 < b4; - ~~~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types '{ [index: number]: Derived; }' and '{ [index: string]: Base; }'. var r1b1 = b1 < a1; ~~~~~~~ @@ -113,8 +95,6 @@ tests/cases/conformance/expressions/binaryOperators/comparisonOperator/compariso ~~~~~~~ !!! error TS2365: Operator '<' cannot be applied to types '{ [index: number]: C; }' and '{ [index: number]: Base; }'. var r1b4 = b4 < a4; - ~~~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types '{ [index: string]: Base; }' and '{ [index: number]: Derived; }'. // operator > var r2a1 = a1 > b1; @@ -127,8 +107,6 @@ tests/cases/conformance/expressions/binaryOperators/comparisonOperator/compariso ~~~~~~~ !!! error TS2365: Operator '>' cannot be applied to types '{ [index: number]: Base; }' and '{ [index: number]: C; }'. var r2a4 = a4 > b4; - ~~~~~~~ -!!! error TS2365: Operator '>' cannot be applied to types '{ [index: number]: Derived; }' and '{ [index: string]: Base; }'. var r2b1 = b1 > a1; ~~~~~~~ @@ -140,8 +118,6 @@ tests/cases/conformance/expressions/binaryOperators/comparisonOperator/compariso ~~~~~~~ !!! error TS2365: Operator '>' cannot be applied to types '{ [index: number]: C; }' and '{ [index: number]: Base; }'. var r2b4 = b4 > a4; - ~~~~~~~ -!!! error TS2365: Operator '>' cannot be applied to types '{ [index: string]: Base; }' and '{ [index: number]: Derived; }'. // operator <= var r3a1 = a1 <= b1; @@ -154,8 +130,6 @@ tests/cases/conformance/expressions/binaryOperators/comparisonOperator/compariso ~~~~~~~~ !!! error TS2365: Operator '<=' cannot be applied to types '{ [index: number]: Base; }' and '{ [index: number]: C; }'. var r3a4 = a4 <= b4; - ~~~~~~~~ -!!! error TS2365: Operator '<=' cannot be applied to types '{ [index: number]: Derived; }' and '{ [index: string]: Base; }'. var r3b1 = b1 <= a1; ~~~~~~~~ @@ -167,8 +141,6 @@ tests/cases/conformance/expressions/binaryOperators/comparisonOperator/compariso ~~~~~~~~ !!! error TS2365: Operator '<=' cannot be applied to types '{ [index: number]: C; }' and '{ [index: number]: Base; }'. var r3b4 = b4 <= a4; - ~~~~~~~~ -!!! error TS2365: Operator '<=' cannot be applied to types '{ [index: string]: Base; }' and '{ [index: number]: Derived; }'. // operator >= var r4a1 = a1 >= b1; @@ -181,8 +153,6 @@ tests/cases/conformance/expressions/binaryOperators/comparisonOperator/compariso ~~~~~~~~ !!! error TS2365: Operator '>=' cannot be applied to types '{ [index: number]: Base; }' and '{ [index: number]: C; }'. var r4a4 = a4 >= b4; - ~~~~~~~~ -!!! error TS2365: Operator '>=' cannot be applied to types '{ [index: number]: Derived; }' and '{ [index: string]: Base; }'. var r4b1 = b1 >= a1; ~~~~~~~~ @@ -194,8 +164,6 @@ tests/cases/conformance/expressions/binaryOperators/comparisonOperator/compariso ~~~~~~~~ !!! error TS2365: Operator '>=' cannot be applied to types '{ [index: number]: C; }' and '{ [index: number]: Base; }'. var r4b4 = b4 >= a4; - ~~~~~~~~ -!!! error TS2365: Operator '>=' cannot be applied to types '{ [index: string]: Base; }' and '{ [index: number]: Derived; }'. // operator == var r5a1 = a1 == b1; @@ -208,8 +176,6 @@ tests/cases/conformance/expressions/binaryOperators/comparisonOperator/compariso ~~~~~~~~ !!! error TS2365: Operator '==' cannot be applied to types '{ [index: number]: Base; }' and '{ [index: number]: C; }'. var r5a4 = a4 == b4; - ~~~~~~~~ -!!! error TS2365: Operator '==' cannot be applied to types '{ [index: number]: Derived; }' and '{ [index: string]: Base; }'. var r5b1 = b1 == a1; ~~~~~~~~ @@ -221,8 +187,6 @@ tests/cases/conformance/expressions/binaryOperators/comparisonOperator/compariso ~~~~~~~~ !!! error TS2365: Operator '==' cannot be applied to types '{ [index: number]: C; }' and '{ [index: number]: Base; }'. var r5b4 = b4 == a4; - ~~~~~~~~ -!!! error TS2365: Operator '==' cannot be applied to types '{ [index: string]: Base; }' and '{ [index: number]: Derived; }'. // operator != var r6a1 = a1 != b1; @@ -235,8 +199,6 @@ tests/cases/conformance/expressions/binaryOperators/comparisonOperator/compariso ~~~~~~~~ !!! error TS2365: Operator '!=' cannot be applied to types '{ [index: number]: Base; }' and '{ [index: number]: C; }'. var r6a4 = a4 != b4; - ~~~~~~~~ -!!! error TS2365: Operator '!=' cannot be applied to types '{ [index: number]: Derived; }' and '{ [index: string]: Base; }'. var r6b1 = b1 != a1; ~~~~~~~~ @@ -248,8 +210,6 @@ tests/cases/conformance/expressions/binaryOperators/comparisonOperator/compariso ~~~~~~~~ !!! error TS2365: Operator '!=' cannot be applied to types '{ [index: number]: C; }' and '{ [index: number]: Base; }'. var r6b4 = b4 != a4; - ~~~~~~~~ -!!! error TS2365: Operator '!=' cannot be applied to types '{ [index: string]: Base; }' and '{ [index: number]: Derived; }'. // operator === var r7a1 = a1 === b1; @@ -262,8 +222,6 @@ tests/cases/conformance/expressions/binaryOperators/comparisonOperator/compariso ~~~~~~~~~ !!! error TS2365: Operator '===' cannot be applied to types '{ [index: number]: Base; }' and '{ [index: number]: C; }'. var r7a4 = a4 === b4; - ~~~~~~~~~ -!!! error TS2365: Operator '===' cannot be applied to types '{ [index: number]: Derived; }' and '{ [index: string]: Base; }'. var r7b1 = b1 === a1; ~~~~~~~~~ @@ -275,8 +233,6 @@ tests/cases/conformance/expressions/binaryOperators/comparisonOperator/compariso ~~~~~~~~~ !!! error TS2365: Operator '===' cannot be applied to types '{ [index: number]: C; }' and '{ [index: number]: Base; }'. var r7b4 = b4 === a4; - ~~~~~~~~~ -!!! error TS2365: Operator '===' cannot be applied to types '{ [index: string]: Base; }' and '{ [index: number]: Derived; }'. // operator !== var r8a1 = a1 !== b1; @@ -289,8 +245,6 @@ tests/cases/conformance/expressions/binaryOperators/comparisonOperator/compariso ~~~~~~~~~ !!! error TS2365: Operator '!==' cannot be applied to types '{ [index: number]: Base; }' and '{ [index: number]: C; }'. var r8a4 = a4 !== b4; - ~~~~~~~~~ -!!! error TS2365: Operator '!==' cannot be applied to types '{ [index: number]: Derived; }' and '{ [index: string]: Base; }'. var r8b1 = b1 !== a1; ~~~~~~~~~ @@ -301,6 +255,4 @@ tests/cases/conformance/expressions/binaryOperators/comparisonOperator/compariso var r8b3 = b3 !== a3; ~~~~~~~~~ !!! error TS2365: Operator '!==' cannot be applied to types '{ [index: number]: C; }' and '{ [index: number]: Base; }'. - var r8b4 = b4 !== a4; - ~~~~~~~~~ -!!! error TS2365: Operator '!==' cannot be applied to types '{ [index: string]: Base; }' and '{ [index: number]: Derived; }'. \ No newline at end of file + var r8b4 = b4 !== a4; \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfObjectLiterals.errors.txt b/tests/baselines/reference/contextualTypingOfObjectLiterals.errors.txt deleted file mode 100644 index ac8063a4378..00000000000 --- a/tests/baselines/reference/contextualTypingOfObjectLiterals.errors.txt +++ /dev/null @@ -1,23 +0,0 @@ -tests/cases/compiler/contextualTypingOfObjectLiterals.ts(4,1): error TS2322: Type '{ x: string; }' is not assignable to type '{ [x: string]: string; }'. - Index signature is missing in type '{ x: string; }'. -tests/cases/compiler/contextualTypingOfObjectLiterals.ts(10,3): error TS2345: Argument of type '{ x: string; }' is not assignable to parameter of type '{ [s: string]: string; }'. - Index signature is missing in type '{ x: string; }'. - - -==== tests/cases/compiler/contextualTypingOfObjectLiterals.ts (2 errors) ==== - var obj1: { [x: string]: string; }; - var obj2 = {x: ""}; - obj1 = {}; // Ok - obj1 = obj2; // Error - indexer doesn't match - ~~~~ -!!! error TS2322: Type '{ x: string; }' is not assignable to type '{ [x: string]: string; }'. -!!! error TS2322: Index signature is missing in type '{ x: string; }'. - - function f(x: { [s: string]: string }) { } - - f({}); // Ok - f(obj1); // Ok - f(obj2); // Error - indexer doesn't match - ~~~~ -!!! error TS2345: Argument of type '{ x: string; }' is not assignable to parameter of type '{ [s: string]: string; }'. -!!! error TS2345: Index signature is missing in type '{ x: string; }'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfObjectLiterals.symbols b/tests/baselines/reference/contextualTypingOfObjectLiterals.symbols new file mode 100644 index 00000000000..afa34cfe481 --- /dev/null +++ b/tests/baselines/reference/contextualTypingOfObjectLiterals.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/contextualTypingOfObjectLiterals.ts === +var obj1: { [x: string]: string; }; +>obj1 : Symbol(obj1, Decl(contextualTypingOfObjectLiterals.ts, 0, 3)) +>x : Symbol(x, Decl(contextualTypingOfObjectLiterals.ts, 0, 13)) + +var obj2 = {x: ""}; +>obj2 : Symbol(obj2, Decl(contextualTypingOfObjectLiterals.ts, 1, 3)) +>x : Symbol(x, Decl(contextualTypingOfObjectLiterals.ts, 1, 12)) + +obj1 = {}; // Ok +>obj1 : Symbol(obj1, Decl(contextualTypingOfObjectLiterals.ts, 0, 3)) + +obj1 = obj2; // Error - indexer doesn't match +>obj1 : Symbol(obj1, Decl(contextualTypingOfObjectLiterals.ts, 0, 3)) +>obj2 : Symbol(obj2, Decl(contextualTypingOfObjectLiterals.ts, 1, 3)) + +function f(x: { [s: string]: string }) { } +>f : Symbol(f, Decl(contextualTypingOfObjectLiterals.ts, 3, 12)) +>x : Symbol(x, Decl(contextualTypingOfObjectLiterals.ts, 5, 11)) +>s : Symbol(s, Decl(contextualTypingOfObjectLiterals.ts, 5, 17)) + +f({}); // Ok +>f : Symbol(f, Decl(contextualTypingOfObjectLiterals.ts, 3, 12)) + +f(obj1); // Ok +>f : Symbol(f, Decl(contextualTypingOfObjectLiterals.ts, 3, 12)) +>obj1 : Symbol(obj1, Decl(contextualTypingOfObjectLiterals.ts, 0, 3)) + +f(obj2); // Error - indexer doesn't match +>f : Symbol(f, Decl(contextualTypingOfObjectLiterals.ts, 3, 12)) +>obj2 : Symbol(obj2, Decl(contextualTypingOfObjectLiterals.ts, 1, 3)) + diff --git a/tests/baselines/reference/contextualTypingOfObjectLiterals.types b/tests/baselines/reference/contextualTypingOfObjectLiterals.types new file mode 100644 index 00000000000..5b3068e8029 --- /dev/null +++ b/tests/baselines/reference/contextualTypingOfObjectLiterals.types @@ -0,0 +1,41 @@ +=== tests/cases/compiler/contextualTypingOfObjectLiterals.ts === +var obj1: { [x: string]: string; }; +>obj1 : { [x: string]: string; } +>x : string + +var obj2 = {x: ""}; +>obj2 : { x: string; } +>{x: ""} : { x: string; } +>x : string +>"" : string + +obj1 = {}; // Ok +>obj1 = {} : { [x: string]: undefined; } +>obj1 : { [x: string]: string; } +>{} : { [x: string]: undefined; } + +obj1 = obj2; // Error - indexer doesn't match +>obj1 = obj2 : { x: string; } +>obj1 : { [x: string]: string; } +>obj2 : { x: string; } + +function f(x: { [s: string]: string }) { } +>f : (x: { [s: string]: string; }) => void +>x : { [s: string]: string; } +>s : string + +f({}); // Ok +>f({}) : void +>f : (x: { [s: string]: string; }) => void +>{} : { [x: string]: undefined; } + +f(obj1); // Ok +>f(obj1) : void +>f : (x: { [s: string]: string; }) => void +>obj1 : { [x: string]: string; } + +f(obj2); // Error - indexer doesn't match +>f(obj2) : void +>f : (x: { [s: string]: string; }) => void +>obj2 : { x: string; } + diff --git a/tests/baselines/reference/indexerAssignability.errors.txt b/tests/baselines/reference/indexerAssignability.errors.txt deleted file mode 100644 index 44c2184517e..00000000000 --- a/tests/baselines/reference/indexerAssignability.errors.txt +++ /dev/null @@ -1,28 +0,0 @@ -tests/cases/compiler/indexerAssignability.ts(5,1): error TS2322: Type '{ [n: number]: string; }' is not assignable to type '{ [s: string]: string; }'. - Index signature is missing in type '{ [n: number]: string; }'. -tests/cases/compiler/indexerAssignability.ts(6,1): error TS2322: Type '{}' is not assignable to type '{ [s: string]: string; }'. - Index signature is missing in type '{}'. -tests/cases/compiler/indexerAssignability.ts(8,1): error TS2322: Type '{}' is not assignable to type '{ [n: number]: string; }'. - Index signature is missing in type '{}'. - - -==== tests/cases/compiler/indexerAssignability.ts (3 errors) ==== - var a: { [s: string]: string; }; - var b: { [n: number]: string; }; - var c: {}; - - a = b; - ~ -!!! error TS2322: Type '{ [n: number]: string; }' is not assignable to type '{ [s: string]: string; }'. -!!! error TS2322: Index signature is missing in type '{ [n: number]: string; }'. - a = c; - ~ -!!! error TS2322: Type '{}' is not assignable to type '{ [s: string]: string; }'. -!!! error TS2322: Index signature is missing in type '{}'. - b = a; - b = c; - ~ -!!! error TS2322: Type '{}' is not assignable to type '{ [n: number]: string; }'. -!!! error TS2322: Index signature is missing in type '{}'. - c = a; - c = b; \ No newline at end of file diff --git a/tests/baselines/reference/indexerAssignability.symbols b/tests/baselines/reference/indexerAssignability.symbols new file mode 100644 index 00000000000..379a2885e2c --- /dev/null +++ b/tests/baselines/reference/indexerAssignability.symbols @@ -0,0 +1,36 @@ +=== tests/cases/compiler/indexerAssignability.ts === +var a: { [s: string]: string; }; +>a : Symbol(a, Decl(indexerAssignability.ts, 0, 3)) +>s : Symbol(s, Decl(indexerAssignability.ts, 0, 10)) + +var b: { [n: number]: string; }; +>b : Symbol(b, Decl(indexerAssignability.ts, 1, 3)) +>n : Symbol(n, Decl(indexerAssignability.ts, 1, 10)) + +var c: {}; +>c : Symbol(c, Decl(indexerAssignability.ts, 2, 3)) + +a = b; +>a : Symbol(a, Decl(indexerAssignability.ts, 0, 3)) +>b : Symbol(b, Decl(indexerAssignability.ts, 1, 3)) + +a = c; +>a : Symbol(a, Decl(indexerAssignability.ts, 0, 3)) +>c : Symbol(c, Decl(indexerAssignability.ts, 2, 3)) + +b = a; +>b : Symbol(b, Decl(indexerAssignability.ts, 1, 3)) +>a : Symbol(a, Decl(indexerAssignability.ts, 0, 3)) + +b = c; +>b : Symbol(b, Decl(indexerAssignability.ts, 1, 3)) +>c : Symbol(c, Decl(indexerAssignability.ts, 2, 3)) + +c = a; +>c : Symbol(c, Decl(indexerAssignability.ts, 2, 3)) +>a : Symbol(a, Decl(indexerAssignability.ts, 0, 3)) + +c = b; +>c : Symbol(c, Decl(indexerAssignability.ts, 2, 3)) +>b : Symbol(b, Decl(indexerAssignability.ts, 1, 3)) + diff --git a/tests/baselines/reference/indexerAssignability.types b/tests/baselines/reference/indexerAssignability.types new file mode 100644 index 00000000000..bd301b59224 --- /dev/null +++ b/tests/baselines/reference/indexerAssignability.types @@ -0,0 +1,42 @@ +=== tests/cases/compiler/indexerAssignability.ts === +var a: { [s: string]: string; }; +>a : { [s: string]: string; } +>s : string + +var b: { [n: number]: string; }; +>b : { [n: number]: string; } +>n : number + +var c: {}; +>c : {} + +a = b; +>a = b : { [n: number]: string; } +>a : { [s: string]: string; } +>b : { [n: number]: string; } + +a = c; +>a = c : {} +>a : { [s: string]: string; } +>c : {} + +b = a; +>b = a : { [s: string]: string; } +>b : { [n: number]: string; } +>a : { [s: string]: string; } + +b = c; +>b = c : {} +>b : { [n: number]: string; } +>c : {} + +c = a; +>c = a : { [s: string]: string; } +>c : {} +>a : { [s: string]: string; } + +c = b; +>c = b : { [n: number]: string; } +>c : {} +>b : { [n: number]: string; } + diff --git a/tests/baselines/reference/numericIndexerConstraint2.errors.txt b/tests/baselines/reference/numericIndexerConstraint2.errors.txt index 385efbcead2..5c0337acc32 100644 --- a/tests/baselines/reference/numericIndexerConstraint2.errors.txt +++ b/tests/baselines/reference/numericIndexerConstraint2.errors.txt @@ -1,5 +1,6 @@ tests/cases/compiler/numericIndexerConstraint2.ts(4,1): error TS2322: Type '{ one: number; }' is not assignable to type '{ [index: string]: Foo; }'. - Index signature is missing in type '{ one: number; }'. + Property 'one' is incompatible with index signature. + Type 'number' is not assignable to type 'Foo'. ==== tests/cases/compiler/numericIndexerConstraint2.ts (1 errors) ==== @@ -9,4 +10,5 @@ tests/cases/compiler/numericIndexerConstraint2.ts(4,1): error TS2322: Type '{ on x = a; ~ !!! error TS2322: Type '{ one: number; }' is not assignable to type '{ [index: string]: Foo; }'. -!!! error TS2322: Index signature is missing in type '{ one: number; }'. \ No newline at end of file +!!! error TS2322: Property 'one' is incompatible with index signature. +!!! error TS2322: Type 'number' is not assignable to type 'Foo'. \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexerConstraint5.errors.txt b/tests/baselines/reference/numericIndexerConstraint5.errors.txt index 98acc65eeb7..cb888de08c4 100644 --- a/tests/baselines/reference/numericIndexerConstraint5.errors.txt +++ b/tests/baselines/reference/numericIndexerConstraint5.errors.txt @@ -1,5 +1,6 @@ tests/cases/compiler/numericIndexerConstraint5.ts(2,5): error TS2322: Type '{ 0: Date; name: string; }' is not assignable to type '{ [name: number]: string; }'. - Index signature is missing in type '{ 0: Date; name: string; }'. + Property '0' is incompatible with index signature. + Type 'Date' is not assignable to type 'string'. ==== tests/cases/compiler/numericIndexerConstraint5.ts (1 errors) ==== @@ -7,4 +8,5 @@ tests/cases/compiler/numericIndexerConstraint5.ts(2,5): error TS2322: Type '{ 0: var z: { [name: number]: string } = x; ~ !!! error TS2322: Type '{ 0: Date; name: string; }' is not assignable to type '{ [name: number]: string; }'. -!!! error TS2322: Index signature is missing in type '{ 0: Date; name: string; }'. \ No newline at end of file +!!! error TS2322: Property '0' is incompatible with index signature. +!!! error TS2322: Type 'Date' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/stringIndexerAssignments1.errors.txt b/tests/baselines/reference/stringIndexerAssignments1.errors.txt index 908371bc7dd..ac99b239779 100644 --- a/tests/baselines/reference/stringIndexerAssignments1.errors.txt +++ b/tests/baselines/reference/stringIndexerAssignments1.errors.txt @@ -1,18 +1,13 @@ -tests/cases/compiler/stringIndexerAssignments1.ts(4,1): error TS2322: Type '{ one: string; }' is not assignable to type '{ [index: string]: string; one: string; }'. - Index signature is missing in type '{ one: string; }'. tests/cases/compiler/stringIndexerAssignments1.ts(5,1): error TS2322: Type '{ one: number; two: string; }' is not assignable to type '{ [index: string]: string; one: string; }'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'string'. -==== tests/cases/compiler/stringIndexerAssignments1.ts (2 errors) ==== +==== tests/cases/compiler/stringIndexerAssignments1.ts (1 errors) ==== var x: { [index: string]: string; one: string; }; var a: { one: string; }; var b: { one: number; two: string; }; x = a; - ~ -!!! error TS2322: Type '{ one: string; }' is not assignable to type '{ [index: string]: string; one: string; }'. -!!! error TS2322: Index signature is missing in type '{ one: string; }'. x = b; // error ~ !!! error TS2322: Type '{ one: number; two: string; }' is not assignable to type '{ [index: string]: string; one: string; }'.