-
Notifications
You must be signed in to change notification settings - Fork 12.2k
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
Showing
10 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
tests/baselines/reference/renamingDestructuredPropertyInFunctionType.errors.txt
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,10 @@ | ||
tests/cases/compiler/renamingDestructuredPropertyInFunctionType.ts(1,15): error TS2797: Renaming a property in destructuring assignment is only allowed in a function or constructor implementation. | ||
|
||
|
||
==== tests/cases/compiler/renamingDestructuredPropertyInFunctionType.ts (1 errors) ==== | ||
type F = ({a: string}) => void; | ||
~~~~~~ | ||
!!! error TS2797: Renaming a property in destructuring assignment is only allowed in a function or constructor implementation. | ||
|
||
const f = ({a: string}) => string; | ||
|
11 changes: 11 additions & 0 deletions
11
tests/baselines/reference/renamingDestructuredPropertyInFunctionType.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,11 @@ | ||
//// [renamingDestructuredPropertyInFunctionType.ts] | ||
type F = ({a: string}) => void; | ||
|
||
const f = ({a: string}) => string; | ||
|
||
|
||
//// [renamingDestructuredPropertyInFunctionType.js] | ||
var f = function (_a) { | ||
var string = _a.a; | ||
return string; | ||
}; |
12 changes: 12 additions & 0 deletions
12
tests/baselines/reference/renamingDestructuredPropertyInFunctionType.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,12 @@ | ||
=== tests/cases/compiler/renamingDestructuredPropertyInFunctionType.ts === | ||
type F = ({a: string}) => void; | ||
>F : Symbol(F, Decl(renamingDestructuredPropertyInFunctionType.ts, 0, 0)) | ||
>a : Symbol(a) | ||
>string : Symbol(string, Decl(renamingDestructuredPropertyInFunctionType.ts, 0, 11)) | ||
|
||
const f = ({a: string}) => string; | ||
>f : Symbol(f, Decl(renamingDestructuredPropertyInFunctionType.ts, 2, 5)) | ||
>a : Symbol(a) | ||
>string : Symbol(string, Decl(renamingDestructuredPropertyInFunctionType.ts, 2, 12)) | ||
>string : Symbol(string, Decl(renamingDestructuredPropertyInFunctionType.ts, 2, 12)) | ||
|
13 changes: 13 additions & 0 deletions
13
tests/baselines/reference/renamingDestructuredPropertyInFunctionType.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,13 @@ | ||
=== tests/cases/compiler/renamingDestructuredPropertyInFunctionType.ts === | ||
type F = ({a: string}) => void; | ||
>F : F | ||
>a : any | ||
>string : any | ||
|
||
const f = ({a: string}) => string; | ||
>f : ({ a: string }: { a: any; }) => any | ||
>({a: string}) => string : ({ a: string }: { a: any; }) => any | ||
>a : any | ||
>string : any | ||
>string : any | ||
|
14 changes: 14 additions & 0 deletions
14
tests/baselines/reference/renamingDestructuredPropertyInFunctionType2.errors.txt
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,14 @@ | ||
tests/cases/compiler/renamingDestructuredPropertyInFunctionType2.ts(1,15): error TS2797: Renaming a property in destructuring assignment is only allowed in a function or constructor implementation. | ||
tests/cases/compiler/renamingDestructuredPropertyInFunctionType2.ts(3,16): error TS7031: Binding element 'string' implicitly has an 'any' type. | ||
|
||
|
||
==== tests/cases/compiler/renamingDestructuredPropertyInFunctionType2.ts (2 errors) ==== | ||
type F = ({a: string}) => void; | ||
~~~~~~ | ||
!!! error TS2797: Renaming a property in destructuring assignment is only allowed in a function or constructor implementation. | ||
|
||
const f = ({a: string}) => string; | ||
~~~~~~ | ||
!!! error TS7031: Binding element 'string' implicitly has an 'any' type. | ||
|
||
|
12 changes: 12 additions & 0 deletions
12
tests/baselines/reference/renamingDestructuredPropertyInFunctionType2.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,12 @@ | ||
//// [renamingDestructuredPropertyInFunctionType2.ts] | ||
type F = ({a: string}) => void; | ||
|
||
const f = ({a: string}) => string; | ||
|
||
|
||
|
||
//// [renamingDestructuredPropertyInFunctionType2.js] | ||
var f = function (_a) { | ||
var string = _a.a; | ||
return string; | ||
}; |
13 changes: 13 additions & 0 deletions
13
tests/baselines/reference/renamingDestructuredPropertyInFunctionType2.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,13 @@ | ||
=== tests/cases/compiler/renamingDestructuredPropertyInFunctionType2.ts === | ||
type F = ({a: string}) => void; | ||
>F : Symbol(F, Decl(renamingDestructuredPropertyInFunctionType2.ts, 0, 0)) | ||
>a : Symbol(a) | ||
>string : Symbol(string, Decl(renamingDestructuredPropertyInFunctionType2.ts, 0, 11)) | ||
|
||
const f = ({a: string}) => string; | ||
>f : Symbol(f, Decl(renamingDestructuredPropertyInFunctionType2.ts, 2, 5)) | ||
>a : Symbol(a) | ||
>string : Symbol(string, Decl(renamingDestructuredPropertyInFunctionType2.ts, 2, 12)) | ||
>string : Symbol(string, Decl(renamingDestructuredPropertyInFunctionType2.ts, 2, 12)) | ||
|
||
|
14 changes: 14 additions & 0 deletions
14
tests/baselines/reference/renamingDestructuredPropertyInFunctionType2.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,14 @@ | ||
=== tests/cases/compiler/renamingDestructuredPropertyInFunctionType2.ts === | ||
type F = ({a: string}) => void; | ||
>F : F | ||
>a : any | ||
>string : any | ||
|
||
const f = ({a: string}) => string; | ||
>f : ({ a: string }: { a: any; }) => any | ||
>({a: string}) => string : ({ a: string }: { a: any; }) => any | ||
>a : any | ||
>string : any | ||
>string : any | ||
|
||
|
3 changes: 3 additions & 0 deletions
3
tests/cases/compiler/renamingDestructuredPropertyInFunctionType.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,3 @@ | ||
type F = ({a: string}) => void; | ||
|
||
const f = ({a: string}) => string; |
5 changes: 5 additions & 0 deletions
5
tests/cases/compiler/renamingDestructuredPropertyInFunctionType2.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,5 @@ | ||
// @noImplicitAny: true | ||
type F = ({a: string}) => void; | ||
|
||
const f = ({a: string}) => string; | ||
|