File: symbolProperty21.errors.txt

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (20 lines) | stat: -rw-r--r-- 1,148 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
tests/cases/conformance/es6/Symbols/symbolProperty21.ts(10,5): error TS2345: Argument of type '{ [Symbol.isConcatSpreadable]: string; [Symbol.toPrimitive]: number; [Symbol.unscopables]: true; }' is not assignable to parameter of type 'I<boolean, string>'.
  Object literal may only specify known properties, and '[Symbol.toPrimitive]' does not exist in type 'I<boolean, string>'.


==== tests/cases/conformance/es6/Symbols/symbolProperty21.ts (1 errors) ====
    interface I<T, U> {
        [Symbol.unscopables]: T;
        [Symbol.isConcatSpreadable]: U;
    }
    
    declare function foo<T, U>(p: I<T, U>): { t: T; u: U };
    
    foo({
        [Symbol.isConcatSpreadable]: "",
        [Symbol.toPrimitive]: 0,
        ~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '{ [Symbol.isConcatSpreadable]: string; [Symbol.toPrimitive]: number; [Symbol.unscopables]: true; }' is not assignable to parameter of type 'I<boolean, string>'.
!!! error TS2345:   Object literal may only specify known properties, and '[Symbol.toPrimitive]' does not exist in type 'I<boolean, string>'.
        [Symbol.unscopables]: true
    });