forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7e8c56c
commit 7dc1952
Showing
6 changed files
with
74 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
tests/baselines/reference/objectBindingPatternContextuallyTypesArgument.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//// [objectBindingPatternContextuallyTypesArgument.ts] | ||
declare function id<T>(x: T): T; | ||
const { f = (x: string) => x.length } = id({ f: x => x.charAt }); | ||
|
||
|
||
//// [objectBindingPatternContextuallyTypesArgument.js] | ||
var _a = id({ f: function (x) { return x.charAt; } }).f, f = _a === void 0 ? function (x) { return x.length; } : _a; |
21 changes: 21 additions & 0 deletions
21
tests/baselines/reference/objectBindingPatternContextuallyTypesArgument.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
=== tests/cases/compiler/objectBindingPatternContextuallyTypesArgument.ts === | ||
declare function id<T>(x: T): T; | ||
>id : Symbol(id, Decl(objectBindingPatternContextuallyTypesArgument.ts, 0, 0)) | ||
>T : Symbol(T, Decl(objectBindingPatternContextuallyTypesArgument.ts, 0, 20)) | ||
>x : Symbol(x, Decl(objectBindingPatternContextuallyTypesArgument.ts, 0, 23)) | ||
>T : Symbol(T, Decl(objectBindingPatternContextuallyTypesArgument.ts, 0, 20)) | ||
>T : Symbol(T, Decl(objectBindingPatternContextuallyTypesArgument.ts, 0, 20)) | ||
|
||
const { f = (x: string) => x.length } = id({ f: x => x.charAt }); | ||
>f : Symbol(f, Decl(objectBindingPatternContextuallyTypesArgument.ts, 1, 7)) | ||
>x : Symbol(x, Decl(objectBindingPatternContextuallyTypesArgument.ts, 1, 13)) | ||
>x.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) | ||
>x : Symbol(x, Decl(objectBindingPatternContextuallyTypesArgument.ts, 1, 13)) | ||
>length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) | ||
>id : Symbol(id, Decl(objectBindingPatternContextuallyTypesArgument.ts, 0, 0)) | ||
>f : Symbol(f, Decl(objectBindingPatternContextuallyTypesArgument.ts, 1, 44)) | ||
>x : Symbol(x, Decl(objectBindingPatternContextuallyTypesArgument.ts, 1, 47)) | ||
>x.charAt : Symbol(String.charAt, Decl(lib.es5.d.ts, --, --)) | ||
>x : Symbol(x, Decl(objectBindingPatternContextuallyTypesArgument.ts, 1, 47)) | ||
>charAt : Symbol(String.charAt, Decl(lib.es5.d.ts, --, --)) | ||
|
22 changes: 22 additions & 0 deletions
22
tests/baselines/reference/objectBindingPatternContextuallyTypesArgument.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
=== tests/cases/compiler/objectBindingPatternContextuallyTypesArgument.ts === | ||
declare function id<T>(x: T): T; | ||
>id : <T>(x: T) => T | ||
>x : T | ||
|
||
const { f = (x: string) => x.length } = id({ f: x => x.charAt }); | ||
>f : ((x: string) => number) | ((x: string) => (pos: number) => string) | ||
>(x: string) => x.length : (x: string) => number | ||
>x : string | ||
>x.length : number | ||
>x : string | ||
>length : number | ||
>id({ f: x => x.charAt }) : { f: (x: string) => (pos: number) => string; } | ||
>id : <T>(x: T) => T | ||
>{ f: x => x.charAt } : { f: (x: string) => (pos: number) => string; } | ||
>f : (x: string) => (pos: number) => string | ||
>x => x.charAt : (x: string) => (pos: number) => string | ||
>x : string | ||
>x.charAt : (pos: number) => string | ||
>x : string | ||
>charAt : (pos: number) => string | ||
|
2 changes: 2 additions & 0 deletions
2
tests/cases/compiler/objectBindingPatternContextuallyTypesArgument.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
declare function id<T>(x: T): T; | ||
const { f = (x: string) => x.length } = id({ f: x => x.charAt }); |