TypeScript/tests/baselines/reference/invalidVoidValues.errors.txt

62 lines
2.7 KiB
Plaintext
Raw Normal View History

2014-11-05 21:26:03 +01:00
tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(2,1): error TS2322: Type 'number' is not assignable to type 'void'.
tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(3,1): error TS2322: Type 'string' is not assignable to type 'void'.
tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(4,1): error TS2322: Type 'boolean' is not assignable to type 'void'.
tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(7,1): error TS2322: Type 'typeof E' is not assignable to type 'void'.
tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(8,1): error TS2322: Type 'E' is not assignable to type 'void'.
tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(12,1): error TS2322: Type 'C' is not assignable to type 'void'.
tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(16,1): error TS2322: Type 'I' is not assignable to type 'void'.
tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(18,1): error TS2322: Type '{ f(): void; }' is not assignable to type 'void'.
2014-11-05 21:26:03 +01:00
tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(21,1): error TS2322: Type 'typeof M' is not assignable to type 'void'.
tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(24,5): error TS2322: Type 'T' is not assignable to type 'void'.
tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(26,1): error TS2322: Type '<T>(a: T) => void' is not assignable to type 'void'.
2014-07-13 01:04:16 +02:00
==== tests/cases/conformance/types/primitives/void/invalidVoidValues.ts (11 errors) ====
var x: void;
x = 1;
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'number' is not assignable to type 'void'.
2014-07-13 01:04:16 +02:00
x = '';
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'string' is not assignable to type 'void'.
2014-07-13 01:04:16 +02:00
x = true;
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'boolean' is not assignable to type 'void'.
2014-07-13 01:04:16 +02:00
enum E { A }
x = E;
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'typeof E' is not assignable to type 'void'.
2014-07-13 01:04:16 +02:00
x = E.A;
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'E' is not assignable to type 'void'.
2014-07-13 01:04:16 +02:00
class C { foo: string }
var a: C;
x = a;
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'C' is not assignable to type 'void'.
2014-07-13 01:04:16 +02:00
interface I { foo: string }
var b: I;
x = b;
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'I' is not assignable to type 'void'.
2014-07-13 01:04:16 +02:00
x = { f() {} }
~
!!! error TS2322: Type '{ f(): void; }' is not assignable to type 'void'.
2014-07-13 01:04:16 +02:00
module M { export var x = 1; }
x = M;
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'typeof M' is not assignable to type 'void'.
2014-07-13 01:04:16 +02:00
function f<T>(a: T) {
x = a;
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'T' is not assignable to type 'void'.
2014-07-13 01:04:16 +02:00
}
x = f;
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type '<T>(a: T) => void' is not assignable to type 'void'.