81 lines
No EOL
5.8 KiB
Text
81 lines
No EOL
5.8 KiB
Text
tests/cases/compiler/typeName1.ts(9,5): error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; f(n: number): string; }'.
|
|
tests/cases/compiler/typeName1.ts(10,5): error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; }'.
|
|
tests/cases/compiler/typeName1.ts(11,5): error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; }'.
|
|
tests/cases/compiler/typeName1.ts(12,5): error TS2322: Type 'number' is not assignable to type '{ x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'.
|
|
tests/cases/compiler/typeName1.ts(13,5): error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'.
|
|
tests/cases/compiler/typeName1.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ z: number; f: { (n: number): string; (s: string): number; }; }'.
|
|
tests/cases/compiler/typeName1.ts(15,5): error TS2322: Type 'number' is not assignable to type '(s: string) => boolean'.
|
|
tests/cases/compiler/typeName1.ts(16,5): error TS2322: Type 'number' is not assignable to type '{ (): boolean; [s: string]: { x: any; y: any; }; [n: number]: { x: any; y: any; }; z: I; }'.
|
|
tests/cases/compiler/typeName1.ts(16,10): error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'.
|
|
tests/cases/compiler/typeName1.ts(17,5): error TS2322: Type 'number' is not assignable to type 'I'.
|
|
tests/cases/compiler/typeName1.ts(18,5): error TS2322: Type 'number' is not assignable to type 'I[][][][]'.
|
|
tests/cases/compiler/typeName1.ts(19,5): error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; }[][]'.
|
|
tests/cases/compiler/typeName1.ts(20,5): error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; y: (s: string) => boolean; w: { (): boolean; [s: string]: { x: any; y: any; }; [n: number]: { x: any; y: any; }; z: I; }; }[][]'.
|
|
tests/cases/compiler/typeName1.ts(20,50): error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'.
|
|
tests/cases/compiler/typeName1.ts(21,5): error TS2322: Type 'number' is not assignable to type '{ (): {}; new (): number; new (n: number): number; x: string; w: { y: number; }; }'.
|
|
tests/cases/compiler/typeName1.ts(22,5): error TS2322: Type 'number' is not assignable to type '{ (): string; f(x: number): boolean; p: any; q: any; }'.
|
|
tests/cases/compiler/typeName1.ts(23,5): error TS2322: Type 'typeof C' is not assignable to type 'number'.
|
|
|
|
|
|
==== tests/cases/compiler/typeName1.ts (17 errors) ====
|
|
interface I {
|
|
k;
|
|
}
|
|
class C {
|
|
public eek:string;
|
|
static zeek:number;
|
|
}
|
|
|
|
var x1:{ f(s:string):number;f(n:number):string; }=3;
|
|
~~
|
|
!!! error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; f(n: number): string; }'.
|
|
var x2:{ f(s:string):number; } =3;
|
|
~~
|
|
!!! error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; }'.
|
|
var x3:{ (s:string):number;(n:number):string; }=3;
|
|
~~
|
|
!!! error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; }'.
|
|
var x4:{ x;y;z:number;f(n:number):string;f(s:string):number; }=3;
|
|
~~
|
|
!!! error TS2322: Type 'number' is not assignable to type '{ x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'.
|
|
var x5:{ (s:string):number;(n:number):string;x;y;z:number;f(n:number):string;f(s:string):number; }=3;
|
|
~~
|
|
!!! error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'.
|
|
var x6:{ z:number;f:{(n:number):string;(s:string):number;}; }=3;
|
|
~~
|
|
!!! error TS2322: Type 'number' is not assignable to type '{ z: number; f: { (n: number): string; (s: string): number; }; }'.
|
|
var x7:(s:string)=>boolean=3;
|
|
~~
|
|
!!! error TS2322: Type 'number' is not assignable to type '(s: string) => boolean'.
|
|
var x8:{ z:I;[s:string]:{ x; y; };[n:number]:{x; y;};():boolean; }=3;
|
|
~~
|
|
!!! error TS2322: Type 'number' is not assignable to type '{ (): boolean; [s: string]: { x: any; y: any; }; [n: number]: { x: any; y: any; }; z: I; }'.
|
|
~~~~
|
|
!!! error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'.
|
|
var x9:I=3;
|
|
~~
|
|
!!! error TS2322: Type 'number' is not assignable to type 'I'.
|
|
var x10:I[][][][]=3;
|
|
~~~
|
|
!!! error TS2322: Type 'number' is not assignable to type 'I[][][][]'.
|
|
var x11:{z:I;x:boolean;}[][]=3;
|
|
~~~
|
|
!!! error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; }[][]'.
|
|
var x12:{z:I;x:boolean;y:(s:string)=>boolean;w:{ z:I;[s:string]:{ x; y; };[n:number]:{x; y;};():boolean; };}[][]=3;
|
|
~~~
|
|
!!! error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; y: (s: string) => boolean; w: { (): boolean; [s: string]: { x: any; y: any; }; [n: number]: { x: any; y: any; }; z: I; }; }[][]'.
|
|
~~~~
|
|
!!! error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'.
|
|
var x13:{ new(): number; new(n:number):number; x: string; w: {y: number;}; (): {}; } = 3;
|
|
~~~
|
|
!!! error TS2322: Type 'number' is not assignable to type '{ (): {}; new (): number; new (n: number): number; x: string; w: { y: number; }; }'.
|
|
var x14:{ f(x:number):boolean; p; q; ():string; }=3;
|
|
~~~
|
|
!!! error TS2322: Type 'number' is not assignable to type '{ (): string; f(x: number): boolean; p: any; q: any; }'.
|
|
var x15:number=C;
|
|
~~~
|
|
!!! error TS2322: Type 'typeof C' is not assignable to type 'number'.
|
|
|
|
|
|
|
|
|