55 lines
2.5 KiB
Plaintext
55 lines
2.5 KiB
Plaintext
tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(2,1): error TS2322: Type 'number' is not assignable to type 'void'.
|
|
tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(3,1): error TS2322: Type 'boolean' is not assignable to type 'void'.
|
|
tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(4,1): error TS2322: Type 'string' is not assignable to type 'void'.
|
|
tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(5,1): error TS2322: Type '{}' is not assignable to type 'void'.
|
|
tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(9,1): error TS2322: Type 'typeof C' is not assignable to type 'void'.
|
|
tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(10,1): error TS2322: Type 'C' is not assignable to type 'void'.
|
|
tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(14,1): error TS2322: Type 'I' is not assignable to type 'void'.
|
|
tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(17,1): error TS2322: Type 'typeof M' is not assignable to type 'void'.
|
|
tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(20,5): error TS2322: Type 'T' is not assignable to type 'void'.
|
|
tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(22,1): error TS2322: Type '<T>(a: T) => void' is not assignable to type 'void'.
|
|
|
|
|
|
==== tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts (10 errors) ====
|
|
var x: void;
|
|
x = 1;
|
|
~
|
|
!!! error TS2322: Type 'number' is not assignable to type 'void'.
|
|
x = true;
|
|
~
|
|
!!! error TS2322: Type 'boolean' is not assignable to type 'void'.
|
|
x = '';
|
|
~
|
|
!!! error TS2322: Type 'string' is not assignable to type 'void'.
|
|
x = {}
|
|
~
|
|
!!! error TS2322: Type '{}' is not assignable to type 'void'.
|
|
|
|
class C { foo: string; }
|
|
var c: C;
|
|
x = C;
|
|
~
|
|
!!! error TS2322: Type 'typeof C' is not assignable to type 'void'.
|
|
x = c;
|
|
~
|
|
!!! error TS2322: Type 'C' is not assignable to type 'void'.
|
|
|
|
interface I { foo: string; }
|
|
var i: I;
|
|
x = i;
|
|
~
|
|
!!! error TS2322: Type 'I' is not assignable to type 'void'.
|
|
|
|
module M { export var x = 1; }
|
|
x = M;
|
|
~
|
|
!!! error TS2322: Type 'typeof M' is not assignable to type 'void'.
|
|
|
|
function f<T>(a: T) {
|
|
x = a;
|
|
~
|
|
!!! error TS2322: Type 'T' is not assignable to type 'void'.
|
|
}
|
|
x = f;
|
|
~
|
|
!!! error TS2322: Type '<T>(a: T) => void' is not assignable to type 'void'. |