@zzzen/pyright-internal 1.2.0-dev.20240421 → 1.2.0-dev.20240505

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/dist/analyzer/analyzerNodeInfo.d.ts +1 -4
  2. package/dist/analyzer/analyzerNodeInfo.js +1 -11
  3. package/dist/analyzer/analyzerNodeInfo.js.map +1 -1
  4. package/dist/analyzer/binder.d.ts +0 -2
  5. package/dist/analyzer/binder.js +42 -66
  6. package/dist/analyzer/binder.js.map +1 -1
  7. package/dist/analyzer/checker.js +98 -45
  8. package/dist/analyzer/checker.js.map +1 -1
  9. package/dist/analyzer/constructors.js +31 -13
  10. package/dist/analyzer/constructors.js.map +1 -1
  11. package/dist/analyzer/dataClasses.d.ts +1 -1
  12. package/dist/analyzer/dataClasses.js +23 -11
  13. package/dist/analyzer/dataClasses.js.map +1 -1
  14. package/dist/analyzer/deprecatedSymbols.js +2 -4
  15. package/dist/analyzer/deprecatedSymbols.js.map +1 -1
  16. package/dist/analyzer/namedTuples.js +0 -8
  17. package/dist/analyzer/namedTuples.js.map +1 -1
  18. package/dist/analyzer/operations.js +3 -2
  19. package/dist/analyzer/operations.js.map +1 -1
  20. package/dist/analyzer/packageTypeVerifier.js +10 -10
  21. package/dist/analyzer/parseTreeUtils.d.ts +6 -3
  22. package/dist/analyzer/parseTreeUtils.js +75 -46
  23. package/dist/analyzer/parseTreeUtils.js.map +1 -1
  24. package/dist/analyzer/patternMatching.js +19 -13
  25. package/dist/analyzer/patternMatching.js.map +1 -1
  26. package/dist/analyzer/protocols.js +32 -13
  27. package/dist/analyzer/protocols.js.map +1 -1
  28. package/dist/analyzer/scope.d.ts +14 -7
  29. package/dist/analyzer/scope.js +28 -17
  30. package/dist/analyzer/scope.js.map +1 -1
  31. package/dist/analyzer/scopeUtils.js +3 -3
  32. package/dist/analyzer/scopeUtils.js.map +1 -1
  33. package/dist/analyzer/typeEvaluator.js +252 -207
  34. package/dist/analyzer/typeEvaluator.js.map +1 -1
  35. package/dist/analyzer/typeEvaluatorTypes.d.ts +5 -1
  36. package/dist/analyzer/typeGuards.js +35 -110
  37. package/dist/analyzer/typeGuards.js.map +1 -1
  38. package/dist/analyzer/typeUtils.js +6 -8
  39. package/dist/analyzer/typeUtils.js.map +1 -1
  40. package/dist/analyzer/typedDicts.js +4 -6
  41. package/dist/analyzer/typedDicts.js.map +1 -1
  42. package/dist/analyzer/types.js +13 -0
  43. package/dist/analyzer/types.js.map +1 -1
  44. package/dist/common/console.d.ts +12 -1
  45. package/dist/common/console.js +22 -3
  46. package/dist/common/console.js.map +1 -1
  47. package/dist/common/diagnostic.d.ts +4 -0
  48. package/dist/common/diagnostic.js +10 -4
  49. package/dist/common/diagnostic.js.map +1 -1
  50. package/dist/common/envVarUtils.d.ts +2 -2
  51. package/dist/common/envVarUtils.js +1 -2
  52. package/dist/common/envVarUtils.js.map +1 -1
  53. package/dist/common/languageServerInterface.d.ts +6 -3
  54. package/dist/common/languageServerInterface.js +11 -0
  55. package/dist/common/languageServerInterface.js.map +1 -1
  56. package/dist/common/uri/uri.d.ts +2 -0
  57. package/dist/common/uri/uri.js +3 -1
  58. package/dist/common/uri/uri.js.map +1 -1
  59. package/dist/languageServerBase.d.ts +3 -2
  60. package/dist/languageServerBase.js +13 -35
  61. package/dist/languageServerBase.js.map +1 -1
  62. package/dist/languageService/callHierarchyProvider.js +5 -2
  63. package/dist/languageService/callHierarchyProvider.js.map +1 -1
  64. package/dist/languageService/completionProvider.js +12 -8
  65. package/dist/languageService/completionProvider.js.map +1 -1
  66. package/dist/languageService/documentSymbolCollector.js +1 -1
  67. package/dist/languageService/dynamicFeature.d.ts +18 -0
  68. package/dist/languageService/dynamicFeature.js +54 -0
  69. package/dist/languageService/dynamicFeature.js.map +1 -0
  70. package/dist/languageService/fileWatcherDynamicFeature.d.ts +12 -0
  71. package/dist/languageService/fileWatcherDynamicFeature.js +49 -0
  72. package/dist/languageService/fileWatcherDynamicFeature.js.map +1 -0
  73. package/dist/languageService/referencesProvider.js +3 -2
  74. package/dist/languageService/referencesProvider.js.map +1 -1
  75. package/dist/localization/package.nls.cs.json +28 -26
  76. package/dist/localization/package.nls.de.json +28 -26
  77. package/dist/localization/package.nls.en-us.json +1 -1
  78. package/dist/localization/package.nls.es.json +27 -25
  79. package/dist/localization/package.nls.fr.json +28 -26
  80. package/dist/localization/package.nls.it.json +28 -26
  81. package/dist/localization/package.nls.ja.json +28 -26
  82. package/dist/localization/package.nls.ko.json +28 -26
  83. package/dist/localization/package.nls.pl.json +27 -25
  84. package/dist/localization/package.nls.pt-br.json +28 -26
  85. package/dist/localization/package.nls.qps-ploc.json +25 -23
  86. package/dist/localization/package.nls.ru.json +28 -26
  87. package/dist/localization/package.nls.tr.json +28 -26
  88. package/dist/localization/package.nls.zh-cn.json +28 -26
  89. package/dist/localization/package.nls.zh-tw.json +28 -26
  90. package/dist/parser/parseNodes.d.ts +2 -2
  91. package/dist/parser/tokenizer.js +7 -1
  92. package/dist/parser/tokenizer.js.map +1 -1
  93. package/dist/tests/checker.test.js +8 -0
  94. package/dist/tests/checker.test.js.map +1 -1
  95. package/dist/tests/envVarUtils.test.js +20 -0
  96. package/dist/tests/envVarUtils.test.js.map +1 -1
  97. package/dist/tests/fourslash/{completions.importDunderNames.fourslash.js → completions.import.dunderNames.fourslash.js} +1 -1
  98. package/dist/tests/fourslash/completions.import.dunderNames.fourslash.js.map +1 -0
  99. package/dist/tests/fourslash/{completions.importsDuplicates.fourslash.js → completions.import.duplicates.fourslash.js} +1 -1
  100. package/dist/tests/fourslash/{completions.importsDuplicates.fourslash.js.map → completions.import.duplicates.fourslash.js.map} +1 -1
  101. package/dist/tests/fourslash/completions.import.exactMatch.fourslash.js +29 -0
  102. package/dist/tests/fourslash/completions.import.exactMatch.fourslash.js.map +1 -0
  103. package/dist/tests/fourslash/completions.import.excludeAlreadyImported.fourslash.js +14 -0
  104. package/dist/tests/fourslash/completions.import.excludeAlreadyImported.fourslash.js.map +1 -0
  105. package/dist/tests/fourslash/completions.import.interimFile.fourslash.disabled.d.ts +1 -0
  106. package/dist/tests/fourslash/{completions.importInterimFile.fourslash.disabled.js → completions.import.interimFile.fourslash.disabled.js} +1 -1
  107. package/dist/tests/fourslash/completions.import.interimFile.fourslash.disabled.js.map +1 -0
  108. package/dist/tests/fourslash/{completions.importPrivateNoPytyped.fourslash.js → completions.import.privateNoPytyped.fourslash.js} +1 -1
  109. package/dist/tests/fourslash/completions.import.privateNoPytyped.fourslash.js.map +1 -0
  110. package/dist/tests/fourslash/{completions.importPytyped.fourslash.js → completions.import.pytyped.fourslash.js} +1 -1
  111. package/dist/tests/fourslash/completions.import.pytyped.fourslash.js.map +1 -0
  112. package/dist/tests/fourslash/{completions.importPytypedLocal.fourslash.js → completions.import.pytypedLocal.fourslash.js} +1 -1
  113. package/dist/tests/fourslash/completions.import.pytypedLocal.fourslash.js.map +1 -0
  114. package/dist/tests/fourslash/completions.import.submodule.fourslash.d.ts +1 -0
  115. package/dist/tests/fourslash/{completions.importSubmodule.fourslash.js → completions.import.submodule.fourslash.js} +1 -1
  116. package/dist/tests/fourslash/completions.import.submodule.fourslash.js.map +1 -0
  117. package/dist/tests/harness/fourslash/testState.js +1 -1
  118. package/dist/tests/harness/fourslash/testState.js.map +1 -1
  119. package/dist/tests/harness/vfs/pathValidation.js +2 -1
  120. package/dist/tests/harness/vfs/pathValidation.js.map +1 -1
  121. package/dist/tests/parser.test.js +7 -2
  122. package/dist/tests/parser.test.js.map +1 -1
  123. package/dist/tests/typeEvaluator1.test.js +60 -480
  124. package/dist/tests/typeEvaluator1.test.js.map +1 -1
  125. package/dist/tests/typeEvaluator2.test.js +0 -482
  126. package/dist/tests/typeEvaluator2.test.js.map +1 -1
  127. package/dist/tests/typeEvaluator3.test.js +0 -604
  128. package/dist/tests/typeEvaluator3.test.js.map +1 -1
  129. package/dist/tests/typeEvaluator4.test.js +5 -423
  130. package/dist/tests/typeEvaluator4.test.js.map +1 -1
  131. package/dist/tests/typeEvaluator5.test.js +2 -2
  132. package/dist/tests/typeEvaluator5.test.js.map +1 -1
  133. package/dist/tests/typeEvaluator6.test.d.ts +1 -0
  134. package/dist/tests/typeEvaluator6.test.js +712 -0
  135. package/dist/tests/typeEvaluator6.test.js.map +1 -0
  136. package/dist/tests/typeEvaluator7.test.d.ts +1 -0
  137. package/dist/tests/typeEvaluator7.test.js +677 -0
  138. package/dist/tests/typeEvaluator7.test.js.map +1 -0
  139. package/dist/tests/typeEvaluator8.test.d.ts +1 -0
  140. package/dist/tests/typeEvaluator8.test.js +660 -0
  141. package/dist/tests/typeEvaluator8.test.js.map +1 -0
  142. package/dist/workspaceFactory.d.ts +3 -1
  143. package/dist/workspaceFactory.js.map +1 -1
  144. package/package.json +1 -1
  145. package/dist/tests/fourslash/completions.importDunderNames.fourslash.js.map +0 -1
  146. package/dist/tests/fourslash/completions.importInterimFile.fourslash.disabled.js.map +0 -1
  147. package/dist/tests/fourslash/completions.importPrivateNoPytyped.fourslash.js.map +0 -1
  148. package/dist/tests/fourslash/completions.importPytyped.fourslash.js.map +0 -1
  149. package/dist/tests/fourslash/completions.importPytypedLocal.fourslash.js.map +0 -1
  150. package/dist/tests/fourslash/completions.importSubmodule.fourslash.js.map +0 -1
  151. /package/dist/tests/fourslash/{completions.importDunderNames.fourslash.d.ts → completions.import.dunderNames.fourslash.d.ts} +0 -0
  152. /package/dist/tests/fourslash/{completions.importPrivateNoPytyped.fourslash.d.ts → completions.import.duplicates.fourslash.d.ts} +0 -0
  153. /package/dist/tests/fourslash/{completions.importInterimFile.fourslash.disabled.d.ts → completions.import.exactMatch.fourslash.d.ts} +0 -0
  154. /package/dist/tests/fourslash/{completions.importSubmodule.fourslash.d.ts → completions.import.excludeAlreadyImported.fourslash.d.ts} +0 -0
  155. /package/dist/tests/fourslash/{completions.importPytyped.fourslash.d.ts → completions.import.privateNoPytyped.fourslash.d.ts} +0 -0
  156. /package/dist/tests/fourslash/{completions.importPytypedLocal.fourslash.d.ts → completions.import.pytyped.fourslash.d.ts} +0 -0
  157. /package/dist/tests/fourslash/{completions.importsDuplicates.fourslash.d.ts → completions.import.pytypedLocal.fourslash.d.ts} +0 -0
