1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
tests/cases/compiler/assignmentToReferenceTypes.ts(5,1): error TS2708: Cannot use namespace 'M' as a value.
tests/cases/compiler/assignmentToReferenceTypes.ts(9,1): error TS2629: Cannot assign to 'C' because it is a class.
tests/cases/compiler/assignmentToReferenceTypes.ts(13,1): error TS2628: Cannot assign to 'E' because it is an enum.
tests/cases/compiler/assignmentToReferenceTypes.ts(16,1): error TS2630: Cannot assign to 'f' because it is a function.
==== tests/cases/compiler/assignmentToReferenceTypes.ts (4 errors) ====
// Should all be allowed
module M {
}
M = null;
~
!!! error TS2708: Cannot use namespace 'M' as a value.
class C {
}
C = null;
~
!!! error TS2629: Cannot assign to 'C' because it is a class.
enum E {
}
E = null;
~
!!! error TS2628: Cannot assign to 'E' because it is an enum.
function f() { }
f = null;
~
!!! error TS2630: Cannot assign to 'f' because it is a function.
var x = 1;
x = null;
function g(x) {
x = null;
}
|