60 lines
No EOL
2.6 KiB
Text
60 lines
No EOL
2.6 KiB
Text
tests/cases/conformance/expressions/literals/literals.ts(20,9): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher.
|
|
tests/cases/conformance/expressions/literals/literals.ts(25,10): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher.
|
|
tests/cases/conformance/expressions/literals/literals.ts(9,10): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/literals/literals.ts(9,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/literals/literals.ts(10,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/literals/literals.ts(10,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
|
|
|
|
|
==== tests/cases/conformance/expressions/literals/literals.ts (6 errors) ====
|
|
|
|
//typeof null is Null
|
|
//typeof true is Boolean
|
|
//typeof false is Boolean
|
|
//typeof numeric literal is Number
|
|
//typeof string literal is String
|
|
//typeof regex literal is Regex
|
|
|
|
var nu = null / null;
|
|
~~~~
|
|
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
|
~~~~
|
|
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
|
var u = undefined / undefined;
|
|
~~~~~~~~~
|
|
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
|
~~~~~~~~~
|
|
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
|
|
|
var b: boolean;
|
|
var b = true;
|
|
var b = false;
|
|
|
|
var n: number;
|
|
var n = 1;
|
|
var n = 1.0;
|
|
var n = 1e4;
|
|
var n = 001; // Error in ES5
|
|
~~~
|
|
!!! error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher.
|
|
var n = 0x1;
|
|
var n = -1;
|
|
var n = -1.0;
|
|
var n = -1e-4;
|
|
var n = -003; // Error in ES5
|
|
~~~
|
|
!!! error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher.
|
|
var n = -0x1;
|
|
|
|
var s: string;
|
|
var s = '';
|
|
var s = "";
|
|
var s = 'foo\
|
|
bar';
|
|
var s = "foo\
|
|
bar";
|
|
|
|
var r: RegExp;
|
|
var r = /what/;
|
|
var r = /\\\\/;
|
|
|