-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don’t enforce export/declare overload modifier consistency across mod…
…ule augmentations (#59416)
- Loading branch information
1 parent
9757109
commit 9405f21
Showing
4 changed files
with
55 additions
and
22 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
5 changes: 1 addition & 4 deletions
5
tests/baselines/reference/missingFunctionImplementation2.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
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 |
---|---|---|
@@ -1,12 +1,9 @@ | ||
parserStrictMode8.ts(2,10): error TS1100: Invalid use of 'eval' in strict mode. | ||
parserStrictMode8.ts(2,10): error TS2384: Overload signatures must all be ambient or non-ambient. | ||
|
||
|
||
==== parserStrictMode8.ts (2 errors) ==== | ||
==== parserStrictMode8.ts (1 errors) ==== | ||
"use strict"; | ||
function eval() { | ||
~~~~ | ||
!!! error TS1100: Invalid use of 'eval' in strict mode. | ||
~~~~ | ||
!!! error TS2384: Overload signatures must all be ambient or non-ambient. | ||
} |
23 changes: 23 additions & 0 deletions
23
tests/cases/compiler/crossFileOverloadModifierConsistency.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,23 @@ | ||
// @strict: true | ||
// @module: preserve | ||
// @noEmit: true | ||
// @noTypesAndSymbols: true | ||
|
||
// @Filename: node_modules/library/index.d.ts | ||
declare function get(): string; | ||
|
||
export { get }; | ||
|
||
// @Filename: node_modules/non-ambient/index.ts | ||
export function real(arg?: string): any {} | ||
|
||
// @Filename: augmentations.d.ts | ||
export {}; | ||
|
||
declare module "library" { | ||
export function get(): string | null; | ||
} | ||
|
||
declare module "non-ambient" { | ||
export function real(arg: string): string; | ||
} |