-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6075 from Microsoft/overloadCompatibility
Implement new overload compatibility checking
- Loading branch information
Showing
52 changed files
with
1,980 additions
and
228 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 was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
tests/baselines/reference/conformanceFunctionOverloads.symbols
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
tests/baselines/reference/conformanceFunctionOverloads.types
This file was deleted.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
tests/baselines/reference/functionOverloadCompatibilityWithVoid01.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/conformance/functions/functionOverloadCompatibilityWithVoid01.ts(1,10): error TS2394: Overload signature is not compatible with function implementation. | ||
|
||
|
||
==== tests/cases/conformance/functions/functionOverloadCompatibilityWithVoid01.ts (1 errors) ==== | ||
function f(x: string): number; | ||
~ | ||
!!! error TS2394: Overload signature is not compatible with function implementation. | ||
function f(x: string): void { | ||
return; | ||
} |
10 changes: 10 additions & 0 deletions
10
tests/baselines/reference/functionOverloadCompatibilityWithVoid01.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,10 @@ | ||
//// [functionOverloadCompatibilityWithVoid01.ts] | ||
function f(x: string): number; | ||
function f(x: string): void { | ||
return; | ||
} | ||
|
||
//// [functionOverloadCompatibilityWithVoid01.js] | ||
function f(x) { | ||
return; | ||
} |
10 changes: 10 additions & 0 deletions
10
tests/baselines/reference/functionOverloadCompatibilityWithVoid02.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,10 @@ | ||
//// [functionOverloadCompatibilityWithVoid02.ts] | ||
function f(x: string): void; | ||
function f(x: string): number { | ||
return 0; | ||
} | ||
|
||
//// [functionOverloadCompatibilityWithVoid02.js] | ||
function f(x) { | ||
return 0; | ||
} |
11 changes: 11 additions & 0 deletions
11
tests/baselines/reference/functionOverloadCompatibilityWithVoid02.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,11 @@ | ||
=== tests/cases/conformance/functions/functionOverloadCompatibilityWithVoid02.ts === | ||
function f(x: string): void; | ||
>f : Symbol(f, Decl(functionOverloadCompatibilityWithVoid02.ts, 0, 0), Decl(functionOverloadCompatibilityWithVoid02.ts, 0, 28)) | ||
>x : Symbol(x, Decl(functionOverloadCompatibilityWithVoid02.ts, 0, 11)) | ||
|
||
function f(x: string): number { | ||
>f : Symbol(f, Decl(functionOverloadCompatibilityWithVoid02.ts, 0, 0), Decl(functionOverloadCompatibilityWithVoid02.ts, 0, 28)) | ||
>x : Symbol(x, Decl(functionOverloadCompatibilityWithVoid02.ts, 1, 11)) | ||
|
||
return 0; | ||
} |
12 changes: 12 additions & 0 deletions
12
tests/baselines/reference/functionOverloadCompatibilityWithVoid02.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,12 @@ | ||
=== tests/cases/conformance/functions/functionOverloadCompatibilityWithVoid02.ts === | ||
function f(x: string): void; | ||
>f : (x: string) => void | ||
>x : string | ||
|
||
function f(x: string): number { | ||
>f : (x: string) => void | ||
>x : string | ||
|
||
return 0; | ||
>0 : number | ||
} |
10 changes: 10 additions & 0 deletions
10
tests/baselines/reference/functionOverloadCompatibilityWithVoid03.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,10 @@ | ||
//// [functionOverloadCompatibilityWithVoid03.ts] | ||
function f(x: string): void; | ||
function f(x: string): void { | ||
return; | ||
} | ||
|
||
//// [functionOverloadCompatibilityWithVoid03.js] | ||
function f(x) { | ||
return; | ||
} |
11 changes: 11 additions & 0 deletions
11
tests/baselines/reference/functionOverloadCompatibilityWithVoid03.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,11 @@ | ||
=== tests/cases/conformance/functions/functionOverloadCompatibilityWithVoid03.ts === | ||
function f(x: string): void; | ||
>f : Symbol(f, Decl(functionOverloadCompatibilityWithVoid03.ts, 0, 0), Decl(functionOverloadCompatibilityWithVoid03.ts, 0, 28)) | ||
>x : Symbol(x, Decl(functionOverloadCompatibilityWithVoid03.ts, 0, 11)) | ||
|
||
function f(x: string): void { | ||
>f : Symbol(f, Decl(functionOverloadCompatibilityWithVoid03.ts, 0, 0), Decl(functionOverloadCompatibilityWithVoid03.ts, 0, 28)) | ||
>x : Symbol(x, Decl(functionOverloadCompatibilityWithVoid03.ts, 1, 11)) | ||
|
||
return; | ||
} |
11 changes: 11 additions & 0 deletions
11
tests/baselines/reference/functionOverloadCompatibilityWithVoid03.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,11 @@ | ||
=== tests/cases/conformance/functions/functionOverloadCompatibilityWithVoid03.ts === | ||
function f(x: string): void; | ||
>f : (x: string) => void | ||
>x : string | ||
|
||
function f(x: string): void { | ||
>f : (x: string) => void | ||
>x : string | ||
|
||
return; | ||
} |
Oops, something went wrong.