File: excessPropertyCheckWithSpread.errors.txt

package info (click to toggle)
node-typescript 4.9.5%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 533,908 kB
  • sloc: javascript: 2,018,330; makefile: 7; sh: 1
file content (24 lines) | stat: -rw-r--r-- 872 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
tests/cases/compiler/excessPropertyCheckWithSpread.ts(1,25): error TS2842: 'number' is an unused renaming of 'a'. Did you intend to use it as a type annotation?


==== tests/cases/compiler/excessPropertyCheckWithSpread.ts (1 errors) ====
    declare function f({ a: number }): void
                            ~~~~~~
!!! error TS2842: 'number' is an unused renaming of 'a'. Did you intend to use it as a type annotation?
!!! related TS2843 tests/cases/compiler/excessPropertyCheckWithSpread.ts:1:33: We can only write a type for 'a' by adding a type for the entire parameter here.
    interface I {
        readonly n: number;
    }
    declare let i: I;
    f({ a: 1, ...i });
    
    interface R {
        opt?: number
    }
    interface L {
        opt: string
    }
    declare let l: L;
    declare let r: R;
    f({ a: 1, ...l, ...r });