@zzzen/pyright-internal 1.2.0-dev.20240714 → 1.2.0-dev.20240728

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 (225) hide show
  1. package/dist/analyzer/analyzerNodeInfo.js +2 -2
  2. package/dist/analyzer/analyzerNodeInfo.js.map +1 -1
  3. package/dist/analyzer/binder.js +8 -8
  4. package/dist/analyzer/binder.js.map +1 -1
  5. package/dist/analyzer/cacheManager.js +3 -0
  6. package/dist/analyzer/cacheManager.js.map +1 -1
  7. package/dist/analyzer/checker.d.ts +3 -2
  8. package/dist/analyzer/checker.js +137 -142
  9. package/dist/analyzer/checker.js.map +1 -1
  10. package/dist/analyzer/codeFlowEngine.d.ts +2 -2
  11. package/dist/analyzer/codeFlowEngine.js +74 -44
  12. package/dist/analyzer/codeFlowEngine.js.map +1 -1
  13. package/dist/analyzer/codeFlowTypes.js +1 -1
  14. package/dist/analyzer/codeFlowTypes.js.map +1 -1
  15. package/dist/analyzer/constraintSolver.d.ts +2 -2
  16. package/dist/analyzer/constraintSolver.js +166 -206
  17. package/dist/analyzer/constraintSolver.js.map +1 -1
  18. package/dist/analyzer/constructorTransform.d.ts +2 -3
  19. package/dist/analyzer/constructorTransform.js +18 -19
  20. package/dist/analyzer/constructorTransform.js.map +1 -1
  21. package/dist/analyzer/constructors.d.ts +3 -3
  22. package/dist/analyzer/constructors.js +72 -175
  23. package/dist/analyzer/constructors.js.map +1 -1
  24. package/dist/analyzer/dataClasses.d.ts +2 -2
  25. package/dist/analyzer/dataClasses.js +60 -40
  26. package/dist/analyzer/dataClasses.js.map +1 -1
  27. package/dist/analyzer/declaration.d.ts +9 -9
  28. package/dist/analyzer/declaration.js +9 -9
  29. package/dist/analyzer/declaration.js.map +1 -1
  30. package/dist/analyzer/declarationUtils.d.ts +1 -1
  31. package/dist/analyzer/declarationUtils.js +6 -6
  32. package/dist/analyzer/declarationUtils.js.map +1 -1
  33. package/dist/analyzer/decorators.js +5 -6
  34. package/dist/analyzer/decorators.js.map +1 -1
  35. package/dist/analyzer/docStringConversion.js +2 -2
  36. package/dist/analyzer/docStringConversion.js.map +1 -1
  37. package/dist/analyzer/enums.d.ts +2 -2
  38. package/dist/analyzer/enums.js +6 -6
  39. package/dist/analyzer/enums.js.map +1 -1
  40. package/dist/analyzer/functionTransform.d.ts +2 -2
  41. package/dist/analyzer/functionTransform.js +4 -4
  42. package/dist/analyzer/functionTransform.js.map +1 -1
  43. package/dist/analyzer/importResolver.js +5 -3
  44. package/dist/analyzer/importResolver.js.map +1 -1
  45. package/dist/analyzer/namedTuples.d.ts +3 -3
  46. package/dist/analyzer/namedTuples.js +21 -22
  47. package/dist/analyzer/namedTuples.js.map +1 -1
  48. package/dist/analyzer/operations.js +145 -96
  49. package/dist/analyzer/operations.js.map +1 -1
  50. package/dist/analyzer/packageTypeVerifier.js +8 -8
  51. package/dist/analyzer/packageTypeVerifier.js.map +1 -1
  52. package/dist/analyzer/parameterUtils.d.ts +10 -10
  53. package/dist/analyzer/parameterUtils.js +60 -59
  54. package/dist/analyzer/parameterUtils.js.map +1 -1
  55. package/dist/analyzer/parseTreeUtils.d.ts +7 -6
  56. package/dist/analyzer/parseTreeUtils.js +47 -24
  57. package/dist/analyzer/parseTreeUtils.js.map +1 -1
  58. package/dist/analyzer/patternMatching.js +109 -90
  59. package/dist/analyzer/patternMatching.js.map +1 -1
  60. package/dist/analyzer/program.js +11 -4
  61. package/dist/analyzer/program.js.map +1 -1
  62. package/dist/analyzer/properties.js +23 -19
  63. package/dist/analyzer/properties.js.map +1 -1
  64. package/dist/analyzer/protocols.js +23 -20
  65. package/dist/analyzer/protocols.js.map +1 -1
  66. package/dist/analyzer/pythonPathUtils.js +1 -1
  67. package/dist/analyzer/pythonPathUtils.js.map +1 -1
  68. package/dist/analyzer/service.d.ts +3 -7
  69. package/dist/analyzer/service.js +28 -30
  70. package/dist/analyzer/service.js.map +1 -1
  71. package/dist/analyzer/serviceUtils.d.ts +8 -0
  72. package/dist/analyzer/serviceUtils.js +31 -0
  73. package/dist/analyzer/serviceUtils.js.map +1 -0
  74. package/dist/analyzer/sourceFile.js +5 -19
  75. package/dist/analyzer/sourceFile.js.map +1 -1
  76. package/dist/analyzer/sourceMapper.d.ts +1 -1
  77. package/dist/analyzer/sourceMapper.js +4 -4
  78. package/dist/analyzer/sourceMapper.js.map +1 -1
  79. package/dist/analyzer/staticExpressions.js +1 -1
  80. package/dist/analyzer/staticExpressions.js.map +1 -1
  81. package/dist/analyzer/testWalker.js +13 -1
  82. package/dist/analyzer/testWalker.js.map +1 -1
  83. package/dist/analyzer/tracePrinter.js +4 -4
  84. package/dist/analyzer/tracePrinter.js.map +1 -1
  85. package/dist/analyzer/tuples.d.ts +9 -0
  86. package/dist/analyzer/tuples.js +252 -0
  87. package/dist/analyzer/tuples.js.map +1 -0
  88. package/dist/analyzer/typeComplexity.d.ts +2 -0
  89. package/dist/analyzer/typeComplexity.js +86 -0
  90. package/dist/analyzer/typeComplexity.js.map +1 -0
  91. package/dist/analyzer/typeEvaluator.js +1721 -1824
  92. package/dist/analyzer/typeEvaluator.js.map +1 -1
  93. package/dist/analyzer/typeEvaluatorTypes.d.ts +47 -40
  94. package/dist/analyzer/typeEvaluatorTypes.js +10 -1
  95. package/dist/analyzer/typeEvaluatorTypes.js.map +1 -1
  96. package/dist/analyzer/typeGuards.js +116 -90
  97. package/dist/analyzer/typeGuards.js.map +1 -1
  98. package/dist/analyzer/typePrinter.d.ts +1 -1
  99. package/dist/analyzer/typePrinter.js +54 -53
  100. package/dist/analyzer/typePrinter.js.map +1 -1
  101. package/dist/analyzer/typeStubWriter.d.ts +3 -3
  102. package/dist/analyzer/typeStubWriter.js +15 -15
  103. package/dist/analyzer/typeStubWriter.js.map +1 -1
  104. package/dist/analyzer/typeUtils.d.ts +35 -29
  105. package/dist/analyzer/typeUtils.js +420 -357
  106. package/dist/analyzer/typeUtils.js.map +1 -1
  107. package/dist/analyzer/typeVarContext.d.ts +24 -36
  108. package/dist/analyzer/typeVarContext.js +89 -193
  109. package/dist/analyzer/typeVarContext.js.map +1 -1
  110. package/dist/analyzer/typeWalker.js +4 -4
  111. package/dist/analyzer/typeWalker.js.map +1 -1
  112. package/dist/analyzer/typedDicts.d.ts +2 -2
  113. package/dist/analyzer/typedDicts.js +49 -53
  114. package/dist/analyzer/typedDicts.js.map +1 -1
  115. package/dist/analyzer/types.d.ts +89 -63
  116. package/dist/analyzer/types.js +163 -120
  117. package/dist/analyzer/types.js.map +1 -1
  118. package/dist/commands/dumpFileDebugInfoCommand.js +12 -12
  119. package/dist/commands/dumpFileDebugInfoCommand.js.map +1 -1
  120. package/dist/common/configOptions.d.ts +1 -0
  121. package/dist/common/configOptions.js +5 -0
  122. package/dist/common/configOptions.js.map +1 -1
  123. package/dist/common/diagnosticRules.d.ts +1 -0
  124. package/dist/common/diagnosticRules.js +1 -0
  125. package/dist/common/diagnosticRules.js.map +1 -1
  126. package/dist/common/fileSystem.d.ts +0 -1
  127. package/dist/common/fileSystem.js.map +1 -1
  128. package/dist/common/languageServerInterface.d.ts +13 -0
  129. package/dist/common/languageServerInterface.js +15 -1
  130. package/dist/common/languageServerInterface.js.map +1 -1
  131. package/dist/common/lspUtils.js +2 -2
  132. package/dist/common/memUtils.d.ts +4 -0
  133. package/dist/common/memUtils.js +33 -2
  134. package/dist/common/memUtils.js.map +1 -1
  135. package/dist/common/serviceKeys.d.ts +3 -0
  136. package/dist/common/serviceKeys.js +2 -0
  137. package/dist/common/serviceKeys.js.map +1 -1
  138. package/dist/common/serviceProviderExtensions.js +7 -0
  139. package/dist/common/serviceProviderExtensions.js.map +1 -1
  140. package/dist/languageServerBase.d.ts +4 -3
  141. package/dist/languageServerBase.js +14 -10
  142. package/dist/languageServerBase.js.map +1 -1
  143. package/dist/languageService/autoImporter.d.ts +3 -2
  144. package/dist/languageService/autoImporter.js +5 -1
  145. package/dist/languageService/autoImporter.js.map +1 -1
  146. package/dist/languageService/completionProvider.d.ts +5 -3
  147. package/dist/languageService/completionProvider.js +38 -37
  148. package/dist/languageService/completionProvider.js.map +1 -1
  149. package/dist/languageService/completionProviderUtils.d.ts +1 -1
  150. package/dist/languageService/completionProviderUtils.js +3 -3
  151. package/dist/languageService/completionProviderUtils.js.map +1 -1
  152. package/dist/languageService/fileWatcherDynamicFeature.js +2 -2
  153. package/dist/languageService/fileWatcherDynamicFeature.js.map +1 -1
  154. package/dist/languageService/hoverProvider.js +14 -6
  155. package/dist/languageService/hoverProvider.js.map +1 -1
  156. package/dist/languageService/referencesProvider.d.ts +10 -4
  157. package/dist/languageService/referencesProvider.js +24 -12
  158. package/dist/languageService/referencesProvider.js.map +1 -1
  159. package/dist/languageService/renameProvider.js +21 -4
  160. package/dist/languageService/renameProvider.js.map +1 -1
  161. package/dist/languageService/signatureHelpProvider.js +1 -1
  162. package/dist/languageService/signatureHelpProvider.js.map +1 -1
  163. package/dist/languageService/tooltipUtils.js +3 -3
  164. package/dist/languageService/tooltipUtils.js.map +1 -1
  165. package/dist/localization/localize.d.ts +9 -3
  166. package/dist/localization/localize.js +8 -1
  167. package/dist/localization/localize.js.map +1 -1
  168. package/dist/localization/package.nls.cs.json +5 -2
  169. package/dist/localization/package.nls.de.json +5 -2
  170. package/dist/localization/package.nls.en-us.json +7 -1
  171. package/dist/localization/package.nls.es.json +5 -2
  172. package/dist/localization/package.nls.fr.json +5 -2
  173. package/dist/localization/package.nls.it.json +5 -2
  174. package/dist/localization/package.nls.ja.json +5 -2
  175. package/dist/localization/package.nls.ko.json +5 -2
  176. package/dist/localization/package.nls.pl.json +5 -2
  177. package/dist/localization/package.nls.pt-br.json +5 -2
  178. package/dist/localization/package.nls.qps-ploc.json +5 -2
  179. package/dist/localization/package.nls.ru.json +5 -2
  180. package/dist/localization/package.nls.tr.json +5 -2
  181. package/dist/localization/package.nls.zh-cn.json +5 -2
  182. package/dist/localization/package.nls.zh-tw.json +5 -2
  183. package/dist/parser/parseNodes.d.ts +12 -10
  184. package/dist/parser/parseNodes.js +23 -21
  185. package/dist/parser/parseNodes.js.map +1 -1
  186. package/dist/parser/parser.js +66 -43
  187. package/dist/parser/parser.js.map +1 -1
  188. package/dist/tests/checker.test.js +2 -2
  189. package/dist/tests/fourslash/rename.args.fourslash.d.ts +1 -0
  190. package/dist/tests/fourslash/rename.args.fourslash.js +71 -0
  191. package/dist/tests/fourslash/rename.args.fourslash.js.map +1 -0
  192. package/dist/tests/fourslash/signature.builtinDocstrings.fourslash.js +4 -21
  193. package/dist/tests/fourslash/signature.builtinDocstrings.fourslash.js.map +1 -1
  194. package/dist/tests/fourslash/signature.complicated.fourslash.js +1 -1
  195. package/dist/tests/fourslash/signature.complicated.fourslash.js.map +1 -1
  196. package/dist/tests/harness/fourslash/fourSlashParser.js +1 -1
  197. package/dist/tests/harness/fourslash/fourSlashParser.js.map +1 -1
  198. package/dist/tests/harness/fourslash/testStateUtils.js +2 -2
  199. package/dist/tests/harness/fourslash/testStateUtils.js.map +1 -1
  200. package/dist/tests/harness/vfs/filesystem.d.ts +0 -1
  201. package/dist/tests/harness/vfs/filesystem.js +0 -4
  202. package/dist/tests/harness/vfs/filesystem.js.map +1 -1
  203. package/dist/tests/importResolver.test.js +62 -15
  204. package/dist/tests/importResolver.test.js.map +1 -1
  205. package/dist/tests/lsp/languageServerTestUtils.js +1 -1
  206. package/dist/tests/lsp/languageServerTestUtils.js.map +1 -1
  207. package/dist/tests/typeEvaluator1.test.js +17 -0
  208. package/dist/tests/typeEvaluator1.test.js.map +1 -1
  209. package/dist/tests/typeEvaluator2.test.js +4 -0
  210. package/dist/tests/typeEvaluator2.test.js.map +1 -1
  211. package/dist/tests/typeEvaluator3.test.js +1 -1
  212. package/dist/tests/typeEvaluator4.test.js +19 -7
  213. package/dist/tests/typeEvaluator4.test.js.map +1 -1
  214. package/dist/tests/typeEvaluator5.test.js +8 -2
  215. package/dist/tests/typeEvaluator5.test.js.map +1 -1
  216. package/dist/tests/typeEvaluator6.test.js +76 -60
  217. package/dist/tests/typeEvaluator6.test.js.map +1 -1
  218. package/dist/tests/typeEvaluator7.test.js +5 -1
  219. package/dist/tests/typeEvaluator7.test.js.map +1 -1
  220. package/dist/tests/typePrinter.test.js +13 -18
  221. package/dist/tests/typePrinter.test.js.map +1 -1
  222. package/dist/workspaceFactory.d.ts +3 -2
  223. package/dist/workspaceFactory.js +15 -2
  224. package/dist/workspaceFactory.js.map +1 -1
  225. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { Uri } from '../common/uri/uri';
