You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tests/cases/compiler/excessPropertyCheckWithEmptyObject.ts(4,23): error TS2304: Cannot find name 'window'.
2
+
tests/cases/compiler/excessPropertyCheckWithEmptyObject.ts(4,58): error TS2345: Argument of type '{ value: string; readonly: boolean; }' is not assignable to parameter of type 'PropertyDescriptor & ThisType<any>'.
3
+
Object literal may only specify known properties, and 'readonly' does not exist in type 'PropertyDescriptor & ThisType<any>'.
4
+
tests/cases/compiler/excessPropertyCheckWithEmptyObject.ts(9,30): error TS2322: Type '{ y: number; }' is not assignable to type 'A & ThisType<any>'.
5
+
Object literal may only specify known properties, and 'y' does not exist in type 'A & ThisType<any>'.
6
+
tests/cases/compiler/excessPropertyCheckWithEmptyObject.ts(14,34): error TS2322: Type '{ y: string; }' is not assignable to type 'Empty & { x: number; }'.
7
+
Object literal may only specify known properties, and 'y' does not exist in type 'Empty & { x: number; }'.
!!! error TS2345: Argument of type '{ value: string; readonly: boolean; }' is not assignable to parameter of type 'PropertyDescriptor & ThisType<any>'.
19
+
!!! error TS2345: Object literal may only specify known properties, and 'readonly' does not exist in type 'PropertyDescriptor & ThisType<any>'.
20
+
21
+
interface A { x?: string }
22
+
23
+
// Excess property error expected here
24
+
let a: A & ThisType<any> = { y: 10 };
25
+
~~~~~
26
+
!!! error TS2322: Type '{ y: number; }' is not assignable to type 'A & ThisType<any>'.
27
+
!!! error TS2322: Object literal may only specify known properties, and 'y' does not exist in type 'A & ThisType<any>'.
28
+
29
+
interface Empty {}
30
+
31
+
// Excess property error expected here
32
+
let x: Empty & { x: number } = { y: "hello" };
33
+
~~~~~~~~~~
34
+
!!! error TS2322: Type '{ y: string; }' is not assignable to type 'Empty & { x: number; }'.
35
+
!!! error TS2322: Object literal may only specify known properties, and 'y' does not exist in type 'Empty & { x: number; }'.
0 commit comments