-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Report privacy errors on return types
- Loading branch information
1 parent
4115077
commit 4cd2d3f
Showing
13 changed files
with
5,036 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -528,6 +528,62 @@ | |
"category": "Error", | ||
"code": 2049 | ||
}, | ||
"Return type of constructor signature from exported interface has or is using private name '{0}'.": { | ||
"category": "Error", | ||
"code": 2052 | ||
}, | ||
"Return type of call signature from exported interface has or is using private name '{0}'.": { | ||
"category": "Error", | ||
"code": 2053 | ||
}, | ||
"Return type of index signature from exported interface has or is using private name '{0}'.": { | ||
"category": "Error", | ||
"code": 2054 | ||
}, | ||
"Return type of public static method from exported class has or is using private name '{0}'.": { | ||
"category": "Error", | ||
"code": 2055 | ||
}, | ||
"Return type of public method from exported class has or is using private name '{0}'.": { | ||
"category": "Error", | ||
"code": 2056 | ||
}, | ||
"Return type of method from exported interface has or is using private name '{0}'.": { | ||
"category": "Error", | ||
"code": 2057 | ||
}, | ||
"Return type of exported function has or is using private name '{0}'.": { | ||
"category": "Error", | ||
"code": 2058 | ||
}, | ||
"Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'.": { | ||
"category": "Error", | ||
"code": 2061 | ||
}, | ||
"Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'.": { | ||
"category": "Error", | ||
"code": 2062 | ||
}, | ||
"Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'.": { | ||
"category": "Error", | ||
"code": 2063 | ||
}, | ||
"Return type of public static method from exported class has or is using name '{0}' from private module '{1}'.": { | ||
"category": "Error", | ||
"code": 2064 | ||
}, | ||
"Return type of public method from exported class has or is using name '{0}' from private module '{1}'.": { | ||
"category": "Error", | ||
"code": 2065 | ||
}, | ||
"Return type of method from exported interface has or is using name '{0}' from private module '{1}'.": { | ||
"category": "Error", | ||
"code": 2066 | ||
}, | ||
"Return type of exported function has or is using name '{0}' from private module '{1}'.": { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
sheetalkamat
Author
Member
|
||
"category": "Error", | ||
"code": 2067 | ||
}, | ||
"Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'.": { | ||
"category": "Error", | ||
"code": 2208 | ||
|
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
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,16 @@ | ||
==== tests/cases/compiler/consumer.ts (1 errors) ==== | ||
import e = require('./exporter'); | ||
|
||
export function w(): e.w { // Should be OK | ||
~ | ||
!!! Return type of exported function has or is using private name 'Widget1'. | ||
return new e.w(); | ||
} | ||
==== tests/cases/compiler/w1.ts (0 errors) ==== | ||
|
||
export = Widget1 | ||
class Widget1 { name = 'one'; } | ||
|
||
==== tests/cases/compiler/exporter.ts (0 errors) ==== | ||
export import w = require('./w1'); | ||
|
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
16 changes: 16 additions & 0 deletions
16
tests/baselines/reference/exportImportNonInstantiatedModule2.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,16 @@ | ||
==== tests/cases/compiler/consumer.ts (1 errors) ==== | ||
import e = require('./exporter'); | ||
|
||
export function w(): e.w { // Should be OK | ||
~ | ||
!!! Return type of exported function has or is using private name 'Widget1'. | ||
return {name: 'value' }; | ||
} | ||
==== tests/cases/compiler/w1.ts (0 errors) ==== | ||
|
||
export = Widget1 | ||
interface Widget1 { name: string; } | ||
|
||
==== tests/cases/compiler/exporter.ts (0 errors) ==== | ||
export import w = require('./w1'); | ||
|
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.
Wouldn't it be clearer if it was specific: if it has name then it says 'has' if is using then it says 'using'?
No need to ask a human to do the job of the machine, right.