mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
27 lines
1.5 KiB
Plaintext
27 lines
1.5 KiB
Plaintext
excessPropertyCheckWithEmptyObject.ts(4,58): error TS2353: Object literal may only specify known properties, and 'readonly' does not exist in type 'PropertyDescriptor & ThisType<any>'.
|
|
excessPropertyCheckWithEmptyObject.ts(9,30): error TS2353: Object literal may only specify known properties, and 'y' does not exist in type 'A & ThisType<any>'.
|
|
excessPropertyCheckWithEmptyObject.ts(14,34): error TS2353: Object literal may only specify known properties, and 'y' does not exist in type 'Empty & { x: number; }'.
|
|
|
|
|
|
==== excessPropertyCheckWithEmptyObject.ts (3 errors) ====
|
|
// Repro from #14910
|
|
|
|
// Excess property error expected here
|
|
Object.defineProperty(window, "prop", { value: "v1.0.0", readonly: false });
|
|
~~~~~~~~
|
|
!!! error TS2353: Object literal may only specify known properties, and 'readonly' does not exist in type 'PropertyDescriptor & ThisType<any>'.
|
|
|
|
interface A { x?: string }
|
|
|
|
// Excess property error expected here
|
|
let a: A & ThisType<any> = { y: 10 };
|
|
~
|
|
!!! error TS2353: Object literal may only specify known properties, and 'y' does not exist in type 'A & ThisType<any>'.
|
|
|
|
interface Empty {}
|
|
|
|
// Excess property error expected here
|
|
let x: Empty & { x: number } = { y: "hello" };
|
|
~
|
|
!!! error TS2353: Object literal may only specify known properties, and 'y' does not exist in type 'Empty & { x: number; }'.
|
|
|