@zzzen/pyright-internal 1.2.0-dev.20240929 → 1.2.0-dev.20241006

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 (49) hide show
  1. package/dist/analyzer/checker.js +7 -7
  2. package/dist/analyzer/checker.js.map +1 -1
  3. package/dist/analyzer/codeFlowEngine.js +1 -1
  4. package/dist/analyzer/codeFlowEngine.js.map +1 -1
  5. package/dist/analyzer/constraintSolver.js +3 -12
  6. package/dist/analyzer/constraintSolver.js.map +1 -1
  7. package/dist/analyzer/constraintTracker.d.ts +0 -1
  8. package/dist/analyzer/constraintTracker.js +0 -6
  9. package/dist/analyzer/constraintTracker.js.map +1 -1
  10. package/dist/analyzer/dataClasses.js +3 -3
  11. package/dist/analyzer/dataClasses.js.map +1 -1
  12. package/dist/analyzer/patternMatching.js +12 -1
  13. package/dist/analyzer/patternMatching.js.map +1 -1
  14. package/dist/analyzer/protocols.js +9 -20
  15. package/dist/analyzer/protocols.js.map +1 -1
  16. package/dist/analyzer/tuples.d.ts +8 -3
  17. package/dist/analyzer/tuples.js +155 -0
  18. package/dist/analyzer/tuples.js.map +1 -1
  19. package/dist/analyzer/typeEvaluator.js +209 -308
  20. package/dist/analyzer/typeEvaluator.js.map +1 -1
  21. package/dist/analyzer/typeEvaluatorTypes.d.ts +9 -14
  22. package/dist/analyzer/typeEvaluatorTypes.js +7 -1
  23. package/dist/analyzer/typeEvaluatorTypes.js.map +1 -1
  24. package/dist/analyzer/typePrinter.d.ts +2 -1
  25. package/dist/analyzer/typePrinter.js +12 -10
  26. package/dist/analyzer/typePrinter.js.map +1 -1
  27. package/dist/analyzer/typeStubWriter.js +1 -1
  28. package/dist/analyzer/typeStubWriter.js.map +1 -1
  29. package/dist/analyzer/typeUtils.d.ts +10 -3
  30. package/dist/analyzer/typeUtils.js +4 -12
  31. package/dist/analyzer/typeUtils.js.map +1 -1
  32. package/dist/analyzer/types.d.ts +1 -1
  33. package/dist/analyzer/types.js +14 -14
  34. package/dist/analyzer/types.js.map +1 -1
  35. package/dist/common/collectionUtils.d.ts +2 -0
  36. package/dist/common/collectionUtils.js +15 -0
  37. package/dist/common/collectionUtils.js.map +1 -1
  38. package/dist/localization/package.nls.zh-cn.json +5 -5
  39. package/dist/localization/package.nls.zh-tw.json +5 -5
  40. package/dist/tests/typeEvaluator3.test.js +1 -1
  41. package/dist/tests/typeEvaluator4.test.js +1 -1
  42. package/dist/tests/typeEvaluator4.test.js.map +1 -1
  43. package/dist/tests/typeEvaluator5.test.js +3 -3
  44. package/dist/tests/typeEvaluator5.test.js.map +1 -1
  45. package/dist/tests/typeEvaluator6.test.js +6 -0
  46. package/dist/tests/typeEvaluator6.test.js.map +1 -1
  47. package/dist/tests/typeEvaluator7.test.js +0 -6
  48. package/dist/tests/typeEvaluator7.test.js.map +1 -1
  49. package/package.json +1 -1
@@ -553,7 +553,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
553
553
  let returnType;
554
554
  const enclosingFunctionNode = ParseTreeUtils.getEnclosingFunction(node);
555
555
  let declaredReturnType = enclosingFunctionNode
556
- ? this._evaluator.getFunctionDeclaredReturnType(enclosingFunctionNode)
556
+ ? this._evaluator.getDeclaredReturnType(enclosingFunctionNode)
557
557
  : undefined;
