|
| 1 | +=== tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts === |
| 2 | +interface Show { |
| 3 | +>Show : Symbol(Show, Decl(contextuallyTypedBindingInitializerNegative.ts, 0, 0)) |
| 4 | + |
| 5 | + show: (x: number) => string; |
| 6 | +>show : Symbol(Show.show, Decl(contextuallyTypedBindingInitializerNegative.ts, 0, 16)) |
| 7 | +>x : Symbol(x, Decl(contextuallyTypedBindingInitializerNegative.ts, 1, 11)) |
| 8 | +} |
| 9 | +function f({ show: showRename = v => v }: Show) {} |
| 10 | +>f : Symbol(f, Decl(contextuallyTypedBindingInitializerNegative.ts, 2, 1)) |
| 11 | +>show : Symbol(Show.show, Decl(contextuallyTypedBindingInitializerNegative.ts, 0, 16)) |
| 12 | +>showRename : Symbol(showRename, Decl(contextuallyTypedBindingInitializerNegative.ts, 3, 12)) |
| 13 | +>v : Symbol(v, Decl(contextuallyTypedBindingInitializerNegative.ts, 3, 31)) |
| 14 | +>v : Symbol(v, Decl(contextuallyTypedBindingInitializerNegative.ts, 3, 31)) |
| 15 | +>Show : Symbol(Show, Decl(contextuallyTypedBindingInitializerNegative.ts, 0, 0)) |
| 16 | + |
| 17 | +function f2({ "show": showRename = v => v }: Show) {} |
| 18 | +>f2 : Symbol(f2, Decl(contextuallyTypedBindingInitializerNegative.ts, 3, 50)) |
| 19 | +>showRename : Symbol(showRename, Decl(contextuallyTypedBindingInitializerNegative.ts, 4, 13)) |
| 20 | +>v : Symbol(v, Decl(contextuallyTypedBindingInitializerNegative.ts, 4, 34)) |
| 21 | +>v : Symbol(v, Decl(contextuallyTypedBindingInitializerNegative.ts, 4, 34)) |
| 22 | +>Show : Symbol(Show, Decl(contextuallyTypedBindingInitializerNegative.ts, 0, 0)) |
| 23 | + |
| 24 | +function f3({ ["show"]: showRename = v => v }: Show) {} |
| 25 | +>f3 : Symbol(f3, Decl(contextuallyTypedBindingInitializerNegative.ts, 4, 53)) |
| 26 | +>"show" : Symbol(showRename, Decl(contextuallyTypedBindingInitializerNegative.ts, 5, 13)) |
| 27 | +>showRename : Symbol(showRename, Decl(contextuallyTypedBindingInitializerNegative.ts, 5, 13)) |
| 28 | +>v : Symbol(v, Decl(contextuallyTypedBindingInitializerNegative.ts, 5, 36)) |
| 29 | +>v : Symbol(v, Decl(contextuallyTypedBindingInitializerNegative.ts, 5, 36)) |
| 30 | +>Show : Symbol(Show, Decl(contextuallyTypedBindingInitializerNegative.ts, 0, 0)) |
| 31 | + |
| 32 | +interface Nested { |
| 33 | +>Nested : Symbol(Nested, Decl(contextuallyTypedBindingInitializerNegative.ts, 5, 55)) |
| 34 | + |
| 35 | + nested: Show |
| 36 | +>nested : Symbol(Nested.nested, Decl(contextuallyTypedBindingInitializerNegative.ts, 7, 18)) |
| 37 | +>Show : Symbol(Show, Decl(contextuallyTypedBindingInitializerNegative.ts, 0, 0)) |
| 38 | +} |
| 39 | +function ff({ nested: nestedRename = { show: v => v } }: Nested) {} |
| 40 | +>ff : Symbol(ff, Decl(contextuallyTypedBindingInitializerNegative.ts, 9, 1)) |
| 41 | +>nested : Symbol(Nested.nested, Decl(contextuallyTypedBindingInitializerNegative.ts, 7, 18)) |
| 42 | +>nestedRename : Symbol(nestedRename, Decl(contextuallyTypedBindingInitializerNegative.ts, 10, 13)) |
| 43 | +>show : Symbol(show, Decl(contextuallyTypedBindingInitializerNegative.ts, 10, 38)) |
| 44 | +>v : Symbol(v, Decl(contextuallyTypedBindingInitializerNegative.ts, 10, 44)) |
| 45 | +>v : Symbol(v, Decl(contextuallyTypedBindingInitializerNegative.ts, 10, 44)) |
| 46 | +>Nested : Symbol(Nested, Decl(contextuallyTypedBindingInitializerNegative.ts, 5, 55)) |
| 47 | + |
| 48 | +interface StringIdentity { |
| 49 | +>StringIdentity : Symbol(StringIdentity, Decl(contextuallyTypedBindingInitializerNegative.ts, 10, 67)) |
| 50 | + |
| 51 | + stringIdentity(s: string): string; |
| 52 | +>stringIdentity : Symbol(StringIdentity.stringIdentity, Decl(contextuallyTypedBindingInitializerNegative.ts, 12, 26)) |
| 53 | +>s : Symbol(s, Decl(contextuallyTypedBindingInitializerNegative.ts, 13, 19)) |
| 54 | +} |
| 55 | +let { stringIdentity: id = arg => arg.length }: StringIdentity = { stringIdentity: x => x}; |
| 56 | +>stringIdentity : Symbol(StringIdentity.stringIdentity, Decl(contextuallyTypedBindingInitializerNegative.ts, 12, 26)) |
| 57 | +>id : Symbol(id, Decl(contextuallyTypedBindingInitializerNegative.ts, 15, 5)) |
| 58 | +>arg : Symbol(arg, Decl(contextuallyTypedBindingInitializerNegative.ts, 15, 26)) |
| 59 | +>arg.length : Symbol(String.length, Decl(lib.d.ts, --, --)) |
| 60 | +>arg : Symbol(arg, Decl(contextuallyTypedBindingInitializerNegative.ts, 15, 26)) |
| 61 | +>length : Symbol(String.length, Decl(lib.d.ts, --, --)) |
| 62 | +>StringIdentity : Symbol(StringIdentity, Decl(contextuallyTypedBindingInitializerNegative.ts, 10, 67)) |
| 63 | +>stringIdentity : Symbol(stringIdentity, Decl(contextuallyTypedBindingInitializerNegative.ts, 15, 66)) |
| 64 | +>x : Symbol(x, Decl(contextuallyTypedBindingInitializerNegative.ts, 15, 82)) |
| 65 | +>x : Symbol(x, Decl(contextuallyTypedBindingInitializerNegative.ts, 15, 82)) |
| 66 | + |
| 67 | +interface Tuples { |
| 68 | +>Tuples : Symbol(Tuples, Decl(contextuallyTypedBindingInitializerNegative.ts, 15, 91)) |
| 69 | + |
| 70 | + prop: [string, number]; |
| 71 | +>prop : Symbol(Tuples.prop, Decl(contextuallyTypedBindingInitializerNegative.ts, 17, 18)) |
| 72 | +} |
| 73 | +function g({ prop = [101, 1234] }: Tuples) {} |
| 74 | +>g : Symbol(g, Decl(contextuallyTypedBindingInitializerNegative.ts, 19, 1)) |
| 75 | +>prop : Symbol(prop, Decl(contextuallyTypedBindingInitializerNegative.ts, 20, 12)) |
| 76 | +>Tuples : Symbol(Tuples, Decl(contextuallyTypedBindingInitializerNegative.ts, 15, 91)) |
| 77 | + |
| 78 | +interface StringUnion { |
| 79 | +>StringUnion : Symbol(StringUnion, Decl(contextuallyTypedBindingInitializerNegative.ts, 20, 45)) |
| 80 | + |
| 81 | + prop: "foo" | "bar"; |
| 82 | +>prop : Symbol(StringUnion.prop, Decl(contextuallyTypedBindingInitializerNegative.ts, 22, 23)) |
| 83 | +} |
| 84 | +function h({ prop = "baz" }: StringUnion) {} |
| 85 | +>h : Symbol(h, Decl(contextuallyTypedBindingInitializerNegative.ts, 24, 1)) |
| 86 | +>prop : Symbol(prop, Decl(contextuallyTypedBindingInitializerNegative.ts, 25, 12)) |
| 87 | +>StringUnion : Symbol(StringUnion, Decl(contextuallyTypedBindingInitializerNegative.ts, 20, 45)) |
| 88 | + |
0 commit comments