Skip to content

Commit bc0c137

Browse files
remove extra code
1 parent 0c01874 commit bc0c137

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

src/compiler/checker.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6275,7 +6275,6 @@ namespace ts {
62756275
(globalNumberType === source && numberType === target) ||
62766276
(globalBooleanType === source && booleanType === target) ||
62776277
(getGlobalESSymbolType() === source && esSymbolType === target)) {
6278-
console.log(source);console.log(target);
62796278
reportError(Diagnostics._0_is_a_primitive_type_while_1_is_a_boxed_object_Prefer_using_0_when_possible, targetType, sourceType);
62806279
}
62816280
}

tests/baselines/reference/nativeToBoxedTypes.errors.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ tests/cases/compiler/nativeToBoxedTypes.ts(7,1): error TS2322: Type 'String' is
44
'string' is a primitive type while 'String' is a boxed object. Prefer using 'string' when possible.
55
tests/cases/compiler/nativeToBoxedTypes.ts(11,1): error TS2322: Type 'Boolean' is not assignable to type 'boolean'.
66
'boolean' is a primitive type while 'Boolean' is a boxed object. Prefer using 'boolean' when possible.
7+
tests/cases/compiler/nativeToBoxedTypes.ts(14,10): error TS2304: Cannot find name 'Symbol'.
78

89

9-
==== tests/cases/compiler/nativeToBoxedTypes.ts (3 errors) ====
10+
==== tests/cases/compiler/nativeToBoxedTypes.ts (4 errors) ====
1011
var N = new Number();
1112
var n = 100;
1213
n = N;
@@ -26,4 +27,10 @@ tests/cases/compiler/nativeToBoxedTypes.ts(11,1): error TS2322: Type 'Boolean' i
2627
b = B;
2728
~
2829
!!! error TS2322: Type 'Boolean' is not assignable to type 'boolean'.
29-
!!! error TS2322: 'boolean' is a primitive type while 'Boolean' is a boxed object. Prefer using 'boolean' when possible.
30+
!!! error TS2322: 'boolean' is a primitive type while 'Boolean' is a boxed object. Prefer using 'boolean' when possible.
31+
32+
var sym: symbol;
33+
var Sym: Symbol;
34+
~~~~~~
35+
!!! error TS2304: Cannot find name 'Symbol'.
36+
sym = Sym;

tests/baselines/reference/nativeToBoxedTypes.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ s = S;
99

1010
var B = new Boolean();
1111
var b = true;
12-
b = B;
12+
b = B;
13+
14+
var sym: symbol;
15+
var Sym: Symbol;
16+
sym = Sym;
1317

1418
//// [nativeToBoxedTypes.js]
1519
var N = new Number();
@@ -21,3 +25,6 @@ s = S;
2125
var B = new Boolean();
2226
var b = true;
2327
b = B;
28+
var sym;
29+
var Sym;
30+
sym = Sym;

0 commit comments

Comments
 (0)