2014-07-13 01:04:16 +02:00
|
|
|
//// [commaOperatorInvalidAssignmentType.ts]
|
|
|
|
var BOOLEAN: boolean;
|
|
|
|
var NUMBER: number;
|
|
|
|
var STRING: string;
|
|
|
|
|
|
|
|
var resultIsBoolean: boolean
|
|
|
|
var resultIsNumber: number
|
|
|
|
var resultIsString: string
|
|
|
|
|
|
|
|
//Expect errors when the results type is different form the second operand
|
|
|
|
resultIsBoolean = (BOOLEAN, STRING);
|
|
|
|
resultIsBoolean = (BOOLEAN, NUMBER);
|
|
|
|
|
|
|
|
resultIsNumber = (NUMBER, BOOLEAN);
|
|
|
|
resultIsNumber = (NUMBER, STRING);
|
|
|
|
|
|
|
|
resultIsString = (STRING, BOOLEAN);
|
|
|
|
resultIsString = (STRING, NUMBER);
|
|
|
|
|
|
|
|
|
|
|
|
//// [commaOperatorInvalidAssignmentType.js]
|
|
|
|
var BOOLEAN;
|
|
|
|
var NUMBER;
|
|
|
|
var STRING;
|
|
|
|
var resultIsBoolean;
|
|
|
|
var resultIsNumber;
|
|
|
|
var resultIsString;
|
2014-08-16 00:49:09 +02:00
|
|
|
//Expect errors when the results type is different form the second operand
|
2014-07-13 01:04:16 +02:00
|
|
|
resultIsBoolean = (BOOLEAN, STRING);
|
|
|
|
resultIsBoolean = (BOOLEAN, NUMBER);
|
|
|
|
resultIsNumber = (NUMBER, BOOLEAN);
|
|
|
|
resultIsNumber = (NUMBER, STRING);
|
|
|
|
resultIsString = (STRING, BOOLEAN);
|
|
|
|
resultIsString = (STRING, NUMBER);
|