remove extra code

This commit is contained in:
Yuichi Nukiyama 2016-08-20 21:36:17 +09:00
parent 0c01874b31
commit bc0c137a89
3 changed files with 17 additions and 4 deletions

View file

@ -6275,7 +6275,6 @@ namespace ts {
(globalNumberType === source && numberType === target) ||
(globalBooleanType === source && booleanType === target) ||
(getGlobalESSymbolType() === source && esSymbolType === target)) {
console.log(source);console.log(target);
reportError(Diagnostics._0_is_a_primitive_type_while_1_is_a_boxed_object_Prefer_using_0_when_possible, targetType, sourceType);
}
}

View file

@ -4,9 +4,10 @@ tests/cases/compiler/nativeToBoxedTypes.ts(7,1): error TS2322: Type 'String' is
'string' is a primitive type while 'String' is a boxed object. Prefer using 'string' when possible.
tests/cases/compiler/nativeToBoxedTypes.ts(11,1): error TS2322: Type 'Boolean' is not assignable to type 'boolean'.
'boolean' is a primitive type while 'Boolean' is a boxed object. Prefer using 'boolean' when possible.
tests/cases/compiler/nativeToBoxedTypes.ts(14,10): error TS2304: Cannot find name 'Symbol'.
==== tests/cases/compiler/nativeToBoxedTypes.ts (3 errors) ====
==== tests/cases/compiler/nativeToBoxedTypes.ts (4 errors) ====
var N = new Number();
var n = 100;
n = N;
@ -26,4 +27,10 @@ tests/cases/compiler/nativeToBoxedTypes.ts(11,1): error TS2322: Type 'Boolean' i
b = B;
~
!!! error TS2322: Type 'Boolean' is not assignable to type 'boolean'.
!!! error TS2322: 'boolean' is a primitive type while 'Boolean' is a boxed object. Prefer using 'boolean' when possible.
!!! error TS2322: 'boolean' is a primitive type while 'Boolean' is a boxed object. Prefer using 'boolean' when possible.
var sym: symbol;
var Sym: Symbol;
~~~~~~
!!! error TS2304: Cannot find name 'Symbol'.
sym = Sym;

View file

@ -9,7 +9,11 @@ s = S;
var B = new Boolean();
var b = true;
b = B;
b = B;
var sym: symbol;
var Sym: Symbol;
sym = Sym;
//// [nativeToBoxedTypes.js]
var N = new Number();
@ -21,3 +25,6 @@ s = S;
var B = new Boolean();
var b = true;
b = B;
var sym;
var Sym;
sym = Sym;