2014-11-05 21:26:03 +01:00
|
|
|
tests/cases/compiler/assignmentCompatBug2.ts(1,5): error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }'.
|
2014-09-12 22:35:07 +02:00
|
|
|
Property 'b' is missing in type '{ a: number; }'.
|
2014-11-05 21:26:03 +01:00
|
|
|
tests/cases/compiler/assignmentCompatBug2.ts(3,1): error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }'.
|
2014-09-12 22:35:07 +02:00
|
|
|
Property 'b' is missing in type '{ a: number; }'.
|
2014-11-05 21:26:03 +01:00
|
|
|
tests/cases/compiler/assignmentCompatBug2.ts(15,1): error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'.
|
2014-09-12 22:35:07 +02:00
|
|
|
Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; }'.
|
2014-11-05 21:26:03 +01:00
|
|
|
tests/cases/compiler/assignmentCompatBug2.ts(20,1): error TS2322: Type '{ f: (n: number) => number; m: number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'.
|
2014-09-12 22:35:07 +02:00
|
|
|
Property 'g' is missing in type '{ f: (n: number) => number; m: number; }'.
|
2014-11-05 21:26:03 +01:00
|
|
|
tests/cases/compiler/assignmentCompatBug2.ts(33,1): error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'.
|
2014-09-12 22:35:07 +02:00
|
|
|
Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }'.
|
|
|
|
|
|
|
|
|
2014-07-13 01:04:16 +02:00
|
|
|
==== tests/cases/compiler/assignmentCompatBug2.ts (5 errors) ====
|
|
|
|
var b2: { b: number;} = { a: 0 }; // error
|
2014-07-19 02:30:06 +02:00
|
|
|
~~
|
2014-11-05 21:26:03 +01:00
|
|
|
!!! error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }'.
|
|
|
|
!!! error TS2322: Property 'b' is missing in type '{ a: number; }'.
|
2014-07-13 01:04:16 +02:00
|
|
|
|
|
|
|
b2 = { a: 0 }; // error
|
|
|
|
~~
|
2014-11-05 21:26:03 +01:00
|
|
|
!!! error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }'.
|
|
|
|
!!! error TS2322: Property 'b' is missing in type '{ a: number; }'.
|
2014-07-13 01:04:16 +02:00
|
|
|
|
|
|
|
b2 = {b: 0, a: 0 };
|
|
|
|
|
|
|
|
var b3: { f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; };
|
|
|
|
|
|
|
|
b3 = {
|
|
|
|
f: (n) => { return 0; },
|
|
|
|
g: (s) => { return 0; },
|
|
|
|
m: 0,
|
|
|
|
}; // ok
|
|
|
|
|
|
|
|
b3 = {
|
|
|
|
~~
|
2014-11-05 21:26:03 +01:00
|
|
|
!!! error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'.
|
|
|
|
!!! error TS2322: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; }'.
|
2014-07-13 01:04:16 +02:00
|
|
|
f: (n) => { return 0; },
|
|
|
|
g: (s) => { return 0; },
|
|
|
|
}; // error
|
|
|
|
|
|
|
|
b3 = {
|
|
|
|
~~
|
2014-11-05 21:26:03 +01:00
|
|
|
!!! error TS2322: Type '{ f: (n: number) => number; m: number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'.
|
|
|
|
!!! error TS2322: Property 'g' is missing in type '{ f: (n: number) => number; m: number; }'.
|
2014-07-13 01:04:16 +02:00
|
|
|
f: (n) => { return 0; },
|
|
|
|
m: 0,
|
|
|
|
}; // error
|
|
|
|
|
|
|
|
b3 = {
|
|
|
|
f: (n) => { return 0; },
|
|
|
|
g: (s) => { return 0; },
|
|
|
|
m: 0,
|
|
|
|
n: 0,
|
|
|
|
k: (a) =>{ return null; },
|
|
|
|
}; // ok
|
|
|
|
|
|
|
|
b3 = {
|
|
|
|
~~
|
2014-11-05 21:26:03 +01:00
|
|
|
!!! error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'.
|
|
|
|
!!! error TS2322: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }'.
|
2014-07-13 01:04:16 +02:00
|
|
|
f: (n) => { return 0; },
|
|
|
|
g: (s) => { return 0; },
|
|
|
|
n: 0,
|
|
|
|
k: (a) =>{ return null; },
|
|
|
|
}; // error
|