forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix emit resolver to use same name resolver as the checker.
- Loading branch information
1 parent
3188a82
commit 1382822
Showing
16 changed files
with
1,179 additions
and
705 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
272 changes: 185 additions & 87 deletions
272
src/compiler/transformers/declarations/emitResolver.ts
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
55 changes: 55 additions & 0 deletions
55
...isolated-declarations/auto-fixed/diff/isolatedDeclarationErrorsExpandoFunctions.d.ts.diff
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,55 @@ | ||
// [[Reason: Function declarations are not fixed.]] //// | ||
|
||
//// [tests/cases/compiler/isolatedDeclarationErrorsExpandoFunctions.ts] //// | ||
|
||
=================================================================== | ||
--- TSC declarations | ||
+++ DTE declarations | ||
@@ -1,12 +1,38 @@ | ||
|
||
|
||
//// [isolatedDeclarationErrorsExpandoFunctions.d.ts] | ||
export declare function foo(): void; | ||
-export declare namespace foo { | ||
- var apply: () => void; | ||
- var call: () => void; | ||
- var bind: () => void; | ||
- var caller: () => void; | ||
- var toString: () => void; | ||
- var length: number; | ||
-} | ||
+ | ||
+/// [Errors] //// | ||
+ | ||
+isolatedDeclarationErrorsExpandoFunctions.ts(3,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. | ||
+isolatedDeclarationErrorsExpandoFunctions.ts(4,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. | ||
+isolatedDeclarationErrorsExpandoFunctions.ts(5,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. | ||
+isolatedDeclarationErrorsExpandoFunctions.ts(6,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. | ||
+isolatedDeclarationErrorsExpandoFunctions.ts(7,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. | ||
+isolatedDeclarationErrorsExpandoFunctions.ts(8,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. | ||
+ | ||
+ | ||
+==== isolatedDeclarationErrorsExpandoFunctions.ts (6 errors) ==== | ||
+ export function foo(): void {} | ||
+ | ||
+ foo.apply = () => {} | ||
+ ~~~~~~~~~ | ||
+!!! error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. | ||
+ foo.call = ()=> {} | ||
+ ~~~~~~~~ | ||
+!!! error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. | ||
+ foo.bind = ()=> {} | ||
+ ~~~~~~~~ | ||
+!!! error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. | ||
+ foo.caller = ()=> {} | ||
+ ~~~~~~~~~~ | ||
+!!! error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. | ||
+ foo.toString = ()=> {} | ||
+ ~~~~~~~~~~~~ | ||
+!!! error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. | ||
+ foo.length = 10 | ||
+ ~~~~~~~~~~ | ||
+!!! error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. | ||
+ foo.length = 10 | ||
+ | ||
\ No newline at end of file |
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
54 changes: 54 additions & 0 deletions
54
...rence/isolated-declarations/auto-fixed/dte/isolatedDeclarationErrorsExpandoFunctions.d.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,54 @@ | ||
//// [tests/cases/compiler/isolatedDeclarationErrorsExpandoFunctions.ts] //// | ||
|
||
//// [isolatedDeclarationErrorsExpandoFunctions.ts] | ||
export function foo(): void {} | ||
|
||
foo.apply = () => {} | ||
foo.call = ()=> {} | ||
foo.bind = ()=> {} | ||
foo.caller = ()=> {} | ||
foo.toString = ()=> {} | ||
foo.length = 10 | ||
foo.length = 10 | ||
|
||
|
||
/// [Declarations] //// | ||
|
||
|
||
|
||
//// [isolatedDeclarationErrorsExpandoFunctions.d.ts] | ||
export declare function foo(): void; | ||
|
||
/// [Errors] //// | ||
|
||
isolatedDeclarationErrorsExpandoFunctions.ts(3,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. | ||
isolatedDeclarationErrorsExpandoFunctions.ts(4,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. | ||
isolatedDeclarationErrorsExpandoFunctions.ts(5,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. | ||
isolatedDeclarationErrorsExpandoFunctions.ts(6,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. | ||
isolatedDeclarationErrorsExpandoFunctions.ts(7,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. | ||
isolatedDeclarationErrorsExpandoFunctions.ts(8,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. | ||
|
||
|
||
==== isolatedDeclarationErrorsExpandoFunctions.ts (6 errors) ==== | ||
export function foo(): void {} | ||
|
||
foo.apply = () => {} | ||
~~~~~~~~~ | ||
!!! error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. | ||
foo.call = ()=> {} | ||
~~~~~~~~ | ||
!!! error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. | ||
foo.bind = ()=> {} | ||
~~~~~~~~ | ||
!!! error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. | ||
foo.caller = ()=> {} | ||
~~~~~~~~~~ | ||
!!! error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. | ||
foo.toString = ()=> {} | ||
~~~~~~~~~~~~ | ||
!!! error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. | ||
foo.length = 10 | ||
~~~~~~~~~~ | ||
!!! error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. | ||
foo.length = 10 | ||
|
28 changes: 28 additions & 0 deletions
28
...rence/isolated-declarations/auto-fixed/tsc/isolatedDeclarationErrorsExpandoFunctions.d.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,28 @@ | ||
//// [tests/cases/compiler/isolatedDeclarationErrorsExpandoFunctions.ts] //// | ||
|
||
//// [isolatedDeclarationErrorsExpandoFunctions.ts] | ||
export function foo(): void {} | ||
|
||
foo.apply = () => {} | ||
foo.call = ()=> {} | ||
foo.bind = ()=> {} | ||
foo.caller = ()=> {} | ||
foo.toString = ()=> {} | ||
foo.length = 10 | ||
foo.length = 10 | ||
|
||
|
||
/// [Declarations] //// | ||
|
||
|
||
|
||
//// [isolatedDeclarationErrorsExpandoFunctions.d.ts] | ||
export declare function foo(): void; | ||
export declare namespace foo { | ||
var apply: () => void; | ||
var call: () => void; | ||
var bind: () => void; | ||
var caller: () => void; | ||
var toString: () => void; | ||
var length: number; | ||
} |
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
Oops, something went wrong.