@@ -1,10 +1,9 @@
1
- import { ClassNode, ExecutionScopeNode, FunctionNode, LambdaNode, ListComprehensionNode, ModuleNode, NameNode, ParseNode, StringNode } from '../parser/parseNodes';
1
+ import { ClassNode, ExecutionScopeNode, FunctionNode, LambdaNode, ListComprehensionNode, ModuleNode, ParseNode, StringNode } from '../parser/parseNodes';
2
2
  import { AnalyzerFileInfo } from './analyzerFileInfo';
3
3
  import { FlowNode } from './codeFlowTypes';
4
4
  import { Declaration } from './declaration';
5
5
  import { ImportResult } from './importResult';
6
6
  import { Scope } from './scope';
7
- import { Symbol } from './symbol';
8
7
  export interface DunderAllInfo {
9
8
  names: string[];
10
9
  stringNodes: StringNode[];
@@ -30,6 +29,4 @@ export declare function getCodeFlowComplexity(node: ExecutionScopeNode): number;
30
29
  export declare function setCodeFlowComplexity(node: ExecutionScopeNode, complexity: number): void;
31
30
  export declare function getDunderAllInfo(node: ModuleNode): DunderAllInfo | undefined;
32
31
  export declare function setDunderAllInfo(node: ModuleNode, names: DunderAllInfo | undefined): void;
33
- export declare function getTypeParameterSymbol(node: NameNode): Symbol | undefined;
34
- export declare function setTypeParameterSymbol(node: NameNode, symbol: Symbol): void;
35
32
  export declare function isCodeUnreachable(node: ParseNode): boolean;
@@ -11,7 +11,7 @@
11
11
  * (e.g. hover information).
12
12
  */
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.isCodeUnreachable = exports.setTypeParameterSymbol = exports.getTypeParameterSymbol = exports.setDunderAllInfo = exports.getDunderAllInfo = exports.setCodeFlowComplexity = exports.getCodeFlowComplexity = exports.setCodeFlowExpressions = exports.getCodeFlowExpressions = exports.setFileInfo = exports.getFileInfo = exports.setAfterFlowNode = exports.getAfterFlowNode = exports.setFlowNode = exports.getFlowNode = exports.setDeclaration = exports.getDeclaration = exports.setScope = exports.getScope = exports.setImportInfo = exports.getImportInfo = exports.cleanNodeAnalysisInfo = void 0;
14
+ exports.isCodeUnreachable = exports.setDunderAllInfo = exports.getDunderAllInfo = exports.setCodeFlowComplexity = exports.getCodeFlowComplexity = exports.setCodeFlowExpressions = exports.getCodeFlowExpressions = exports.setFileInfo = exports.getFileInfo = exports.setAfterFlowNode = exports.getAfterFlowNode = exports.setFlowNode = exports.getFlowNode = exports.setDeclaration = exports.getDeclaration = exports.setScope = exports.getScope = exports.setImportInfo = exports.getImportInfo = exports.cleanNodeAnalysisInfo = void 0;
15
15
  const codeFlowTypes_1 = require("./codeFlowTypes");
16
16
  // Cleans out all fields that are added by the analyzer phases
17
17
  // (after the post-parse walker).
@@ -122,16 +122,6 @@ function setDunderAllInfo(node, names) {
122
122
  analyzerNode.dunderAllInfo = names;
123
123
  }
124
124
  exports.setDunderAllInfo = setDunderAllInfo;
125
- function getTypeParameterSymbol(node) {
126
- const analyzerNode = node;
127
- return analyzerNode.typeParameterSymbol;
128
- }
129
- exports.getTypeParameterSymbol = getTypeParameterSymbol;
130
- function setTypeParameterSymbol(node, symbol) {
131
- const analyzerNode = node;
132
- analyzerNode.typeParameterSymbol = symbol;
133
- }
134
- exports.setTypeParameterSymbol = setTypeParameterSymbol;
135
125
  function isCodeUnreachable(node) {
136
126
  let curNode = node;
137
127
  // Walk up the parse tree until we find a node with
@@ -1 +1 @@
1
- {"version":3,"file":"analyzerNodeInfo.js","sourceRoot":"","sources":["../../../../../src/analyzer/analyzerNodeInfo.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAeH,mDAAsD;AAwDtD,8DAA8D;AAC9D,iCAAiC;AACjC,SAAgB,qBAAqB,CAAC,IAAe;IACjD,MAAM,YAAY,GAAG,IAAwB,CAAC;IAC9C,OAAO,YAAY,CAAC,KAAK,CAAC;IAC1B,OAAO,YAAY,CAAC,WAAW,CAAC;IAChC,OAAO,YAAY,CAAC,QAAQ,CAAC;IA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10
10
  private _currentFlowNode;
11
- private _activeTypeParams;
12
11
  private _targetFunctionDeclaration;
13
12
  private _currentBreakTarget;
14
13
  private _currentContinueTarget;
@@ -79,7 +78,6 @@ export declare class Binder extends ParseTreeWalker {
79
78
  visitPatternCapture(node: PatternCaptureNode): boolean;
80
79
  visitPatternMappingExpandEntry(node: PatternMappingExpandEntryNode): boolean;
81
80
  private _formatModuleName;
82
- private _removeActiveTypeParameters;
83
81
  private _getNonClassParentScope;
84
82
  private _addSlotsToCurrentScope;
85
83
  private _isInListComprehension;
@@ -56,7 +56,6 @@ const docStringUtils_1 = require("./docStringUtils");
56
56
  const ParseTreeUtils = __importStar(require("./parseTreeUtils"));
57
57
  const parseTreeWalker_1 = require("./parseTreeWalker");
58
58
  const scope_1 = require("./scope");
59
- const scopeUtils_1 = require("./scopeUtils");
60
59
  const StaticExpressions = __importStar(require("./staticExpressions"));
61
60
  const symbol_1 = require("./symbol");
62
61
  const symbolNameUtils_1 = require("./symbolNameUtils");
@@ -71,9 +70,6 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
71
70
  this._moduleSymbolOnly = _moduleSymbolOnly;
72
71
  // A queue of deferred analysis operations.
73
72
  this._deferredBindingTasks = [];
74
- // Tracks the type parameters that are currently active within the
75
- // scope and any outer scopes.
76
- this._activeTypeParams = new Map();
77
73
  // Flow nodes used within try blocks.
78
74
  this._currentExceptTargets = [];
79
75
  // Flow nodes used within try/finally flows.
@@ -115,7 +111,8 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
115
111
  // We'll assume that if there is no builtins scope provided, we must be
116
112
  // binding the builtins module itself.
117
113
  const isBuiltInModule = this._fileInfo.builtinsScope === undefined;
118
- this._createNewScope(isBuiltInModule ? 4 /* ScopeType.Builtin */ : 3 /* ScopeType.Module */, this._fileInfo.builtinsScope, () => {
114
+ this._createNewScope(isBuiltInModule ? 5 /* ScopeType.Builtin */ : 4 /* ScopeType.Module */, this._fileInfo.builtinsScope,
115
+ /* proxyScope */ undefined, () => {
119
116
  AnalyzerNodeInfo.setScope(node, this._currentScope);
120
117
  AnalyzerNodeInfo.setFlowNode(node, this._currentFlowNode);
121
118
  // Bind implicit names.
@@ -237,11 +234,14 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
237
234
  }
238
235
  // Stash the declaration in the parse node for later access.
239
236
  AnalyzerNodeInfo.setDeclaration(node, classDeclaration);
237
+ let typeParamScope;
240
238
  if (node.typeParameters) {
241
239
  this.walk(node.typeParameters);
240
+ typeParamScope = AnalyzerNodeInfo.getScope(node.typeParameters);
242
241
  }
243
242
  this.walkMultiple(node.arguments);
244
- this._createNewScope(2 /* ScopeType.Class */, this._getNonClassParentScope(), () => {
243
+ this._createNewScope(3 /* ScopeType.Class */, typeParamScope !== null && typeParamScope !== void 0 ? typeParamScope : this._getNonClassParentScope(),
244
+ /* proxyScope */ undefined, () => {
245
245
  AnalyzerNodeInfo.setScope(node, this._currentScope);
246
246
  this._addImplicitSymbolToCurrentScope('__doc__', node, 'str | None');
247
247
  this._addImplicitSymbolToCurrentScope('__module__', node, 'str');
@@ -257,9 +257,6 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
257
257
  this._dunderSlotsEntries = undefined;
258
258
  });
259
259
  this._createAssignmentTargetFlowNodes(node.name, /* walkTargets */ false, /* unbound */ false);
260
- if (node.typeParameters) {
261
- this._removeActiveTypeParameters(node.typeParameters);
262
- }
263
260
  return false;
264
261
  }
265
262
  visitFunction(node) {
@@ -288,8 +285,10 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
288
285
  this.walk(param.defaultValue);
289
286
  }
290
287
  });
288
+ let typeParamScope;
291
289
  if (node.typeParameters) {
292
290
  this.walk(node.typeParameters);
291
+ typeParamScope = AnalyzerNodeInfo.getScope(node.typeParameters);
293
292
  }
294
293
  this.walkMultiple(node.decorators);
295
294
  node.parameters.forEach((param) => {
@@ -308,7 +307,8 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
308
307
  }
309
308
  // Don't walk the body of the function until we're done analyzing
310
309
  // the current scope.
311
- this._createNewScope(1 /* ScopeType.Function */, this._getNonClassParentScope(), () => {
310
+ this._createNewScope(2 /* ScopeType.Function */, typeParamScope !== null && typeParamScope !== void 0 ? typeParamScope : this._getNonClassParentScope(),
311
+ /* proxyScope */ undefined, () => {
312
312
  AnalyzerNodeInfo.setScope(node, this._currentScope);
313
313
  const enclosingClass = ParseTreeUtils.getEnclosingClass(node);
314
314
  if (enclosingClass) {
@@ -348,6 +348,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
348
348
  this._currentReturnTarget = this._createBranchLabel();
349
349
  // Walk the statements that make up the function.
350
350
  this.walk(node.suite);
351
+ this._targetFunctionDeclaration = undefined;
351
352
  // Associate the code flow node at the end of the suite with
352
353
  // the suite.
353
354
  AnalyzerNodeInfo.setAfterFlowNode(node.suite, this._currentFlowNode);
@@ -362,9 +363,6 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
362
363
  });
363
364
  });
364
365
  this._createAssignmentTargetFlowNodes(node.name, /* walkTargets */ false, /* unbound */ false);
365
- if (node.typeParameters) {
366
- this._removeActiveTypeParameters(node.typeParameters);
367
- }
368
366
  // We'll walk the child nodes in a deferred manner, so don't walk them now.
369
367
  return false;
370
368
  }
@@ -378,7 +376,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
378
376
  this.walk(param.defaultValue);
379
377
  }
380
378
  });
381
- this._createNewScope(1 /* ScopeType.Function */, this._getNonClassParentScope(), () => {
379
+ this._createNewScope(2 /* ScopeType.Function */, this._getNonClassParentScope(), /* proxyScope */ undefined, () => {
382
380
  AnalyzerNodeInfo.setScope(node, this._currentScope);
383
381
  this._deferBinding(() => {
384
382
  // Create a start node for the lambda.
@@ -437,7 +435,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
437
435
  }
438
436
  }
439
437
  // Is this an manipulation of dunder all?
440
- if (this._currentScope.type === 3 /* ScopeType.Module */ &&
438
+ if (this._currentScope.type === 4 /* ScopeType.Module */ &&
441
439
  node.leftExpression.nodeType === 35 /* ParseNodeType.MemberAccess */ &&
442
440
  node.leftExpression.leftExpression.nodeType === 38 /* ParseNodeType.Name */ &&
443
441
  node.leftExpression.leftExpression.value === '__all__') {
@@ -503,14 +501,16 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
503
501
  return false;
504
502
  }
505
503
  visitTypeParameterList(node) {
504
+ const typeParamScope = new scope_1.Scope(0 /* ScopeType.TypeParameter */, this._getNonClassParentScope(), this._currentScope);
506
505
  node.parameters.forEach((param) => {
507
506
  if (param.boundExpression) {
508
507
  this.walk(param.boundExpression);
509
508
  }
510
509
  });
510
+ const typeParamsSeen = new Set();
511
511
  node.parameters.forEach((param) => {
512
512
  const name = param.name;
513
- const symbol = new symbol_1.Symbol(0 /* SymbolFlags.None */);
513
+ const symbol = typeParamScope.addSymbol(name.value, 0 /* SymbolFlags.None */);
514
514
  const paramDeclaration = {
515
515
  type: 3 /* DeclarationType.TypeParameter */,
516
516
  node: param,
@@ -521,12 +521,11 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
521
521
  };
522
522
  symbol.addDeclaration(paramDeclaration);
523
523
  AnalyzerNodeInfo.setDeclaration(name, paramDeclaration);
524
- AnalyzerNodeInfo.setTypeParameterSymbol(name, symbol);
525
- if (this._activeTypeParams.has(name.value)) {
524
+ if (typeParamsSeen.has(name.value)) {
526
525
  this._addSyntaxError(localize_1.LocMessage.typeParameterExistingTypeParameter().format({ name: name.value }), name);
527
526
  }
528
527
  else {
529
- this._activeTypeParams.set(name.value, { symbol, scope: this._currentScope });
528
+ typeParamsSeen.add(name.value);
530
529
  }
531
530
  });
532
531
  node.parameters.forEach((param) => {
@@ -534,13 +533,16 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
534
533
  this.walk(param.defaultExpression);
535
534
  }
536
535
  });
536
+ AnalyzerNodeInfo.setScope(node, typeParamScope);
537
537
  return false;
538
538
  }
539
539
  visitTypeAlias(node) {
540
540
  this._bindNameToScope(this._currentScope, node.name);
541
541
  this.walk(node.name);
542
+ let typeParamScope;
542
543
  if (node.typeParameters) {
543
544
  this.walk(node.typeParameters);
545
+ typeParamScope = AnalyzerNodeInfo.getScope(node.typeParameters);
544
546
  }
545
547
  const typeAliasDeclaration = {
546
548
  type: 4 /* DeclarationType.TypeAlias */,
@@ -558,10 +560,10 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
558
560
  // Stash the declaration in the parse node for later access.
559
561
  AnalyzerNodeInfo.setDeclaration(node, typeAliasDeclaration);
560
562
  this._createAssignmentTargetFlowNodes(node.name, /* walkTargets */ true, /* unbound */ false);
563
+ const prevScope = this._currentScope;
564
+ this._currentScope = typeParamScope !== null && typeParamScope !== void 0 ? typeParamScope : this._currentScope;
561
565
  this.walk(node.expression);
562
- if (node.typeParameters) {
563
- this._removeActiveTypeParameters(node.typeParameters);
564
- }
566
+ this._currentScope = prevScope;
565
567
  return false;
566
568
  }
567
569
  visitAssignment(node) {
@@ -611,7 +613,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
611
613
  // If we didn't create assignment target flow nodes above, do so now.
612
614
  this._createAssignmentTargetFlowNodes(node.leftExpression, /* walkTargets */ true, /* unbound */ false);
613
615
  // Is this an assignment to dunder all?
614
- if (this._currentScope.type === 3 /* ScopeType.Module */) {
616
+ if (this._currentScope.type === 4 /* ScopeType.Module */) {
615
617
  if ((node.leftExpression.nodeType === 38 /* ParseNodeType.Name */ && node.leftExpression.value === '__all__') ||
616
618
  (node.leftExpression.nodeType === 54 /* ParseNodeType.TypeAnnotation */ &&
617
619
  node.leftExpression.valueExpression.nodeType === 38 /* ParseNodeType.Name */ &&
@@ -655,7 +657,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
655
657
  }
656
658
  }
657
659
  // Is this an assignment to dunder slots?
658
- if (this._currentScope.type === 2 /* ScopeType.Class */) {
660
+ if (this._currentScope.type === 3 /* ScopeType.Class */) {
659
661
  if ((node.leftExpression.nodeType === 38 /* ParseNodeType.Name */ && node.leftExpression.value === '__slots__') ||
660
662
  (node.leftExpression.nodeType === 54 /* ParseNodeType.TypeAnnotation */ &&
661
663
  node.leftExpression.valueExpression.nodeType === 38 /* ParseNodeType.Name */ &&
@@ -744,7 +746,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
744
746
  // Is this an assignment to dunder all of the form
745
747
  // __all__ += <expression>?
746
748
  if (node.operator === 1 /* OperatorType.AddEqual */ &&
747
- this._currentScope.type === 3 /* ScopeType.Module */ &&
749
+ this._currentScope.type === 4 /* ScopeType.Module */ &&
748
750
  node.leftExpression.nodeType === 38 /* ParseNodeType.Name */ &&
749
751
  node.leftExpression.value === '__all__') {
750
752
  const expr = node.rightExpression;
@@ -917,19 +919,6 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
917
919
  }
918
920
  visitName(node) {
919
921
  AnalyzerNodeInfo.setFlowNode(node, this._currentFlowNode);
920
- const typeParamSymbol = this._activeTypeParams.get(node.value);
921
- if (typeParamSymbol) {
922
- const bindingType = this._currentScope.getBindingType(node.value);
923
- if (bindingType !== 1 /* NameBindingType.Global */) {
924
- // See if the type parameter symbol has been shadowed by a
925
- // variable within an inner scope.
926
- const nameSymbolWithScope = this._currentScope.lookUpSymbolRecursive(node.value);
927
- if (!nameSymbolWithScope || !(0, scopeUtils_1.isScopeContainedWithin)(nameSymbolWithScope.scope, typeParamSymbol.scope)) {
928
- AnalyzerNodeInfo.setTypeParameterSymbol(node, typeParamSymbol.symbol);
929
- }
930
- }
931
- }
932
- // Name nodes have no children.
933
922
  return false;
934
923
  }
935
924
  visitIndex(node) {
@@ -1274,7 +1263,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
1274
1263
  }
1275
1264
  const symbol = this._bindNameToScope(this._currentScope, symbolNameNode);
1276
1265
  if (symbol &&
1277
- (this._currentScope.type === 3 /* ScopeType.Module */ || this._currentScope.type === 4 /* ScopeType.Builtin */) &&
1266
+ (this._currentScope.type === 4 /* ScopeType.Module */ || this._currentScope.type === 5 /* ScopeType.Builtin */) &&
1278
1267
  (!node.alias ||
1279
1268
  node.module.nameParts.length !== 1 ||
1280
1269
  node.module.nameParts[0].value !== node.alias.value)) {
@@ -1440,8 +1429,8 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
1440
1429
  // All import statements of the form `from . import x` treat x
1441
1430
  // as an externally-visible (not hidden) symbol.
1442
1431
  if (node.module.nameParts.length > 0) {
1443
- if (this._currentScope.type === 3 /* ScopeType.Module */ ||
1444
- this._currentScope.type === 4 /* ScopeType.Builtin */) {
1432
+ if (this._currentScope.type === 4 /* ScopeType.Module */ ||
1433
+ this._currentScope.type === 5 /* ScopeType.Builtin */) {
1445
1434
  if (!importSymbolNode.alias ||
1446
1435
  importSymbolNode.alias.value !== importSymbolNode.name.value) {
1447
1436
  if (this._fileInfo.isStubFile || this._fileInfo.isInPyTypedPackage) {
@@ -1655,7 +1644,8 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
1655
1644
  if (node.forIfNodes.length > 0 && node.forIfNodes[0].nodeType === 33 /* ParseNodeType.ListComprehensionFor */) {
1656
1645
  this.walk(node.forIfNodes[0].iterableExpression);
1657
1646
  }
1658
- this._createNewScope(0 /* ScopeType.ListComprehension */, this._getNonClassParentScope(), () => {
1647
+ this._createNewScope(1 /* ScopeType.ListComprehension */, this._getNonClassParentScope(),
1648
+ /* proxyScope */ undefined, () => {
1659
1649
  var _a;
1660
1650
  AnalyzerNodeInfo.setScope(node, this._currentScope);
1661
1651
  const falseLabel = this._createBranchLabel();
@@ -1808,29 +1798,17 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
1808
1798
  _formatModuleName(node) {
1809
1799
  return '.'.repeat(node.leadingDots) + node.nameParts.map((part) => part.value).join('.');
1810
1800
  }
1811
- _removeActiveTypeParameters(node) {
1812
- node.parameters.forEach((typeParamNode) => {
1813
- const entry = this._activeTypeParams.get(typeParamNode.name.value);
1814
- if (entry) {
1815
- const decls = entry.symbol.getDeclarations();
1816
- (0, debug_1.assert)(decls && decls.length === 1 && decls[0].type === 3 /* DeclarationType.TypeParameter */);
1817
- if (decls[0].node === typeParamNode) {
1818
- this._activeTypeParams.delete(typeParamNode.name.value);
1819
- }
1820
- }
1821
- });
1822
- }
1823
1801
  _getNonClassParentScope() {
1824
1802
  // We may not be able to use the current scope if it's a class scope.
1825
1803
  // Walk up until we find a non-class scope instead.
1826
1804
  let parentScope = this._currentScope;
1827
- while (parentScope.type === 2 /* ScopeType.Class */) {
1805
+ while (parentScope.type === 3 /* ScopeType.Class */) {
1828
1806
  parentScope = parentScope.parent;
1829
1807
  }
1830
1808
  return parentScope;
1831
1809
  }
1832
1810
  _addSlotsToCurrentScope(slotNameNodes) {
1833
- (0, debug_1.assert)(this._currentScope.type === 2 /* ScopeType.Class */);
1811
+ (0, debug_1.assert)(this._currentScope.type === 3 /* ScopeType.Class */);
1834
1812
  let slotsContainsDict = false;
1835
1813
  for (const slotNameNode of slotNameNodes) {
1836
1814
  const slotName = slotNameNode.strings[0].value;
@@ -2662,14 +2640,14 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
2662
2640
  let symbol = scope.lookUpSymbol(name);
2663
2641
  if (!symbol) {
2664
2642
  symbol = scope.addSymbol(name, 1 /* SymbolFlags.InitiallyUnbound */ | 4 /* SymbolFlags.ClassMember */);
2665
- if (this._currentScope.type === 3 /* ScopeType.Module */ || this._currentScope.type === 4 /* ScopeType.Builtin */) {
2643
+ if (this._currentScope.type === 4 /* ScopeType.Module */ || this._currentScope.type === 5 /* ScopeType.Builtin */) {
2666
2644
  if ((0, symbolNameUtils_1.isPrivateOrProtectedName)(name)) {
2667
2645
  if ((0, symbolNameUtils_1.isPrivateName)(name)) {
2668
2646
  // Private names are obscured, so they are always externally hidden.
2669
2647
  symbol.setIsExternallyHidden();
2670
2648
  }
2671
2649
  else if (this._fileInfo.isStubFile || this._fileInfo.isInPyTypedPackage) {
2672
- if (this._currentScope.type === 4 /* ScopeType.Builtin */) {
2650
+ if (this._currentScope.type === 5 /* ScopeType.Builtin */) {
2673
2651
  // Don't include private-named symbols in the builtin scope.
2674
2652
  symbol.setIsExternallyHidden();
2675
2653
  }
@@ -2741,7 +2719,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
2741
2719
  if (isInitiallyUnbound) {
2742
2720
  symbolFlags |= 1 /* SymbolFlags.InitiallyUnbound */;
2743
2721
  }
2744
- if (this._currentScope.type === 2 /* ScopeType.Class */) {
2722
+ if (this._currentScope.type === 3 /* ScopeType.Class */) {
2745
2723
  symbolFlags |= 4 /* SymbolFlags.ClassMember */;
2746
2724
  }
2747
2725
  if (this._fileInfo.isStubFile && (0, symbolNameUtils_1.isPrivateOrProtectedName)(nameValue)) {
@@ -2753,12 +2731,12 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
2753
2731
  }
2754
2732
  return symbol;
2755
2733
  }
2756
- _createNewScope(scopeType, parentScope, callback) {
2734
+ _createNewScope(scopeType, parentScope, proxyScope, callback) {
2757
2735
  const prevScope = this._currentScope;
2758
- const newScope = new scope_1.Scope(scopeType, parentScope);
2736
+ const newScope = new scope_1.Scope(scopeType, parentScope, proxyScope);
2759
2737
  this._currentScope = newScope;
2760
2738
  // If this scope is an execution scope, allocate a new reference map.
2761
- const isExecutionScope = scopeType === 4 /* ScopeType.Builtin */ || scopeType === 3 /* ScopeType.Module */ || scopeType === 1 /* ScopeType.Function */;
2739
+ const isExecutionScope = scopeType === 5 /* ScopeType.Builtin */ || scopeType === 4 /* ScopeType.Module */ || scopeType === 2 /* ScopeType.Function */;
2762
2740
  const prevExpressions = this._currentScopeCodeFlowExpressions;
2763
2741
  if (isExecutionScope) {
2764
2742
  this._currentScopeCodeFlowExpressions = new Set();
@@ -3256,7 +3234,6 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
3256
3234
  this._deferredBindingTasks.push({
3257
3235
  scope: this._currentScope,
3258
3236
  codeFlowExpressions: this._currentScopeCodeFlowExpressions,
3259
- activeTypeParams: new Map(this._activeTypeParams),
3260
3237
  callback,
3261
3238
  });
3262
3239
  }
@@ -3266,7 +3243,6 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
3266
3243
  // Reset the state
3267
3244
  this._currentScope = nextItem.scope;
3268
3245
  this._currentScopeCodeFlowExpressions = nextItem.codeFlowExpressions;
3269
- this._activeTypeParams = nextItem.activeTypeParams;
3270
3246
  nextItem.callback();
3271
3247
  }
3272
3248
  }
@@ -3371,7 +3347,7 @@ class DummyScopeGenerator extends parseTreeWalker_1.ParseTreeWalker {
3371
3347
  this._currentScope = currentScope;
3372
3348
  }
3373
3349
  visitClass(node) {
3374
- const newScope = this._createNewScope(2 /* ScopeType.Class */, () => {
3350
+ const newScope = this._createNewScope(3 /* ScopeType.Class */, () => {
3375
3351
  this.walk(node.suite);
3376
3352
  });
3377
3353
  if (!AnalyzerNodeInfo.getScope(node)) {
@@ -3380,7 +3356,7 @@ class DummyScopeGenerator extends parseTreeWalker_1.ParseTreeWalker {
3380
3356
  return false;
3381
3357
  }
3382
3358
  visitFunction(node) {
3383
- const newScope = this._createNewScope(1 /* ScopeType.Function */, () => {
3359
+ const newScope = this._createNewScope(2 /* ScopeType.Function */, () => {
3384
3360
  this.walk(node.suite);
3385
3361
  });
3386
3362
  if (!AnalyzerNodeInfo.getScope(node)) {