TypeScript/tests/baselines/reference/inOperatorWithInvalidOperands.errors.txt

103 lines
7.8 KiB
Plaintext
Raw Normal View History

2015-02-05 04:18:54 +01:00
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(12,11): error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(13,11): error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(14,11): error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(16,11): error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(17,11): error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(19,11): error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(20,11): error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(30,16): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(31,16): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(32,16): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(33,16): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(34,16): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(35,16): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(36,16): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(37,16): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
2014-10-23 01:58:13 +02:00
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(38,16): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(39,17): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
2015-02-05 04:18:54 +01:00
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(43,11): error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
2014-10-23 01:58:13 +02:00
tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(43,17): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
2015-01-21 22:55:07 +01:00
==== tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts (19 errors) ====
2014-07-13 01:04:16 +02:00
enum E { a }
var x: any;
// invalid left operands
// the left operand is required to be of type Any, the String primitive type, or the Number primitive type
var a1: boolean;
var a2: void;
var a3: {};
var a4: E
var ra1 = a1 in x;
~~
2015-02-05 04:18:54 +01:00
!!! error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
2014-07-13 01:04:16 +02:00
var ra2 = a2 in x;
~~
2015-02-05 04:18:54 +01:00
!!! error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
2014-07-13 01:04:16 +02:00
var ra3 = a3 in x;
~~
2015-02-05 04:18:54 +01:00
!!! error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
2014-07-13 01:04:16 +02:00
var ra4 = a4 in x;
var ra5 = null in x;
~~~~
2015-02-05 04:18:54 +01:00
!!! error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
2014-07-13 01:04:16 +02:00
var ra6 = undefined in x;
~~~~~~~~~
2015-02-05 04:18:54 +01:00
!!! error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
2014-07-13 01:04:16 +02:00
var ra7 = E.a in x;
var ra8 = false in x;
~~~~~
2015-02-05 04:18:54 +01:00
!!! error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
2014-07-13 01:04:16 +02:00
var ra9 = {} in x;
~~
2015-02-05 04:18:54 +01:00
!!! error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
2014-07-13 01:04:16 +02:00
// invalid right operands
// the right operand is required to be of type Any, an object type, or a type parameter type
var b1: number;
var b2: boolean;
var b3: string;
var b4: void;
2014-10-23 01:58:13 +02:00
var b5: string | number;
2014-07-13 01:04:16 +02:00
var rb1 = x in b1;
~~
!!! error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
2014-07-13 01:04:16 +02:00
var rb2 = x in b2;
~~
!!! error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
2014-07-13 01:04:16 +02:00
var rb3 = x in b3;
~~
!!! error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
2014-07-13 01:04:16 +02:00
var rb4 = x in b4;
~~
!!! error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
2014-10-23 01:58:13 +02:00
var rb5 = x in b5;
~~
!!! error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
var rb6 = x in 0;
2014-07-13 01:04:16 +02:00
~
!!! error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
2014-10-23 01:58:13 +02:00
var rb7 = x in false;
2014-07-13 01:04:16 +02:00
~~~~~
!!! error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
2014-10-23 01:58:13 +02:00
var rb8 = x in '';
2014-07-13 01:04:16 +02:00
~~
!!! error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
2014-10-23 01:58:13 +02:00
var rb9 = x in null;
2014-07-13 01:04:16 +02:00
~~~~
!!! error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
2014-10-23 01:58:13 +02:00
var rb10 = x in undefined;
~~~~~~~~~
!!! error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
2014-07-13 01:04:16 +02:00
2014-10-23 01:58:13 +02:00
2014-07-13 01:04:16 +02:00
// both operands are invalid
var rc1 = {} in '';
~~
2015-02-05 04:18:54 +01:00
!!! error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
2014-07-13 01:04:16 +02:00
~~
!!! error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter