File: contextuallyTypedBindingInitializerNegative.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 (56 lines) | stat: -rw-r--r-- 4,043 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts(4,38): error TS2322: Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts(5,41): error TS2322: Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts(6,43): error TS2322: Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts(11,51): error TS2322: Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts(16,35): error TS2322: Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts(21,22): error TS2322: Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts(26,14): error TS2322: Type '"baz"' is not assignable to type '"foo" | "bar"'.


==== tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts (7 errors) ====
    interface Show {
        show: (x: number) => string;
    }
    function f({ show: showRename = v => v }: Show) {}
                                         ~
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! related TS6502 tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts:2:11: The expected type comes from the return type of this signature.
    function f2({ "show": showRename = v => v }: Show) {}
                                            ~
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! related TS6502 tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts:2:11: The expected type comes from the return type of this signature.
    function f3({ ["show"]: showRename = v => v }: Show) {}
                                              ~
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! related TS6502 tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts:2:11: The expected type comes from the return type of this signature.
    
    interface Nested {
        nested: Show
    }
    function ff({ nested: nestedRename = { show: v => v } }: Nested) {}
                                                      ~
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! related TS6502 tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts:2:11: The expected type comes from the return type of this signature.
    
    interface StringIdentity {
        stringIdentity(s: string): string;
    }
    let { stringIdentity: id = arg => arg.length }: StringIdentity = { stringIdentity: x => x};
                                      ~~~~~~~~~~
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! related TS6502 tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts:14:5: The expected type comes from the return type of this signature.
    
    interface Tuples {
        prop: [string, number];
    }
    function g({ prop = [101, 1234] }: Tuples) {}
                         ~~~
!!! error TS2322: Type 'number' is not assignable to type 'string'.
    
    interface StringUnion {
        prop: "foo" | "bar";
    }
    function h({ prop = "baz" }: StringUnion) {}
                 ~~~~
!!! error TS2322: Type '"baz"' is not assignable to type '"foo" | "bar"'.