2
- import { ArgumentNode, NameNode, ParameterCategory } from '../parser/parseNodes';
2
+ import { ArgumentNode, NameNode, ParamCategory } from '../parser/parseNodes';
3
3
  import { ClassDeclaration, FunctionDeclaration, SpecialBuiltInClassDeclaration } from './declaration';
4
4
  import { Symbol, SymbolTable } from './symbol';
5
5
  export declare const enum TypeCategory {
@@ -51,9 +51,9 @@ export interface TypeAliasInfo {
51
51
  fileUri: Uri;
52
52
  typeVarScopeId: TypeVarScopeId;
53
53
  isPep695Syntax: boolean;
54
- typeParameters: TypeVarType[] | undefined;
54
+ typeParams: TypeVarType[] | undefined;
55
55
  usageVariance: Variance[] | undefined;
56
- typeArguments: Type[] | undefined;
56
+ typeArgs: Type[] | undefined;
57
57
  }
58
58
  interface CachedTypeInfo {
59
59
  instantiableType?: Type;
@@ -62,13 +62,13 @@ interface CachedTypeInfo {
62
62
  typeBaseInstanceType?: Type;
63
63
  requiresSpecialization?: boolean;
64
64
  }
65
- interface TypeBaseProps {
65
+ export interface TypeBaseProps {
66
66
  instantiableDepth: number | undefined;
67
67
  specialForm: ClassType | undefined;
68
68
  typeAliasInfo: TypeAliasInfo | undefined;
69
69
  condition: TypeCondition[] | undefined;
70
70
  }
71
- interface TypeBase<T extends TypeCategory> {
71
+ export interface TypeBase<T extends TypeCategory> {
72
72
  category: T;
73
73
  flags: TypeFlags;
74
74
  props: TypeBaseProps | undefined;
@@ -99,19 +99,19 @@ export declare namespace UnboundType {
99
99
  function create(): UnboundType;
100
100
  function convertToInstance(type: UnboundType): UnboundType;
101
101
  }
102
- export interface UnknownTypeDetailsPriv {
102
+ export interface UnknownDetailsPriv {
103
103
  isIncomplete: boolean;
104
104
  possibleType: Type | undefined;
105
105
  }
106
106
  export interface UnknownType extends TypeBase<TypeCategory.Unknown> {
107
- priv: UnknownTypeDetailsPriv;
107
+ priv: UnknownDetailsPriv;
108
108
  }
109
109
  export declare namespace UnknownType {
110
110
  function create(isIncomplete?: boolean): UnknownType;
111
111
  function createPossibleType(possibleType: Type, isIncomplete: boolean): UnknownType;
112
112
  function convertToInstance(type: UnknownType): UnknownType;
113
113
  }
114
- export interface ModuleTypeDetailsPriv {
114
+ export interface ModuleDetailsPriv {
115
115
  fields: SymbolTable;
116
116
  docString: string | undefined;
117
117
  notPresentFieldType: AnyType | UnknownType | undefined;
@@ -120,7 +120,7 @@ export interface ModuleTypeDetailsPriv {
120
120
  fileUri: Uri;
121
121
  }
122
122
  export interface ModuleType extends TypeBase<TypeCategory.Module> {
123
- priv: ModuleTypeDetailsPriv;
123
+ priv: ModuleDetailsPriv;
124
124
  }
125
125
  export declare namespace ModuleType {
126
126
  function create(moduleName: string, fileUri: Uri, symbolTable?: SymbolTable): ModuleType;
@@ -200,7 +200,7 @@ interface ClassDetailsShared {
200
200
  declaredMetaclass?: ClassType | UnknownType | undefined;
201
201
  effectiveMetaclass?: ClassType | UnknownType | undefined;
202
202
  fields: SymbolTable;
203
- typeParameters: TypeVarType[];
203
+ typeParams: TypeVarType[];
204
204
  typeVarScopeId?: TypeVarScopeId | undefined;
205
205
  docString?: string | undefined;
206
206
  dataClassEntries?: DataClassEntry[] | undefined;
@@ -216,7 +216,7 @@ interface ClassDetailsShared {
216
216
  calculateInheritedSlotsNamesDeferred?: () => void;
217
217
  inheritedSlotsNamesCached?: string[];
218
218
  }
219
- export interface TupleTypeArgument {
219
+ export interface TupleTypeArg {
220
220
  type: Type;
221
221
  isUnbounded: boolean;
222
222
  isOptional?: boolean;
@@ -226,13 +226,11 @@ export interface PropertyMethodInfo {
226
226
  classType: ClassType | undefined;
227
227
  }
228
228
  export interface ClassDetailsPriv {
229
- typeArguments?: Type[] | undefined;
230
- typeGuardType?: Type | undefined;
231
- isStrictTypeGuard?: boolean;
229
+ typeArgs?: Type[] | undefined;
232
230
  isEmptyContainer?: boolean | undefined;
233
- tupleTypeArguments?: TupleTypeArgument[] | undefined;
231
+ tupleTypeArgs?: TupleTypeArg[] | undefined;
234
232
  isUnpacked?: boolean | undefined;
235
- isTypeArgumentExplicit?: boolean | undefined;
233
+ isTypeArgExplicit?: boolean | undefined;
236
234
  includeSubclasses?: boolean;
237
235
  includePromotions?: boolean;
238
236
  literalValue?: LiteralValue | undefined;
@@ -254,7 +252,7 @@ export declare namespace ClassType {
254
252
  function createInstantiable(name: string, fullName: string, moduleName: string, fileUri: Uri, flags: ClassTypeFlags, typeSourceId: TypeSourceId, declaredMetaclass: ClassType | UnknownType | undefined, effectiveMetaclass: ClassType | UnknownType | undefined, docString?: string): ClassType;
255
253
  function cloneAsInstance(type: ClassType, includeSubclasses?: boolean): ClassType;
256
254
  function cloneAsInstantiable(type: ClassType, includeSubclasses?: boolean): ClassType;
257
- function cloneForSpecialization(classType: ClassType, typeArguments: Type[] | undefined, isTypeArgumentExplicit: boolean, includeSubclasses?: boolean, tupleTypeArguments?: TupleTypeArgument[], isEmptyContainer?: boolean): ClassType;
255
+ function specialize(classType: ClassType, typeArgs: Type[] | undefined, isTypeArgExplicit?: boolean, includeSubclasses?: boolean, tupleTypeArgs?: TupleTypeArg[], isEmptyContainer?: boolean): ClassType;
258
256
  function cloneIncludeSubclasses(classType: ClassType, includeSubclasses?: boolean): ClassType;
259
257
  function cloneWithLiteral(classType: ClassType, value: LiteralValue | undefined): ClassType;
260
258
  function cloneForDeprecatedInstance(type: ClassType, deprecatedMessage?: string): ClassType;
@@ -262,7 +260,6 @@ export declare namespace ClassType {
262
260
  function cloneForNarrowedTypedDictEntries(classType: ClassType, narrowedEntries?: Map<string, TypedDictEntry>): ClassType;
263
261
  function cloneForPartialTypedDict(classType: ClassType): ClassType;
264
262
  function cloneRemoveTypePromotions(classType: ClassType): ClassType;
265
- function cloneForTypeGuard(classType: ClassType, typeGuardType: Type, isStrictTypeGuard: boolean): ClassType;
266
263
  function cloneForSymbolTableUpdate(classType: ClassType): ClassType;
267
264
  function cloneForUnpacked(classType: ClassType, isUnpacked?: boolean): ClassType;
268
265
  function cloneWithNewFlags(classType: ClassType, newFlags: ClassTypeFlags): ClassType;
@@ -304,7 +301,7 @@ export declare namespace ClassType {
304
301
  function hasCustomClassGetItem(classType: ClassType): boolean;
305
302
  function isTupleClass(classType: ClassType): boolean;
306
303
  function isReadOnlyInstanceVariables(classType: ClassType): boolean;
307
- function getTypeParameters(classType: ClassType): TypeVarType[];
304
+ function getTypeParams(classType: ClassType): TypeVarType[];
308
305
  function derivesFromAnyOrUnknown(classType: ClassType): boolean;
309
306
  function getSymbolTable(classType: ClassType): SymbolTable;
310
307
  function getInheritedSlotsNames(classType: ClassType): string[] | undefined;
@@ -320,14 +317,14 @@ export declare enum FunctionParamFlags {
320
317
  TypeInferred = 4
321
318
  }
322
319
  export interface FunctionParam {
323
- category: ParameterCategory;
320
+ category: ParamCategory;
324
321
  type: Type;
325
322
  flags: FunctionParamFlags;
326
323
  name: string | undefined;
327
324
  defaultType: Type | undefined;
328
325
  }
329
326
  export declare namespace FunctionParam {
330
- function create(category: ParameterCategory, type: Type, flags?: FunctionParamFlags, name?: string, defaultType?: Type): FunctionParam;
327
+ function create(category: ParamCategory, type: Type, flags?: FunctionParamFlags, name?: string, defaultType?: Type): FunctionParam;
331
328
  function isNameSynthesized(param: FunctionParam): boolean;
332
329
  function isTypeDeclared(param: FunctionParam): boolean;
333
330
  function isTypeInferred(param: FunctionParam): boolean;
@@ -362,7 +359,7 @@ interface FunctionDetailsShared {
362
359
  fullName: string;
363
360
  moduleName: string;
364
361
  flags: FunctionTypeFlags;
365
- typeParameters: TypeVarType[];
362
+ typeParams: TypeVarType[];
366
363
  parameters: FunctionParam[];
367
364
  declaredReturnType: Type | undefined;
368
365
  declaration: FunctionDeclaration | undefined;
@@ -395,7 +392,6 @@ export interface FunctionDetailsPriv {
395
392
  boundToType?: ClassType | undefined;
396
393
  preBoundFlags?: FunctionTypeFlags;
397
394
  overloaded?: OverloadedFunctionType;
398
- trackedSignatures?: SignatureWithOffsets[];
399
395
  isCallableWithTypeArgs?: boolean;
400
396
  }
401
397
  export interface FunctionType extends TypeBase<TypeCategory.Function> {
@@ -409,19 +405,19 @@ export declare namespace FunctionType {
409
405
  function clone(type: FunctionType, stripFirstParam?: boolean, boundToType?: ClassType, boundTypeVarScopeId?: TypeVarScopeId): FunctionType;
410
406
  function cloneAsInstance(type: FunctionType): FunctionType;
411
407
  function cloneAsInstantiable(type: FunctionType): FunctionType;
412
- function cloneForSpecialization(type: FunctionType, specializedTypes: SpecializedFunctionTypes, specializedInferredReturnType: Type | undefined): FunctionType;
408
+ function specialize(type: FunctionType, specializedTypes: SpecializedFunctionTypes, specializedInferredReturnType: Type | undefined): FunctionType;
413
409
  function applyParamSpecValue(type: FunctionType, paramSpecValue: FunctionType): FunctionType;
414
410
  function cloneWithNewFlags(type: FunctionType, flags: FunctionTypeFlags): FunctionType;
415
- function cloneWithNewTypeVarScopeId(type: FunctionType, newScopeId: TypeVarScopeId, newConstructorScopeId: TypeVarScopeId | undefined, typeParameters: TypeVarType[], trackedSignatures?: SignatureWithOffsets[]): FunctionType;
411
+ function cloneWithNewTypeVarScopeId(type: FunctionType, newScopeId: TypeVarScopeId | undefined, newConstructorScopeId: TypeVarScopeId | undefined, typeParams: TypeVarType[]): FunctionType;
416
412
  function cloneWithDocString(type: FunctionType, docString?: string): FunctionType;
417
413
  function cloneWithDeprecatedMessage(type: FunctionType, deprecatedMessage?: string): FunctionType;
418
414
  function cloneRemoveParamSpecArgsKwargs(type: FunctionType, stripPositionOnlySeparator?: boolean): FunctionType;
419
- function getParamSpecFromArgsKwargs(type: FunctionType): TypeVarType | undefined;
420
- function addParamSpecVariadics(type: FunctionType, paramSpec: TypeVarType): void;
421
- function addDefaultParameters(type: FunctionType, useUnknown?: boolean): void;
415
+ function getParamSpecFromArgsKwargs(type: FunctionType): ParamSpecType | undefined;
416
+ function addParamSpecVariadics(type: FunctionType, paramSpec: ParamSpecType): void;
417
+ function addDefaultParams(type: FunctionType, useUnknown?: boolean): void;
422
418
  function addHigherOrderTypeVarScopeIds(functionType: FunctionType, scopeIds: (TypeVarScopeId | undefined)[] | TypeVarScopeId | undefined): void;
423
- function getDefaultParameters(useUnknown?: boolean): FunctionParam[];
424
- function hasDefaultParameters(functionType: FunctionType): boolean;
419
+ function getDefaultParams(useUnknown?: boolean): FunctionParam[];
420
+ function hasDefaultParams(functionType: FunctionType): boolean;
425
421
  function isInstanceMethod(type: FunctionType): boolean;
426
422
  function isConstructorMethod(type: FunctionType): boolean;
427
423
  function isStaticMethod(type: FunctionType): boolean;
@@ -431,7 +427,7 @@ export declare namespace FunctionType {
431
427
  function isSynthesizedMethod(type: FunctionType): boolean;
432
428
  function isTypeCheckOnly(type: FunctionType): boolean;
433
429
  function isOverloaded(type: FunctionType): boolean;
434
- function isDefaultParameterCheckDisabled(type: FunctionType): boolean;
430
+ function isDefaultParamCheckDisabled(type: FunctionType): boolean;
435
431
  function isAsync(type: FunctionType): boolean;
436
432
  function isStubDefinition(type: FunctionType): boolean;
437
433
  function isPyTypedDefinition(type: FunctionType): boolean;
@@ -442,18 +438,18 @@ export declare namespace FunctionType {
442
438
  function isPartiallyEvaluated(type: FunctionType): boolean;
443
439
  function isOverridden(type: FunctionType): boolean;
444
440
  function isBuiltIn(type: FunctionType, name?: string | string[]): boolean;
445
- function getEffectiveParameterType(type: FunctionType, index: number): Type;
446
- function getEffectiveParameterDefaultArgType(type: FunctionType, index: number): Type | undefined;
447
- function addParameter(type: FunctionType, param: FunctionParam): void;
448
- function addPositionOnlyParameterSeparator(type: FunctionType): void;
449
- function addKeywordOnlyParameterSeparator(type: FunctionType): void;
441
+ function getEffectiveParamType(type: FunctionType, index: number): Type;
442
+ function getEffectiveParamDefaultArgType(type: FunctionType, index: number): Type | undefined;
443
+ function addParam(type: FunctionType, param: FunctionParam): void;
444
+ function addPositionOnlyParamSeparator(type: FunctionType): void;
445
+ function addKeywordOnlyParamSeparator(type: FunctionType): void;
450
446
  function getEffectiveReturnType(type: FunctionType, includeInferred?: boolean): Type | undefined;
451
447
  }
452
- export interface OverloadedFunctionTypeDetailsPriv {
448
+ export interface OverloadedFunctionDetailsPriv {
453
449
  overloads: FunctionType[];
454
450
  }
455
451
  export interface OverloadedFunctionType extends TypeBase<TypeCategory.OverloadedFunction> {
456
- priv: OverloadedFunctionTypeDetailsPriv;
452
+ priv: OverloadedFunctionDetailsPriv;
457
453
  }
458
454
  export declare namespace OverloadedFunctionType {
459
455
  function create(overloads: FunctionType[]): OverloadedFunctionType;
@@ -461,22 +457,22 @@ export declare namespace OverloadedFunctionType {
461
457
  function getOverloads(type: OverloadedFunctionType): FunctionType[];
462
458
  function getImplementation(type: OverloadedFunctionType): FunctionType | undefined;
463
459
  }
464
- export interface NeverTypeDetailsPriv {
460
+ export interface NeverDetailsPriv {
465
461
  isNoReturn: boolean;
466
462
  }
467
463
  export interface NeverType extends TypeBase<TypeCategory.Never> {
468
- priv: NeverTypeDetailsPriv;
464
+ priv: NeverDetailsPriv;
469
465
  }
470
466
  export declare namespace NeverType {
471
467
  function createNever(): NeverType;
472
468
  function createNoReturn(): NeverType;
473
469
  function convertToInstance(type: NeverType): NeverType;
474
470
  }
475
- export interface AnyTypeDetailsPriv {
471
+ export interface AnyDetailsPriv {
476
472
  isEllipsis: boolean;
477
473
  }
478
474
  export interface AnyType extends TypeBase<TypeCategory.Any> {
479
- priv: AnyTypeDetailsPriv;
475
+ priv: AnyDetailsPriv;
480
476
  }
481
477
  export declare namespace AnyType {
482
478
  function create(isEllipsis?: boolean): AnyType;
@@ -499,7 +495,7 @@ export interface LiteralTypes {
499
495
  literalIntMap: Map<bigint | number, UnionableType> | undefined;
500
496
  literalEnumMap: Map<string, UnionableType> | undefined;
501
497
  }
502
- export interface UnionTypeDetailsPriv {
498
+ export interface UnionDetailsPriv {
503
499
  subtypes: UnionableType[];
504
500
  literalInstances: LiteralTypes;
505
501
  literalClasses: LiteralTypes;
@@ -507,7 +503,7 @@ export interface UnionTypeDetailsPriv {
507
503
  includesRecursiveTypeAlias: boolean;
508
504
  }
509
505
  export interface UnionType extends TypeBase<TypeCategory.Union> {
510
- priv: UnionTypeDetailsPriv;
506
+ priv: UnionDetailsPriv;
511
507
  }
512
508
  export declare namespace UnionType {
513
509
  function create(): UnionType;
@@ -526,16 +522,20 @@ export interface RecursiveAliasInfo {
526
522
  name: string;
527
523
  scopeId: TypeVarScopeId;
528
524
  isPep695Syntax: boolean;
529
- typeParameters: TypeVarType[] | undefined;
525
+ typeParams: TypeVarType[] | undefined;
526
+ }
527
+ export declare enum TypeVarKind {
528
+ TypeVar = 0,
529
+ TypeVarTuple = 1,
530
+ ParamSpec = 2
530
531
  }
531
532
  export interface TypeVarDetailsShared {
533
+ kind: TypeVarKind;
532
534
  name: string;
533
535
  constraints: Type[];
534
536
  boundType: Type | undefined;
535
537
  isDefaultExplicit: boolean;
536
538
  defaultType: Type;
537
- isParamSpec: boolean;
538
- isVariadic: boolean;
539
539
  declaredVariance: Variance;
540
540
  isSynthesized: boolean;
541
541
  isSynthesizedSelf: boolean;
@@ -550,38 +550,64 @@ export declare const enum TypeVarScopeType {
550
550
  Function = 1,
551
551
  TypeAlias = 2
552
552
  }
553
- export interface TypeVarTypeDetailsPriv {
553
+ export interface TypeVarDetailsPriv {
554
554
  scopeId?: TypeVarScopeId | undefined;
555
555
  scopeName?: string | undefined;
556
556
  scopeType?: TypeVarScopeType;
557
557
  nameWithScope?: string | undefined;
558
- isVariadicUnpacked?: boolean | undefined;
559
- isVariadicInUnion?: boolean | undefined;
560
- paramSpecAccess?: ParamSpecAccess;
561
558
  computedVariance?: Variance;
562
559
  isInScopePlaceholder?: boolean;
560
+ externalTypeVar?: TypeVarType | undefined;
563
561
  }
564
562
  export interface TypeVarType extends TypeBase<TypeCategory.TypeVar> {
565
563
  shared: TypeVarDetailsShared;
566
- priv: TypeVarTypeDetailsPriv;
564
+ priv: TypeVarDetailsPriv;
565
+ }
566
+ export interface ParamSpecDetailsPriv extends TypeVarDetailsPriv {
567
+ paramSpecAccess?: ParamSpecAccess;
568
+ externalTypeVar?: ParamSpecType | undefined;
569
+ }
570
+ export interface ParamSpecType extends TypeVarType {
571
+ shared: TypeVarDetailsShared & {
572
+ kind: TypeVarKind.ParamSpec;
573
+ };
574
+ priv: ParamSpecDetailsPriv;
575
+ }
576
+ export declare namespace ParamSpecType {
577
+ function getUnknown(): FunctionType;
578
+ }
579
+ export interface TypeVarTupleDetailsPriv extends TypeVarDetailsPriv {
580
+ isVariadicUnpacked?: boolean | undefined;
581
+ isVariadicInUnion?: boolean | undefined;
582
+ externalTypeVar?: TypeVarTupleType | undefined;
583
+ }
584
+ export interface TypeVarTupleType extends TypeVarType {
585
+ shared: TypeVarDetailsShared & {
586
+ kind: TypeVarKind.TypeVarTuple;
587
+ };
588
+ priv: TypeVarTupleDetailsPriv;
567
589
  }
568
590
  export declare namespace TypeVarType {
569
- function createInstance(name: string): TypeVarType;
570
- function createInstantiable(name: string, isParamSpec?: boolean): TypeVarType;
591
+ function createInstance(name: string, kind?: TypeVarKind): TypeVarType;
592
+ function createInstantiable(name: string, kind?: TypeVarKind): TypeVarType;
571
593
  function cloneAsInstance(type: TypeVarType): TypeVarType;
572
594
  function cloneAsInstantiable(type: TypeVarType): TypeVarType;
573
595
  function cloneForNewName(type: TypeVarType, name: string): TypeVarType;
574
- function cloneForScopeId(type: TypeVarType, scopeId: string, scopeName: string, scopeType: TypeVarScopeType): TypeVarType;
575
- function cloneForUnpacked(type: TypeVarType, isInUnion?: boolean): TypeVarType;
576
- function cloneForPacked(type: TypeVarType): TypeVarType;
596
+ function cloneForScopeId(type: TypeVarType, scopeId: string, scopeName: string | undefined, scopeType: TypeVarScopeType | undefined): TypeVarType;
597
+ function cloneForUnpacked(type: TypeVarTupleType, isInUnion?: boolean): TypeVarTupleType;
598
+ function cloneForPacked(type: TypeVarTupleType): TypeVarTupleType;
577
599
  function cloneAsInvariant(type: TypeVarType): TypeVarType;
578
- function cloneForParamSpecAccess(type: TypeVarType, access: ParamSpecAccess | undefined): TypeVarType;
600
+ function cloneForParamSpecAccess(type: ParamSpecType, access: ParamSpecAccess | undefined): ParamSpecType;
579
601
  function cloneAsSpecializedSelf(type: TypeVarType, specializedBoundType: Type): TypeVarType;
580
602
  function cloneAsInScopePlaceholder(type: TypeVarType, usageOffset?: number): TypeVarType;
581
603
  function makeNameWithScope(name: string, scopeId: string): string;
582
- function addConstraint(typeVarType: TypeVarType, constraintType: Type): void;
604
+ function makeInternalScopeId(scopeId: TypeVarScopeId): TypeVarScopeId;
605
+ function makeInternalScopeId(scopeId: TypeVarScopeId | undefined): TypeVarScopeId | undefined;
606
+ function cloneWithInternalScopeId(type: TypeVarType): TypeVarType;
607
+ function hasInternalScopeId(type: TypeVarType): boolean;
608
+ function addConstraint(type: TypeVarType, constraintType: Type): void;
583
609
  function getNameWithScope(typeVarType: TypeVarType): string;
584
- function getReadableName(typeVarType: TypeVarType): string;
610
+ function getReadableName(type: TypeVarType): string;
585
611
  function getVariance(type: TypeVarType): Variance.Invariant | Variance.Covariant | Variance.Contravariant;
586
612
  function isTypeAliasPlaceholder(type: TypeVarType): boolean;
587
613
  }
@@ -597,11 +623,11 @@ export declare function isInstantiableClass(type: Type): type is ClassType;
597
623
  export declare function isClassInstance(type: Type): type is ClassType;
598
624
  export declare function isModule(type: Type): type is ModuleType;
599
625
  export declare function isTypeVar(type: Type): type is TypeVarType;
600
- export declare function isVariadicTypeVar(type: Type): type is TypeVarType;
601
- export declare function isUnpackedVariadicTypeVar(type: Type): boolean;
626
+ export declare function isParamSpec(type: Type): type is ParamSpecType;
627
+ export declare function isTypeVarTuple(type: Type): type is TypeVarTupleType;
628
+ export declare function isUnpackedTypeVarTuple(type: Type): type is TypeVarTupleType;
602
629
  export declare function isUnpackedClass(type: Type): type is ClassType;
603
630
  export declare function isUnpacked(type: Type): boolean;
604
- export declare function isParamSpec(type: Type): type is TypeVarType;
605
631
  export declare function isFunction(type: Type): type is FunctionType;
606
632
  export declare function isOverloadedFunction(type: Type): type is OverloadedFunctionType;
607
633
  export declare function getTypeAliasInfo(type: Type): TypeAliasInfo | undefined;