Accepting new baselines

This commit is contained in:
Anders Hejlsberg 2016-02-09 14:33:24 -08:00
parent 1d428b9fe0
commit 837e6dbda3
11 changed files with 163 additions and 117 deletions

View File

@ -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

View File

@ -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; }'.
var r8b4 = b4 !== a4;

View File

@ -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; }'.

View File

@ -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))

View File

@ -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; }

View File

@ -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;

View File

@ -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))

View File

@ -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; }

View File

@ -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; }'.
!!! error TS2322: Property 'one' is incompatible with index signature.
!!! error TS2322: Type 'number' is not assignable to type 'Foo'.

View File

@ -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; }'.
!!! error TS2322: Property '0' is incompatible with index signature.
!!! error TS2322: Type 'Date' is not assignable to type 'string'.

View File

@ -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; }'.