Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dc28aaa

Browse filesBrowse files
committed
Add --noStrictGenericChecks compiler option
1 parent d27f4d4 commit dc28aaa
Copy full SHA for dc28aaa

4 files changed

+13-1Lines changed: 13 additions & 1 deletion

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/compiler/checker.ts‎

Copy file name to clipboardExpand all lines: src/compiler/checker.ts
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9509,7 +9509,8 @@ namespace ts {
95099509
// in the context of the target signature before checking the relationship. Ideally we'd do
95109510
// this regardless of the number of signatures, but the potential costs are prohibitive due
95119511
// to the quadratic nature of the logic below.
9512-
result = signatureRelatedTo(sourceSignatures[0], targetSignatures[0], /*erase*/ relation === comparableRelation, reportErrors);
9512+
const eraseGenerics = relation === comparableRelation || compilerOptions.noStrictGenericChecks;
9513+
result = signatureRelatedTo(sourceSignatures[0], targetSignatures[0], eraseGenerics, reportErrors);
95139514
}
95149515
else {
95159516
outer: for (const t of targetSignatures) {
Collapse file

‎src/compiler/commandLineParser.ts‎

Copy file name to clipboardExpand all lines: src/compiler/commandLineParser.ts
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,12 @@ namespace ts {
620620
category: Diagnostics.Advanced_Options,
621621
description: Diagnostics.The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files
622622
},
623+
{
624+
name: "noStrictGenericChecks",
625+
type: "boolean",
626+
category: Diagnostics.Advanced_Options,
627+
description: Diagnostics.Disable_strict_checking_of_generic_signatures_in_function_types,
628+
},
623629
{
624630
// A list of plugins to load in the language service
625631
name: "plugins",
Collapse file

‎src/compiler/diagnosticMessages.json‎

Copy file name to clipboardExpand all lines: src/compiler/diagnosticMessages.json
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3278,6 +3278,10 @@
32783278
"category": "Message",
32793279
"code": 6184
32803280
},
3281+
"Disable strict checking of generic signatures in function types.": {
3282+
"category": "Message",
3283+
"code": 6185
3284+
},
32813285
"Variable '{0}' implicitly has an '{1}' type.": {
32823286
"category": "Error",
32833287
"code": 7005
Collapse file

‎src/compiler/types.ts‎

Copy file name to clipboardExpand all lines: src/compiler/types.ts
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3522,6 +3522,7 @@ namespace ts {
35223522
noImplicitAny?: boolean; // Always combine with strict property
35233523
noImplicitReturns?: boolean;
35243524
noImplicitThis?: boolean; // Always combine with strict property
3525+
noStrictGenericChecks?: boolean;
35253526
noUnusedLocals?: boolean;
35263527
noUnusedParameters?: boolean;
35273528
noImplicitUseStrict?: boolean;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.