70 lines
No EOL
3.4 KiB
Text
70 lines
No EOL
3.4 KiB
Text
tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(3,5): error TS2322: Type 'string' is not assignable to type 'boolean'.
|
|
tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(4,5): error TS2322: Type 'string' is not assignable to type 'number'.
|
|
tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(5,5): error TS2322: Type 'string' is not assignable to type 'void'.
|
|
tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(9,5): error TS2322: Type 'string' is not assignable to type 'C'.
|
|
Property 'foo' is missing in type 'String'.
|
|
tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(12,5): error TS2322: Type 'string' is not assignable to type 'I'.
|
|
Property 'bar' is missing in type 'String'.
|
|
tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }'.
|
|
Property 'baz' is missing in type 'Number'.
|
|
tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }'.
|
|
Property '0' is missing in type 'Number'.
|
|
tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(18,1): error TS2364: Invalid left-hand side of assignment expression.
|
|
tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(21,5): error TS2322: Type 'string' is not assignable to type 'T'.
|
|
tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(23,1): error TS2364: Invalid left-hand side of assignment expression.
|
|
tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(26,5): error TS2322: Type 'string' is not assignable to type 'E'.
|
|
|
|
|
|
==== tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts (11 errors) ====
|
|
var x = '';
|
|
|
|
var a: boolean = x;
|
|
~
|
|
!!! error TS2322: Type 'string' is not assignable to type 'boolean'.
|
|
var b: number = x;
|
|
~
|
|
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
|
var c: void = x;
|
|
~
|
|
!!! error TS2322: Type 'string' is not assignable to type 'void'.
|
|
var d: typeof undefined = x;
|
|
|
|
class C { foo: string; }
|
|
var e: C = x;
|
|
~
|
|
!!! error TS2322: Type 'string' is not assignable to type 'C'.
|
|
!!! error TS2322: Property 'foo' is missing in type 'String'.
|
|
|
|
interface I { bar: string; }
|
|
var f: I = x;
|
|
~
|
|
!!! error TS2322: Type 'string' is not assignable to type 'I'.
|
|
!!! error TS2322: Property 'bar' is missing in type 'String'.
|
|
|
|
var g: { baz: string } = 1;
|
|
~
|
|
!!! error TS2322: Type 'number' is not assignable to type '{ baz: string; }'.
|
|
!!! error TS2322: Property 'baz' is missing in type 'Number'.
|
|
var g2: { 0: number } = 1;
|
|
~~
|
|
!!! error TS2322: Type 'number' is not assignable to type '{ 0: number; }'.
|
|
!!! error TS2322: Property '0' is missing in type 'Number'.
|
|
|
|
module M { export var x = 1; }
|
|
M = x;
|
|
~
|
|
!!! error TS2364: Invalid left-hand side of assignment expression.
|
|
|
|
function i<T>(a: T) {
|
|
a = x;
|
|
~
|
|
!!! error TS2322: Type 'string' is not assignable to type 'T'.
|
|
}
|
|
i = x;
|
|
~
|
|
!!! error TS2364: Invalid left-hand side of assignment expression.
|
|
|
|
enum E { A }
|
|
var j: E = x;
|
|
~
|
|
!!! error TS2322: Type 'string' is not assignable to type 'E'. |