mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 21:53:42 -06:00
Accepted baselines.
This commit is contained in:
parent
043e50ce1c
commit
f96c058c75
@ -0,0 +1,60 @@
|
||||
binaryIntegerLiteral.ts(25,1): error TS7053: Element implicitly has an 'any' type because expression of type '"0b11010"' can't be used to index type '{ 26: string; a: number; bin1: number; b: number; Infinity: boolean; }'.
|
||||
Property '0b11010' does not exist on type '{ 26: string; a: number; bin1: number; b: number; Infinity: boolean; }'.
|
||||
binaryIntegerLiteral.ts(34,1): error TS7053: Element implicitly has an 'any' type because expression of type '"0B11010"' can't be used to index type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'.
|
||||
Property '0B11010' does not exist on type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'.
|
||||
binaryIntegerLiteral.ts(40,1): error TS7053: Element implicitly has an 'any' type because expression of type '"Infinity"' can't be used to index type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'.
|
||||
Property 'Infinity' does not exist on type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'.
|
||||
|
||||
|
||||
==== binaryIntegerLiteral.ts (3 errors) ====
|
||||
var bin1 = 0b11010;
|
||||
var bin2 = 0B11010;
|
||||
var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111;
|
||||
var bin4 = 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111;
|
||||
|
||||
var obj1 = {
|
||||
0b11010: "Hello",
|
||||
a: bin1,
|
||||
bin1,
|
||||
b: 0b11010,
|
||||
0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true,
|
||||
}
|
||||
|
||||
var obj2 = {
|
||||
0B11010: "World",
|
||||
a: bin2,
|
||||
bin2,
|
||||
b: 0B11010,
|
||||
0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false,
|
||||
}
|
||||
|
||||
obj1[0b11010]; // string
|
||||
obj1[26]; // string
|
||||
obj1["26"]; // string
|
||||
obj1["0b11010"]; // any
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS7053: Element implicitly has an 'any' type because expression of type '"0b11010"' can't be used to index type '{ 26: string; a: number; bin1: number; b: number; Infinity: boolean; }'.
|
||||
!!! error TS7053: Property '0b11010' does not exist on type '{ 26: string; a: number; bin1: number; b: number; Infinity: boolean; }'.
|
||||
obj1["a"]; // number
|
||||
obj1["b"]; // number
|
||||
obj1["bin1"]; // number
|
||||
obj1["Infinity"]; // boolean
|
||||
|
||||
obj2[0B11010]; // string
|
||||
obj2[26]; // string
|
||||
obj2["26"]; // string
|
||||
obj2["0B11010"]; // any
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS7053: Element implicitly has an 'any' type because expression of type '"0B11010"' can't be used to index type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'.
|
||||
!!! error TS7053: Property '0B11010' does not exist on type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'.
|
||||
obj2["a"]; // number
|
||||
obj2["b"]; // number
|
||||
obj2["bin2"]; // number
|
||||
obj2[9.671406556917009e+24]; // boolean
|
||||
obj2["9.671406556917009e+24"]; // boolean
|
||||
obj2["Infinity"]; // any
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS7053: Element implicitly has an 'any' type because expression of type '"Infinity"' can't be used to index type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'.
|
||||
!!! error TS7053: Property 'Infinity' does not exist on type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'.
|
||||
|
||||
|
||||
@ -45,6 +45,7 @@ obj2["Infinity"]; // any
|
||||
|
||||
|
||||
//// [binaryIntegerLiteral.js]
|
||||
"use strict";
|
||||
var bin1 = 0b11010;
|
||||
var bin2 = 0B11010;
|
||||
var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111;
|
||||
|
||||
@ -120,7 +120,8 @@ obj1["26"]; // string
|
||||
> : ^^^^
|
||||
|
||||
obj1["0b11010"]; // any
|
||||
>obj1["0b11010"] : error
|
||||
>obj1["0b11010"] : any
|
||||
> : ^^^
|
||||
>obj1 : { 26: string; a: number; bin1: number; b: number; Infinity: boolean; }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
>"0b11010" : "0b11010"
|
||||
@ -183,7 +184,8 @@ obj2["26"]; // string
|
||||
> : ^^^^
|
||||
|
||||
obj2["0B11010"]; // any
|
||||
>obj2["0B11010"] : error
|
||||
>obj2["0B11010"] : any
|
||||
> : ^^^
|
||||
>obj2 : { 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
>"0B11010" : "0B11010"
|
||||
@ -230,7 +232,8 @@ obj2["9.671406556917009e+24"]; // boolean
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
obj2["Infinity"]; // any
|
||||
>obj2["Infinity"] : error
|
||||
>obj2["Infinity"] : any
|
||||
> : ^^^
|
||||
>obj2 : { 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
>"Infinity" : "Infinity"
|
||||
|
||||
@ -1,8 +1,14 @@
|
||||
error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
|
||||
binaryIntegerLiteral.ts(25,1): error TS7053: Element implicitly has an 'any' type because expression of type '"0b11010"' can't be used to index type '{ 26: string; a: number; bin1: number; b: number; Infinity: boolean; }'.
|
||||
Property '0b11010' does not exist on type '{ 26: string; a: number; bin1: number; b: number; Infinity: boolean; }'.
|
||||
binaryIntegerLiteral.ts(34,1): error TS7053: Element implicitly has an 'any' type because expression of type '"0B11010"' can't be used to index type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'.
|
||||
Property '0B11010' does not exist on type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'.
|
||||
binaryIntegerLiteral.ts(40,1): error TS7053: Element implicitly has an 'any' type because expression of type '"Infinity"' can't be used to index type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'.
|
||||
Property 'Infinity' does not exist on type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'.
|
||||
|
||||
|
||||
!!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
|
||||
==== binaryIntegerLiteral.ts (0 errors) ====
|
||||
==== binaryIntegerLiteral.ts (3 errors) ====
|
||||
var bin1 = 0b11010;
|
||||
var bin2 = 0B11010;
|
||||
var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111;
|
||||
@ -28,6 +34,9 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in Typ
|
||||
obj1[26]; // string
|
||||
obj1["26"]; // string
|
||||
obj1["0b11010"]; // any
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS7053: Element implicitly has an 'any' type because expression of type '"0b11010"' can't be used to index type '{ 26: string; a: number; bin1: number; b: number; Infinity: boolean; }'.
|
||||
!!! error TS7053: Property '0b11010' does not exist on type '{ 26: string; a: number; bin1: number; b: number; Infinity: boolean; }'.
|
||||
obj1["a"]; // number
|
||||
obj1["b"]; // number
|
||||
obj1["bin1"]; // number
|
||||
@ -37,11 +46,17 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in Typ
|
||||
obj2[26]; // string
|
||||
obj2["26"]; // string
|
||||
obj2["0B11010"]; // any
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS7053: Element implicitly has an 'any' type because expression of type '"0B11010"' can't be used to index type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'.
|
||||
!!! error TS7053: Property '0B11010' does not exist on type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'.
|
||||
obj2["a"]; // number
|
||||
obj2["b"]; // number
|
||||
obj2["bin2"]; // number
|
||||
obj2[9.671406556917009e+24]; // boolean
|
||||
obj2["9.671406556917009e+24"]; // boolean
|
||||
obj2["Infinity"]; // any
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS7053: Element implicitly has an 'any' type because expression of type '"Infinity"' can't be used to index type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'.
|
||||
!!! error TS7053: Property 'Infinity' does not exist on type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'.
|
||||
|
||||
|
||||
@ -45,6 +45,7 @@ obj2["Infinity"]; // any
|
||||
|
||||
|
||||
//// [binaryIntegerLiteral.js]
|
||||
"use strict";
|
||||
var bin1 = 26;
|
||||
var bin2 = 26;
|
||||
var bin3 = 9.671406556917009e+24;
|
||||
|
||||
61
tests/baselines/reference/binaryIntegerLiteralES6.errors.txt
Normal file
61
tests/baselines/reference/binaryIntegerLiteralES6.errors.txt
Normal file
@ -0,0 +1,61 @@
|
||||
binaryIntegerLiteralES6.ts(25,1): error TS7053: Element implicitly has an 'any' type because expression of type '"0b11010"' can't be used to index type '{ 26: string; a: number; bin1: number; b: number; Infinity: boolean; }'.
|
||||
Property '0b11010' does not exist on type '{ 26: string; a: number; bin1: number; b: number; Infinity: boolean; }'.
|
||||
binaryIntegerLiteralES6.ts(34,1): error TS7053: Element implicitly has an 'any' type because expression of type '"0B11010"' can't be used to index type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'.
|
||||
Property '0B11010' does not exist on type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'.
|
||||
binaryIntegerLiteralES6.ts(40,1): error TS7053: Element implicitly has an 'any' type because expression of type '"Infinity"' can't be used to index type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'.
|
||||
Property 'Infinity' does not exist on type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'.
|
||||
|
||||
|
||||
==== binaryIntegerLiteralES6.ts (3 errors) ====
|
||||
var bin1 = 0b11010;
|
||||
var bin2 = 0B11010;
|
||||
var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111;
|
||||
var bin4 = 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111;
|
||||
|
||||
var obj1 = {
|
||||
0b11010: "Hello",
|
||||
a: bin1,
|
||||
bin1,
|
||||
b: 0b11010,
|
||||
0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true,
|
||||
}
|
||||
|
||||
var obj2 = {
|
||||
0B11010: "World",
|
||||
a: bin2,
|
||||
bin2,
|
||||
b: 0B11010,
|
||||
0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false,
|
||||
}
|
||||
|
||||
obj1[0b11010]; // string
|
||||
obj1[26]; // string
|
||||
obj1["26"]; // string
|
||||
obj1["0b11010"]; // any
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS7053: Element implicitly has an 'any' type because expression of type '"0b11010"' can't be used to index type '{ 26: string; a: number; bin1: number; b: number; Infinity: boolean; }'.
|
||||
!!! error TS7053: Property '0b11010' does not exist on type '{ 26: string; a: number; bin1: number; b: number; Infinity: boolean; }'.
|
||||
obj1["a"]; // number
|
||||
obj1["b"]; // number
|
||||
obj1["bin1"]; // number
|
||||
obj1["Infinity"]; // boolean
|
||||
|
||||
obj2[0B11010]; // string
|
||||
obj2[26]; // string
|
||||
obj2["26"]; // string
|
||||
obj2["0B11010"]; // any
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS7053: Element implicitly has an 'any' type because expression of type '"0B11010"' can't be used to index type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'.
|
||||
!!! error TS7053: Property '0B11010' does not exist on type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'.
|
||||
obj2["a"]; // number
|
||||
obj2["b"]; // number
|
||||
obj2["bin2"]; // number
|
||||
obj2[9.671406556917009e+24]; // boolean
|
||||
obj2["9.671406556917009e+24"]; // boolean
|
||||
obj2["Infinity"]; // any
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS7053: Element implicitly has an 'any' type because expression of type '"Infinity"' can't be used to index type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'.
|
||||
!!! error TS7053: Property 'Infinity' does not exist on type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'.
|
||||
|
||||
|
||||
|
||||
@ -46,6 +46,7 @@ obj2["Infinity"]; // any
|
||||
|
||||
|
||||
//// [binaryIntegerLiteralES6.js]
|
||||
"use strict";
|
||||
var bin1 = 0b11010;
|
||||
var bin2 = 0B11010;
|
||||
var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111;
|
||||
|
||||
@ -120,7 +120,8 @@ obj1["26"]; // string
|
||||
> : ^^^^
|
||||
|
||||
obj1["0b11010"]; // any
|
||||
>obj1["0b11010"] : error
|
||||
>obj1["0b11010"] : any
|
||||
> : ^^^
|
||||
>obj1 : { 26: string; a: number; bin1: number; b: number; Infinity: boolean; }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
>"0b11010" : "0b11010"
|
||||
@ -183,7 +184,8 @@ obj2["26"]; // string
|
||||
> : ^^^^
|
||||
|
||||
obj2["0B11010"]; // any
|
||||
>obj2["0B11010"] : error
|
||||
>obj2["0B11010"] : any
|
||||
> : ^^^
|
||||
>obj2 : { 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
>"0B11010" : "0B11010"
|
||||
@ -230,7 +232,8 @@ obj2["9.671406556917009e+24"]; // boolean
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
obj2["Infinity"]; // any
|
||||
>obj2["Infinity"] : error
|
||||
>obj2["Infinity"] : any
|
||||
> : ^^^
|
||||
>obj2 : { 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
>"Infinity" : "Infinity"
|
||||
|
||||
@ -13,6 +13,7 @@ var obj1 = {
|
||||
|
||||
|
||||
//// [binaryIntegerLiteralError.js]
|
||||
"use strict";
|
||||
// error
|
||||
var bin1 = 0B110;
|
||||
2110;
|
||||
|
||||
@ -0,0 +1,45 @@
|
||||
contextualTypeWithUnionTypeCallSignatures.ts(33,54): error TS7006: Parameter 'a' implicitly has an 'any' type.
|
||||
contextualTypeWithUnionTypeCallSignatures.ts(36,54): error TS7006: Parameter 'a' implicitly has an 'any' type.
|
||||
|
||||
|
||||
==== contextualTypeWithUnionTypeCallSignatures.ts (2 errors) ====
|
||||
//When used as a contextual type, a union type U has those members that are present in any of
|
||||
// its constituent types, with types that are unions of the respective members in the constituent types.
|
||||
|
||||
// Let S be the set of types in U that have call signatures.
|
||||
// If S is not empty and the sets of call signatures of the types in S are identical ignoring return types,
|
||||
// U has the same set of call signatures, but with return types that are unions of the return types of the respective call signatures from each type in S.
|
||||
|
||||
interface IWithNoCallSignatures {
|
||||
foo: string;
|
||||
}
|
||||
interface IWithCallSignatures {
|
||||
(a: number): string;
|
||||
}
|
||||
interface IWithCallSignatures2 {
|
||||
(a: number): number;
|
||||
}
|
||||
interface IWithCallSignatures3 {
|
||||
(b: string): number;
|
||||
}
|
||||
interface IWithCallSignatures4 {
|
||||
(a: number): string;
|
||||
(a: string, b: number): number;
|
||||
}
|
||||
|
||||
// With no call signature | callSignatures
|
||||
var x: IWithNoCallSignatures | IWithCallSignatures = a => a.toString();
|
||||
|
||||
// With call signatures with different return type
|
||||
var x2: IWithCallSignatures | IWithCallSignatures2 = a => a.toString(); // Like iWithCallSignatures
|
||||
var x2: IWithCallSignatures | IWithCallSignatures2 = a => a; // Like iWithCallSignatures2
|
||||
|
||||
// With call signatures of mismatching parameter type
|
||||
var x3: IWithCallSignatures | IWithCallSignatures3 = a => /*here a should be any*/ a.toString();
|
||||
~
|
||||
!!! error TS7006: Parameter 'a' implicitly has an 'any' type.
|
||||
|
||||
// With call signature count mismatch
|
||||
var x4: IWithCallSignatures | IWithCallSignatures4 = a => /*here a should be any*/ a.toString();
|
||||
~
|
||||
!!! error TS7006: Parameter 'a' implicitly has an 'any' type.
|
||||
@ -39,6 +39,7 @@ var x3: IWithCallSignatures | IWithCallSignatures3 = a => /*here a should be any
|
||||
var x4: IWithCallSignatures | IWithCallSignatures4 = a => /*here a should be any*/ a.toString();
|
||||
|
||||
//// [contextualTypeWithUnionTypeCallSignatures.js]
|
||||
"use strict";
|
||||
//When used as a contextual type, a union type U has those members that are present in any of
|
||||
// its constituent types, with types that are unions of the respective members in the constituent types.
|
||||
// With no call signature | callSignatures
|
||||
|
||||
@ -84,7 +84,5 @@ var x4: IWithCallSignatures | IWithCallSignatures4 = a => /*here a should be any
|
||||
>IWithCallSignatures : Symbol(IWithCallSignatures, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 9, 1))
|
||||
>IWithCallSignatures4 : Symbol(IWithCallSignatures4, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 18, 1))
|
||||
>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 35, 52))
|
||||
>a.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --))
|
||||
>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 35, 52))
|
||||
>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --))
|
||||
|
||||
|
||||
@ -91,8 +91,11 @@ var x3: IWithCallSignatures | IWithCallSignatures3 = a => /*here a should be any
|
||||
>a => /*here a should be any*/ a.toString() : (a: any) => any
|
||||
> : ^ ^^^^^^^^^^^^^
|
||||
>a : any
|
||||
> : ^^^
|
||||
>a.toString() : any
|
||||
> : ^^^
|
||||
>a.toString : any
|
||||
> : ^^^
|
||||
>a : any
|
||||
> : ^^^
|
||||
>toString : any
|
||||
@ -102,16 +105,16 @@ var x3: IWithCallSignatures | IWithCallSignatures3 = a => /*here a should be any
|
||||
var x4: IWithCallSignatures | IWithCallSignatures4 = a => /*here a should be any*/ a.toString();
|
||||
>x4 : IWithCallSignatures | IWithCallSignatures4
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
>a => /*here a should be any*/ a.toString() : (a: number) => string
|
||||
> : ^ ^^^^^^^^^^^^^^^^^^^
|
||||
>a : number
|
||||
> : ^^^^^^
|
||||
>a.toString() : string
|
||||
> : ^^^^^^
|
||||
>a.toString : (radix?: number) => string
|
||||
> : ^ ^^^ ^^^^^
|
||||
>a : number
|
||||
> : ^^^^^^
|
||||
>toString : (radix?: number) => string
|
||||
> : ^ ^^^ ^^^^^
|
||||
>a => /*here a should be any*/ a.toString() : (a: any) => any
|
||||
> : ^ ^^^^^^^^^^^^^
|
||||
>a : any
|
||||
> : ^^^
|
||||
>a.toString() : any
|
||||
> : ^^^
|
||||
>a.toString : any
|
||||
> : ^^^
|
||||
>a : any
|
||||
> : ^^^
|
||||
>toString : any
|
||||
> : ^^^
|
||||
|
||||
|
||||
@ -57,6 +57,7 @@ var x4: IWithNumberIndexSignature1 | IWithNumberIndexSignature2 = { 1: a => a.to
|
||||
var x4: IWithNumberIndexSignature1 | IWithNumberIndexSignature2 = { 1: a => a }; // a should be number
|
||||
|
||||
//// [contextualTypeWithUnionTypeIndexSignatures.js]
|
||||
"use strict";
|
||||
// When an object literal is contextually typed by a type that includes a string index signature,
|
||||
// the resulting type of the object literal includes a string index signature with the union type of
|
||||
// the types of the properties declared in the object literal, or the Undefined type if the object literal
|
||||
|
||||
@ -0,0 +1,152 @@
|
||||
contextualTypeWithUnionTypeMembers.ts(24,39): error TS2454: Variable 'i1' is used before being assigned.
|
||||
contextualTypeWithUnionTypeMembers.ts(25,39): error TS2454: Variable 'i2' is used before being assigned.
|
||||
contextualTypeWithUnionTypeMembers.ts(52,52): error TS2454: Variable 'i1' is used before being assigned.
|
||||
contextualTypeWithUnionTypeMembers.ts(52,56): error TS2454: Variable 'i2' is used before being assigned.
|
||||
contextualTypeWithUnionTypeMembers.ts(87,27): error TS2454: Variable 'i11' is used before being assigned.
|
||||
contextualTypeWithUnionTypeMembers.ts(88,27): error TS2454: Variable 'i21' is used before being assigned.
|
||||
contextualTypeWithUnionTypeMembers.ts(105,42): error TS2454: Variable 'i11' is used before being assigned.
|
||||
contextualTypeWithUnionTypeMembers.ts(105,47): error TS2454: Variable 'i21' is used before being assigned.
|
||||
contextualTypeWithUnionTypeMembers.ts(105,52): error TS2454: Variable 'i11' is used before being assigned.
|
||||
contextualTypeWithUnionTypeMembers.ts(105,59): error TS2454: Variable 'i21' is used before being assigned.
|
||||
|
||||
|
||||
==== contextualTypeWithUnionTypeMembers.ts (10 errors) ====
|
||||
//When used as a contextual type, a union type U has those members that are present in any of
|
||||
// its constituent types, with types that are unions of the respective members in the constituent types.
|
||||
interface I1<T> {
|
||||
commonMethodType(a: string): string;
|
||||
commonPropertyType: string;
|
||||
commonMethodWithTypeParameter(a: T): T;
|
||||
|
||||
methodOnlyInI1(a: string): string;
|
||||
propertyOnlyInI1: string;
|
||||
}
|
||||
interface I2<T> {
|
||||
commonMethodType(a: string): string;
|
||||
commonPropertyType: string;
|
||||
commonMethodWithTypeParameter(a: T): T;
|
||||
|
||||
methodOnlyInI2(a: string): string;
|
||||
propertyOnlyInI2: string;
|
||||
}
|
||||
|
||||
// Let S be the set of types in U that has a property P.
|
||||
// If S is not empty, U has a property P of a union type of the types of P from each type in S.
|
||||
var i1: I1<number>;
|
||||
var i2: I2<number>;
|
||||
var i1Ori2: I1<number> | I2<number> = i1;
|
||||
~~
|
||||
!!! error TS2454: Variable 'i1' is used before being assigned.
|
||||
var i1Ori2: I1<number> | I2<number> = i2;
|
||||
~~
|
||||
!!! error TS2454: Variable 'i2' is used before being assigned.
|
||||
var i1Ori2: I1<number> | I2<number> = { // Like i1
|
||||
commonPropertyType: "hello",
|
||||
commonMethodType: a=> a,
|
||||
commonMethodWithTypeParameter: a => a,
|
||||
|
||||
methodOnlyInI1: a => a,
|
||||
propertyOnlyInI1: "Hello",
|
||||
};
|
||||
var i1Ori2: I1<number> | I2<number> = { // Like i2
|
||||
commonPropertyType: "hello",
|
||||
commonMethodType: a=> a,
|
||||
commonMethodWithTypeParameter: a => a,
|
||||
|
||||
methodOnlyInI2: a => a,
|
||||
propertyOnlyInI2: "Hello",
|
||||
};
|
||||
var i1Ori2: I1<number> | I2<number> = { // Like i1 and i2 both
|
||||
commonPropertyType: "hello",
|
||||
commonMethodType: a=> a,
|
||||
commonMethodWithTypeParameter: a => a,
|
||||
methodOnlyInI1: a => a,
|
||||
propertyOnlyInI1: "Hello",
|
||||
methodOnlyInI2: a => a,
|
||||
propertyOnlyInI2: "Hello",
|
||||
};
|
||||
|
||||
var arrayI1OrI2: Array<I1<number> | I2<number>> = [i1, i2, { // Like i1
|
||||
~~
|
||||
!!! error TS2454: Variable 'i1' is used before being assigned.
|
||||
~~
|
||||
!!! error TS2454: Variable 'i2' is used before being assigned.
|
||||
commonPropertyType: "hello",
|
||||
commonMethodType: a=> a,
|
||||
commonMethodWithTypeParameter: a => a,
|
||||
|
||||
methodOnlyInI1: a => a,
|
||||
propertyOnlyInI1: "Hello",
|
||||
},
|
||||
{ // Like i2
|
||||
commonPropertyType: "hello",
|
||||
commonMethodType: a=> a,
|
||||
commonMethodWithTypeParameter: a => a,
|
||||
|
||||
methodOnlyInI2: a => a,
|
||||
propertyOnlyInI2: "Hello",
|
||||
}, { // Like i1 and i2 both
|
||||
commonPropertyType: "hello",
|
||||
commonMethodType: a=> a,
|
||||
commonMethodWithTypeParameter: a => a,
|
||||
methodOnlyInI1: a => a,
|
||||
propertyOnlyInI1: "Hello",
|
||||
methodOnlyInI2: a => a,
|
||||
propertyOnlyInI2: "Hello",
|
||||
}];
|
||||
|
||||
interface I11 {
|
||||
commonMethodDifferentReturnType(a: string, b: number): string;
|
||||
commonPropertyDifferentType: string;
|
||||
}
|
||||
interface I21 {
|
||||
commonMethodDifferentReturnType(a: string, b: number): number;
|
||||
commonPropertyDifferentType: number;
|
||||
}
|
||||
var i11: I11;
|
||||
var i21: I21;
|
||||
var i11Ori21: I11 | I21 = i11;
|
||||
~~~
|
||||
!!! error TS2454: Variable 'i11' is used before being assigned.
|
||||
var i11Ori21: I11 | I21 = i21;
|
||||
~~~
|
||||
!!! error TS2454: Variable 'i21' is used before being assigned.
|
||||
var i11Ori21: I11 | I21 = {
|
||||
// Like i1
|
||||
commonMethodDifferentReturnType: (a, b) => {
|
||||
var z = a.charAt(b);
|
||||
return z;
|
||||
},
|
||||
commonPropertyDifferentType: "hello",
|
||||
};
|
||||
var i11Ori21: I11 | I21 = {
|
||||
// Like i2
|
||||
commonMethodDifferentReturnType: (a, b) => {
|
||||
var z = a.charCodeAt(b);
|
||||
return z;
|
||||
},
|
||||
commonPropertyDifferentType: 10,
|
||||
};
|
||||
var arrayOrI11OrI21: Array<I11 | I21> = [i11, i21, i11 || i21, {
|
||||
~~~
|
||||
!!! error TS2454: Variable 'i11' is used before being assigned.
|
||||
~~~
|
||||
!!! error TS2454: Variable 'i21' is used before being assigned.
|
||||
~~~
|
||||
!!! error TS2454: Variable 'i11' is used before being assigned.
|
||||
~~~
|
||||
!!! error TS2454: Variable 'i21' is used before being assigned.
|
||||
// Like i1
|
||||
commonMethodDifferentReturnType: (a, b) => {
|
||||
var z = a.charAt(b);
|
||||
return z;
|
||||
},
|
||||
commonPropertyDifferentType: "hello",
|
||||
}, {
|
||||
// Like i2
|
||||
commonMethodDifferentReturnType: (a, b) => {
|
||||
var z = a.charCodeAt(b);
|
||||
return z;
|
||||
},
|
||||
commonPropertyDifferentType: 10,
|
||||
}];
|
||||
@ -122,6 +122,7 @@ var arrayOrI11OrI21: Array<I11 | I21> = [i11, i21, i11 || i21, {
|
||||
}];
|
||||
|
||||
//// [contextualTypeWithUnionTypeMembers.js]
|
||||
"use strict";
|
||||
// Let S be the set of types in U that has a property P.
|
||||
// If S is not empty, U has a property P of a union type of the types of P from each type in S.
|
||||
var i1;
|
||||
|
||||
@ -550,8 +550,8 @@ var arrayOrI11OrI21: Array<I11 | I21> = [i11, i21, i11 || i21, {
|
||||
> : ^^^
|
||||
>i21 : I21
|
||||
> : ^^^
|
||||
>i11 || i21 : I11 | I21
|
||||
> : ^^^^^^^^^
|
||||
>i11 || i21 : I11
|
||||
> : ^^^
|
||||
>i11 : I11
|
||||
> : ^^^
|
||||
>i21 : I21
|
||||
|
||||
@ -62,6 +62,7 @@ var i11Ori21: I11 | I21 = { // Like i1 and i2 both
|
||||
};
|
||||
|
||||
//// [contextualTypeWithUnionTypeObjectLiteral.js]
|
||||
"use strict";
|
||||
var strOrNumber = str || num;
|
||||
var objStrOrNum1 = objStr || objNum;
|
||||
var objStrOrNum2 = objStr || objNum;
|
||||
|
||||
@ -38,8 +38,8 @@ var objStrOrNum1: { prop: string } | { prop: number } = objStr || objNum;
|
||||
> : ^^^^^^
|
||||
>prop : number
|
||||
> : ^^^^^^
|
||||
>objStr || objNum : { prop: string; } | { prop: number; }
|
||||
> : ^^^^^^^^ ^^^^^^^^^^^^^^ ^^^
|
||||
>objStr || objNum : { prop: string; }
|
||||
> : ^^^^^^^^ ^^^
|
||||
>objStr : { prop: string; }
|
||||
> : ^^^^^^^^ ^^^
|
||||
>objNum : { prop: number; }
|
||||
@ -50,8 +50,8 @@ var objStrOrNum2: { prop: string | number } = objStr || objNum;
|
||||
> : ^^^^^^^^ ^^^
|
||||
>prop : string | number
|
||||
> : ^^^^^^^^^^^^^^^
|
||||
>objStr || objNum : { prop: string; } | { prop: number; }
|
||||
> : ^^^^^^^^ ^^^^^^^^^^^^^^ ^^^
|
||||
>objStr || objNum : { prop: string; }
|
||||
> : ^^^^^^^^ ^^^
|
||||
>objStr : { prop: string; }
|
||||
> : ^^^^^^^^ ^^^
|
||||
>objNum : { prop: number; }
|
||||
|
||||
@ -0,0 +1,58 @@
|
||||
octalIntegerLiteral.ts(23,1): error TS7053: Element implicitly has an 'any' type because expression of type '"0o45436"' can't be used to index type '{ 19230: string; a: number; b: number; oct1: number; Infinity: boolean; }'.
|
||||
Property '0o45436' does not exist on type '{ 19230: string; a: number; b: number; oct1: number; Infinity: boolean; }'.
|
||||
octalIntegerLiteral.ts(32,1): error TS7053: Element implicitly has an 'any' type because expression of type '"0O45436"' can't be used to index type '{ 19230: string; a: number; b: number; oct2: number; 5.462437423415177e+244: boolean; }'.
|
||||
Property '0O45436' does not exist on type '{ 19230: string; a: number; b: number; oct2: number; 5.462437423415177e+244: boolean; }'.
|
||||
octalIntegerLiteral.ts(40,1): error TS7053: Element implicitly has an 'any' type because expression of type '"Infinity"' can't be used to index type '{ 19230: string; a: number; b: number; oct2: number; 5.462437423415177e+244: boolean; }'.
|
||||
Property 'Infinity' does not exist on type '{ 19230: string; a: number; b: number; oct2: number; 5.462437423415177e+244: boolean; }'.
|
||||
|
||||
|
||||
==== octalIntegerLiteral.ts (3 errors) ====
|
||||
var oct1 = 0o45436;
|
||||
var oct2 = 0O45436;
|
||||
var oct3 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777;
|
||||
var oct4 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777;
|
||||
|
||||
var obj1 = {
|
||||
0o45436: "Hello",
|
||||
a: 0o45436,
|
||||
b: oct1,
|
||||
oct1,
|
||||
0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: true
|
||||
}
|
||||
|
||||
var obj2 = {
|
||||
0O45436: "hi",
|
||||
a: 0O45436,
|
||||
b: oct2,
|
||||
oct2,
|
||||
0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: false,
|
||||
}
|
||||
|
||||
obj1[0o45436]; // string
|
||||
obj1["0o45436"]; // any
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS7053: Element implicitly has an 'any' type because expression of type '"0o45436"' can't be used to index type '{ 19230: string; a: number; b: number; oct1: number; Infinity: boolean; }'.
|
||||
!!! error TS7053: Property '0o45436' does not exist on type '{ 19230: string; a: number; b: number; oct1: number; Infinity: boolean; }'.
|
||||
obj1["19230"]; // string
|
||||
obj1[19230]; // string
|
||||
obj1["a"]; // number
|
||||
obj1["b"]; // number
|
||||
obj1["oct1"]; // number
|
||||
obj1["Infinity"]; // boolean
|
||||
|
||||
obj2[0O45436]; // string
|
||||
obj2["0O45436"]; // any
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS7053: Element implicitly has an 'any' type because expression of type '"0O45436"' can't be used to index type '{ 19230: string; a: number; b: number; oct2: number; 5.462437423415177e+244: boolean; }'.
|
||||
!!! error TS7053: Property '0O45436' does not exist on type '{ 19230: string; a: number; b: number; oct2: number; 5.462437423415177e+244: boolean; }'.
|
||||
obj2["19230"]; // string
|
||||
obj2[19230]; // string
|
||||
obj2["a"]; // number
|
||||
obj2["b"]; // number
|
||||
obj2["oct2"]; // number
|
||||
obj2[5.462437423415177e+244]; // boolean
|
||||
obj2["5.462437423415177e+244"]; // boolean
|
||||
obj2["Infinity"]; // any
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS7053: Element implicitly has an 'any' type because expression of type '"Infinity"' can't be used to index type '{ 19230: string; a: number; b: number; oct2: number; 5.462437423415177e+244: boolean; }'.
|
||||
!!! error TS7053: Property 'Infinity' does not exist on type '{ 19230: string; a: number; b: number; oct2: number; 5.462437423415177e+244: boolean; }'.
|
||||
@ -43,6 +43,7 @@ obj2["5.462437423415177e+244"]; // boolean
|
||||
obj2["Infinity"]; // any
|
||||
|
||||
//// [octalIntegerLiteral.js]
|
||||
"use strict";
|
||||
var oct1 = 0o45436;
|
||||
var oct2 = 0O45436;
|
||||
var oct3 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777;
|
||||
|
||||
@ -104,7 +104,8 @@ obj1[0o45436]; // string
|
||||
> : ^^^^^
|
||||
|
||||
obj1["0o45436"]; // any
|
||||
>obj1["0o45436"] : error
|
||||
>obj1["0o45436"] : any
|
||||
> : ^^^
|
||||
>obj1 : { 19230: string; a: number; b: number; oct1: number; Infinity: boolean; }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
>"0o45436" : "0o45436"
|
||||
@ -167,7 +168,8 @@ obj2[0O45436]; // string
|
||||
> : ^^^^^
|
||||
|
||||
obj2["0O45436"]; // any
|
||||
>obj2["0O45436"] : error
|
||||
>obj2["0O45436"] : any
|
||||
> : ^^^
|
||||
>obj2 : { 19230: string; a: number; b: number; oct2: number; 5.462437423415177e+244: boolean; }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
>"0O45436" : "0O45436"
|
||||
@ -230,7 +232,8 @@ obj2["5.462437423415177e+244"]; // boolean
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
obj2["Infinity"]; // any
|
||||
>obj2["Infinity"] : error
|
||||
>obj2["Infinity"] : any
|
||||
> : ^^^
|
||||
>obj2 : { 19230: string; a: number; b: number; oct2: number; 5.462437423415177e+244: boolean; }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
>"Infinity" : "Infinity"
|
||||
|
||||
@ -1,8 +1,14 @@
|
||||
error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
|
||||
octalIntegerLiteral.ts(23,1): error TS7053: Element implicitly has an 'any' type because expression of type '"0o45436"' can't be used to index type '{ 19230: string; a: number; b: number; oct1: number; Infinity: boolean; }'.
|
||||
Property '0o45436' does not exist on type '{ 19230: string; a: number; b: number; oct1: number; Infinity: boolean; }'.
|
||||
octalIntegerLiteral.ts(32,1): error TS7053: Element implicitly has an 'any' type because expression of type '"0O45436"' can't be used to index type '{ 19230: string; a: number; b: number; oct2: number; 5.462437423415177e+244: boolean; }'.
|
||||
Property '0O45436' does not exist on type '{ 19230: string; a: number; b: number; oct2: number; 5.462437423415177e+244: boolean; }'.
|
||||
octalIntegerLiteral.ts(40,1): error TS7053: Element implicitly has an 'any' type because expression of type '"Infinity"' can't be used to index type '{ 19230: string; a: number; b: number; oct2: number; 5.462437423415177e+244: boolean; }'.
|
||||
Property 'Infinity' does not exist on type '{ 19230: string; a: number; b: number; oct2: number; 5.462437423415177e+244: boolean; }'.
|
||||
|
||||
|
||||
!!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
|
||||
==== octalIntegerLiteral.ts (0 errors) ====
|
||||
==== octalIntegerLiteral.ts (3 errors) ====
|
||||
var oct1 = 0o45436;
|
||||
var oct2 = 0O45436;
|
||||
var oct3 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777;
|
||||
@ -26,6 +32,9 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in Typ
|
||||
|
||||
obj1[0o45436]; // string
|
||||
obj1["0o45436"]; // any
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS7053: Element implicitly has an 'any' type because expression of type '"0o45436"' can't be used to index type '{ 19230: string; a: number; b: number; oct1: number; Infinity: boolean; }'.
|
||||
!!! error TS7053: Property '0o45436' does not exist on type '{ 19230: string; a: number; b: number; oct1: number; Infinity: boolean; }'.
|
||||
obj1["19230"]; // string
|
||||
obj1[19230]; // string
|
||||
obj1["a"]; // number
|
||||
@ -35,6 +44,9 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in Typ
|
||||
|
||||
obj2[0O45436]; // string
|
||||
obj2["0O45436"]; // any
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS7053: Element implicitly has an 'any' type because expression of type '"0O45436"' can't be used to index type '{ 19230: string; a: number; b: number; oct2: number; 5.462437423415177e+244: boolean; }'.
|
||||
!!! error TS7053: Property '0O45436' does not exist on type '{ 19230: string; a: number; b: number; oct2: number; 5.462437423415177e+244: boolean; }'.
|
||||
obj2["19230"]; // string
|
||||
obj2[19230]; // string
|
||||
obj2["a"]; // number
|
||||
@ -42,4 +54,7 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in Typ
|
||||
obj2["oct2"]; // number
|
||||
obj2[5.462437423415177e+244]; // boolean
|
||||
obj2["5.462437423415177e+244"]; // boolean
|
||||
obj2["Infinity"]; // any
|
||||
obj2["Infinity"]; // any
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS7053: Element implicitly has an 'any' type because expression of type '"Infinity"' can't be used to index type '{ 19230: string; a: number; b: number; oct2: number; 5.462437423415177e+244: boolean; }'.
|
||||
!!! error TS7053: Property 'Infinity' does not exist on type '{ 19230: string; a: number; b: number; oct2: number; 5.462437423415177e+244: boolean; }'.
|
||||
@ -43,6 +43,7 @@ obj2["5.462437423415177e+244"]; // boolean
|
||||
obj2["Infinity"]; // any
|
||||
|
||||
//// [octalIntegerLiteral.js]
|
||||
"use strict";
|
||||
var oct1 = 19230;
|
||||
var oct2 = 19230;
|
||||
var oct3 = Infinity;
|
||||
|
||||
58
tests/baselines/reference/octalIntegerLiteralES6.errors.txt
Normal file
58
tests/baselines/reference/octalIntegerLiteralES6.errors.txt
Normal file
@ -0,0 +1,58 @@
|
||||
octalIntegerLiteralES6.ts(23,1): error TS7053: Element implicitly has an 'any' type because expression of type '"0o45436"' can't be used to index type '{ 19230: string; a: number; b: number; oct1: number; Infinity: boolean; }'.
|
||||
Property '0o45436' does not exist on type '{ 19230: string; a: number; b: number; oct1: number; Infinity: boolean; }'.
|
||||
octalIntegerLiteralES6.ts(32,1): error TS7053: Element implicitly has an 'any' type because expression of type '"0O45436"' can't be used to index type '{ 19230: string; a: number; b: number; oct2: number; 5.462437423415177e+244: boolean; }'.
|
||||
Property '0O45436' does not exist on type '{ 19230: string; a: number; b: number; oct2: number; 5.462437423415177e+244: boolean; }'.
|
||||
octalIntegerLiteralES6.ts(40,1): error TS7053: Element implicitly has an 'any' type because expression of type '"Infinity"' can't be used to index type '{ 19230: string; a: number; b: number; oct2: number; 5.462437423415177e+244: boolean; }'.
|
||||
Property 'Infinity' does not exist on type '{ 19230: string; a: number; b: number; oct2: number; 5.462437423415177e+244: boolean; }'.
|
||||
|
||||
|
||||
==== octalIntegerLiteralES6.ts (3 errors) ====
|
||||
var oct1 = 0o45436;
|
||||
var oct2 = 0O45436;
|
||||
var oct3 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777;
|
||||
var oct4 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777;
|
||||
|
||||
var obj1 = {
|
||||
0o45436: "Hello",
|
||||
a: 0o45436,
|
||||
b: oct1,
|
||||
oct1,
|
||||
0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: true
|
||||
}
|
||||
|
||||
var obj2 = {
|
||||
0O45436: "hi",
|
||||
a: 0O45436,
|
||||
b: oct2,
|
||||
oct2,
|
||||
0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: false,
|
||||
}
|
||||
|
||||
obj1[0o45436]; // string
|
||||
obj1["0o45436"]; // any
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS7053: Element implicitly has an 'any' type because expression of type '"0o45436"' can't be used to index type '{ 19230: string; a: number; b: number; oct1: number; Infinity: boolean; }'.
|
||||
!!! error TS7053: Property '0o45436' does not exist on type '{ 19230: string; a: number; b: number; oct1: number; Infinity: boolean; }'.
|
||||
obj1["19230"]; // string
|
||||
obj1[19230]; // string
|
||||
obj1["a"]; // number
|
||||
obj1["b"]; // number
|
||||
obj1["oct1"]; // number
|
||||
obj1["Infinity"]; // boolean
|
||||
|
||||
obj2[0O45436]; // string
|
||||
obj2["0O45436"]; // any
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS7053: Element implicitly has an 'any' type because expression of type '"0O45436"' can't be used to index type '{ 19230: string; a: number; b: number; oct2: number; 5.462437423415177e+244: boolean; }'.
|
||||
!!! error TS7053: Property '0O45436' does not exist on type '{ 19230: string; a: number; b: number; oct2: number; 5.462437423415177e+244: boolean; }'.
|
||||
obj2["19230"]; // string
|
||||
obj2[19230]; // string
|
||||
obj2["a"]; // number
|
||||
obj2["b"]; // number
|
||||
obj2["oct2"]; // number
|
||||
obj2[5.462437423415177e+244]; // boolean
|
||||
obj2["5.462437423415177e+244"]; // boolean
|
||||
obj2["Infinity"]; // any
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS7053: Element implicitly has an 'any' type because expression of type '"Infinity"' can't be used to index type '{ 19230: string; a: number; b: number; oct2: number; 5.462437423415177e+244: boolean; }'.
|
||||
!!! error TS7053: Property 'Infinity' does not exist on type '{ 19230: string; a: number; b: number; oct2: number; 5.462437423415177e+244: boolean; }'.
|
||||
@ -43,6 +43,7 @@ obj2["5.462437423415177e+244"]; // boolean
|
||||
obj2["Infinity"]; // any
|
||||
|
||||
//// [octalIntegerLiteralES6.js]
|
||||
"use strict";
|
||||
var oct1 = 0o45436;
|
||||
var oct2 = 0O45436;
|
||||
var oct3 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777;
|
||||
|
||||
@ -104,7 +104,8 @@ obj1[0o45436]; // string
|
||||
> : ^^^^^
|
||||
|
||||
obj1["0o45436"]; // any
|
||||
>obj1["0o45436"] : error
|
||||
>obj1["0o45436"] : any
|
||||
> : ^^^
|
||||
>obj1 : { 19230: string; a: number; b: number; oct1: number; Infinity: boolean; }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
>"0o45436" : "0o45436"
|
||||
@ -167,7 +168,8 @@ obj2[0O45436]; // string
|
||||
> : ^^^^^
|
||||
|
||||
obj2["0O45436"]; // any
|
||||
>obj2["0O45436"] : error
|
||||
>obj2["0O45436"] : any
|
||||
> : ^^^
|
||||
>obj2 : { 19230: string; a: number; b: number; oct2: number; 5.462437423415177e+244: boolean; }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
>"0O45436" : "0O45436"
|
||||
@ -230,7 +232,8 @@ obj2["5.462437423415177e+244"]; // boolean
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
obj2["Infinity"]; // any
|
||||
>obj2["Infinity"] : error
|
||||
>obj2["Infinity"] : any
|
||||
> : ^^^
|
||||
>obj2 : { 19230: string; a: number; b: number; oct2: number; 5.462437423415177e+244: boolean; }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
>"Infinity" : "Infinity"
|
||||
|
||||
@ -13,6 +13,7 @@ var obj1 = {
|
||||
|
||||
|
||||
//// [octalIntegerLiteralError.js]
|
||||
"use strict";
|
||||
// error
|
||||
var oct1 = 0O13334;
|
||||
823;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user