558
558
  if (node.d.expr) {
559
559
  returnTypeResult = (_a = this._evaluator.getTypeResult(node.d.expr)) !== null && _a !== void 0 ? _a : { type: types_1.UnknownType.create() };
@@ -1864,8 +1864,8 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
1864
1864
  // First check the parameters to see if they are assignable.
1865
1865
  let isConsistent = this._evaluator.assignType(overloadBound, implBound, diag, constraints, 64 /* AssignTypeFlags.SkipReturnTypeCheck */ | 2 /* AssignTypeFlags.Contravariant */ | 512 /* AssignTypeFlags.SkipSelfClsTypeCheck */);
1866
1866
  // Now check the return types.
1867
- const overloadReturnType = this._evaluator.solveAndApplyConstraints((_d = types_1.FunctionType.getEffectiveReturnType(overloadBound)) !== null && _d !== void 0 ? _d : this._evaluator.getFunctionInferredReturnType(overloadBound), constraints);
1868
- const implReturnType = this._evaluator.solveAndApplyConstraints((_e = types_1.FunctionType.getEffectiveReturnType(implBound)) !== null && _e !== void 0 ? _e : this._evaluator.getFunctionInferredReturnType(implBound), constraints);
1867
+ const overloadReturnType = this._evaluator.solveAndApplyConstraints((_d = types_1.FunctionType.getEffectiveReturnType(overloadBound)) !== null && _d !== void 0 ? _d : this._evaluator.getInferredReturnType(overloadBound), constraints);
1868
+ const implReturnType = this._evaluator.solveAndApplyConstraints((_e = types_1.FunctionType.getEffectiveReturnType(implBound)) !== null && _e !== void 0 ? _e : this._evaluator.getInferredReturnType(implBound), constraints);
1869
1869
  const returnDiag = new diagnostic_1.DiagnosticAddendum();
1870
1870
  if (!(0, types_1.isNever)(overloadReturnType) &&
1871
1871
  !this._evaluator.assignType(implReturnType, overloadReturnType, returnDiag.createAddendum(), constraints, 0 /* AssignTypeFlags.Default */)) {
@@ -2390,7 +2390,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
2390
2390
  let duplicateIsOk = false;
2391
2391
  // If the return type has not yet been inferred, do so now.
2392
2392
  if (primaryType && (0, types_1.isFunction)(primaryType)) {
2393
- this._evaluator.getFunctionInferredReturnType(primaryType);
2393
+ this._evaluator.getInferredReturnType(primaryType);
2394
2394
  }
2395
2395
  const otherType = (_b = this._evaluator.getTypeForDeclaration(otherDecl)) === null || _b === void 0 ? void 0 : _b.type;
2396
2396
  const suite1 = ParseTreeUtils.getEnclosingSuite(primaryDecl.node);
@@ -2401,7 +2401,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
2401
2401
  const isInSameStatementList = suite1 === suite2;
2402
2402
  // If the return type has not yet been inferred, do so now.
2403
2403
  if (otherType && (0, types_1.isFunction)(otherType)) {
2404
- this._evaluator.getFunctionInferredReturnType(otherType);
2404
+ this._evaluator.getInferredReturnType(otherType);
2405
2405
  }
2406
2406
  // If both declarations are functions, it's OK if they
2407
2407
  // both have the same signatures.
@@ -3321,7 +3321,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
3321
3321
  }
3322
3322
  }
3323
3323
  else {
3324
- const inferredReturnType = this._evaluator.getFunctionInferredReturnType(functionType);
3324
+ const inferredReturnType = this._evaluator.getInferredReturnType(functionType);
3325
3325
  if (!(0, types_1.isNever)(inferredReturnType) &&
3326
3326
  !(0, typeUtils_1.isNoneInstance)(inferredReturnType) &&
3327
3327
  !(0, types_1.isAnyOrUnknown)(inferredReturnType)) {
@@ -3386,7 +3386,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
3386
3386
  }
3387
3387
  }
3388
3388
  else {
3389
- const inferredReturnType = this._evaluator.getFunctionInferredReturnType(functionType);
3389
+ const inferredReturnType = this._evaluator.getInferredReturnType(functionType);
3390
3390
  this._reportUnknownReturnResult(node, inferredReturnType);
3391
3391
  this._validateReturnTypeIsNotContravariant(inferredReturnType, node.d.name);
3392
3392
  }