e44d39d4eb
* Updated error message for TS2539 * Switch to multiple error messages * inline variable Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
42 lines
1.8 KiB
Plaintext
42 lines
1.8 KiB
Plaintext
tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(4,1): error TS2628: Cannot assign to 'E' because it is an enum.
|
|
tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(5,3): error TS2540: Cannot assign to 'A' because it is a read-only property.
|
|
tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(9,1): error TS2629: Cannot assign to 'C' because it is a class.
|
|
tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(14,1): error TS2693: 'I' only refers to a type, but is being used as a value here.
|
|
tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(17,1): error TS2631: Cannot assign to 'M' because it is a namespace.
|
|
tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(21,1): error TS2630: Cannot assign to 'i' because it is a function.
|
|
|
|
|
|
==== tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts (6 errors) ====
|
|
var x: typeof undefined;
|
|
|
|
enum E { A }
|
|
E = x;
|
|
~
|
|
!!! error TS2628: Cannot assign to 'E' because it is an enum.
|
|
E.A = x;
|
|
~
|
|
!!! error TS2540: Cannot assign to 'A' because it is a read-only property.
|
|
|
|
class C { foo: string }
|
|
var f: C;
|
|
C = x;
|
|
~
|
|
!!! error TS2629: Cannot assign to 'C' because it is a class.
|
|
|
|
interface I { foo: string }
|
|
var g: I;
|
|
g = x;
|
|
I = x;
|
|
~
|
|
!!! error TS2693: 'I' only refers to a type, but is being used as a value here.
|
|
|
|
module M { export var x = 1; }
|
|
M = x;
|
|
~
|
|
!!! error TS2631: Cannot assign to 'M' because it is a namespace.
|
|
|
|
function i<T>(a: T) { }
|
|
// BUG 767030
|
|
i = x;
|
|
~
|
|
!!! error TS2630: Cannot assign to 'i' because it is a function. |