@zzzen/pyright-internal 1.2.0-dev.20231015 → 1.2.0-dev.20231022

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 (81) hide show
  1. package/dist/analyzer/checker.js +6 -13
  2. package/dist/analyzer/checker.js.map +1 -1
  3. package/dist/analyzer/constraintSolver.js +65 -28
  4. package/dist/analyzer/constraintSolver.js.map +1 -1
  5. package/dist/analyzer/constructors.js +3 -4
  6. package/dist/analyzer/constructors.js.map +1 -1
  7. package/dist/analyzer/patternMatching.js +4 -0
  8. package/dist/analyzer/patternMatching.js.map +1 -1
  9. package/dist/analyzer/properties.js +6 -2
  10. package/dist/analyzer/properties.js.map +1 -1
  11. package/dist/analyzer/protocols.js +28 -30
  12. package/dist/analyzer/protocols.js.map +1 -1
  13. package/dist/analyzer/sourceFile.js +10 -4
  14. package/dist/analyzer/sourceFile.js.map +1 -1
  15. package/dist/analyzer/typeEvaluator.js +114 -101
  16. package/dist/analyzer/typeEvaluator.js.map +1 -1
  17. package/dist/analyzer/typeEvaluatorTypes.d.ts +1 -1
  18. package/dist/analyzer/typeGuards.js +28 -20
  19. package/dist/analyzer/typeGuards.js.map +1 -1
  20. package/dist/analyzer/typePrinter.js +4 -1
  21. package/dist/analyzer/typePrinter.js.map +1 -1
  22. package/dist/analyzer/typeUtils.d.ts +9 -1
  23. package/dist/analyzer/typeUtils.js +51 -46
  24. package/dist/analyzer/typeUtils.js.map +1 -1
  25. package/dist/analyzer/typedDicts.js +99 -27
  26. package/dist/analyzer/typedDicts.js.map +1 -1
  27. package/dist/analyzer/types.d.ts +2 -0
  28. package/dist/analyzer/types.js +27 -3
  29. package/dist/analyzer/types.js.map +1 -1
  30. package/dist/common/pathUtils.d.ts +3 -1
  31. package/dist/common/pathUtils.js +78 -27
  32. package/dist/common/pathUtils.js.map +1 -1
  33. package/dist/common/realFileSystem.js +11 -1
  34. package/dist/common/realFileSystem.js.map +1 -1
  35. package/dist/common/serviceProviderExtensions.d.ts +1 -3
  36. package/dist/common/serviceProviderExtensions.js +0 -7
  37. package/dist/common/serviceProviderExtensions.js.map +1 -1
  38. package/dist/common/uriParser.d.ts +10 -1
  39. package/dist/common/uriParser.js.map +1 -1
  40. package/dist/languageServerBase.d.ts +0 -2
  41. package/dist/languageServerBase.js +0 -14
  42. package/dist/languageServerBase.js.map +1 -1
  43. package/dist/languageService/hoverProvider.d.ts +6 -2
  44. package/dist/languageService/hoverProvider.js +33 -65
  45. package/dist/languageService/hoverProvider.js.map +1 -1
  46. package/dist/languageService/referencesProvider.js +1 -0
  47. package/dist/languageService/referencesProvider.js.map +1 -1
  48. package/dist/languageService/tooltipUtils.js +1 -3
  49. package/dist/languageService/tooltipUtils.js.map +1 -1
  50. package/dist/localization/localize.d.ts +4 -3
  51. package/dist/localization/localize.js +1 -1
  52. package/dist/localization/localize.js.map +1 -1
  53. package/dist/localization/package.nls.cs.json +6 -1
  54. package/dist/localization/package.nls.de.json +6 -1
  55. package/dist/localization/package.nls.en-us.json +1 -1
  56. package/dist/localization/package.nls.es.json +6 -1
  57. package/dist/localization/package.nls.fr.json +6 -1
  58. package/dist/localization/package.nls.it.json +6 -1
  59. package/dist/localization/package.nls.ja.json +6 -1
  60. package/dist/localization/package.nls.ko.json +6 -1
  61. package/dist/localization/package.nls.pl.json +6 -1
  62. package/dist/localization/package.nls.pt-br.json +6 -1
  63. package/dist/localization/package.nls.qps-ploc.json +6 -1
  64. package/dist/localization/package.nls.ru.json +6 -1
  65. package/dist/localization/package.nls.tr.json +6 -1
  66. package/dist/localization/package.nls.zh-cn.json +6 -1
  67. package/dist/localization/package.nls.zh-tw.json +6 -1
  68. package/dist/pyrightFileSystem.d.ts +1 -15
  69. package/dist/pyrightFileSystem.js +1 -57
  70. package/dist/pyrightFileSystem.js.map +1 -1
  71. package/dist/tests/harness/vfs/filesystem.js +4 -0
  72. package/dist/tests/harness/vfs/filesystem.js.map +1 -1
  73. package/dist/tests/harness/vfs/pathValidation.js +10 -1
  74. package/dist/tests/harness/vfs/pathValidation.js.map +1 -1
  75. package/dist/tests/pyrightFileSystem.test.js +0 -20
  76. package/dist/tests/pyrightFileSystem.test.js.map +1 -1
  77. package/dist/tests/typeEvaluator2.test.js +10 -2
  78. package/dist/tests/typeEvaluator2.test.js.map +1 -1
  79. package/dist/tests/typeEvaluator5.test.js +7 -1
  80. package/dist/tests/typeEvaluator5.test.js.map +1 -1
  81. package/package.json +1 -1
@@ -8,8 +8,8 @@
8
8
  * Functions that operate on Type objects.
9
9
  */
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.replaceTypeVarsWithAny = exports.validateTypeVarDefault = exports.applyInScopePlaceholders = exports.applySourceContextTypeVarsToSignature = exports.applySourceContextTypeVars = exports.applySolvedTypeVars = exports.ensureFunctionSignaturesAreUnique = exports.populateTypeVarContextForSelfType = exports.partiallySpecializeType = exports.isTupleIndexUnambiguous = exports.isUnboundedTupleClass = exports.isTupleClass = exports.isMaybeDescriptorInstance = exports.isDescriptorInstance = exports.isCallableType = exports.isProperty = exports.isEllipsisType = exports.getUnionSubtypeCount = exports.getLiteralTypeClassName = exports.containsLiteralType = exports.isLiteralTypeOrUnion = exports.isLiteralType = exports.getSpecializedTupleType = exports.selfSpecializeClass = exports.specializeWithDefaultTypeArgs = exports.getTypeVarScopeIds = exports.getTypeVarScopeId = exports.transformPossibleRecursiveTypeAlias = exports.isTypeAliasRecursive = exports.isTypeAliasPlaceholder = exports.getTypeCondition = exports.addConditionToType = exports.getFullNameOfType = exports.derivesFromAnyOrUnknown = exports.isUnionableType = exports.preserveUnknown = exports.areTypesSame = exports.doForEachSignature = exports.doForEachSubtype = exports.sortTypes = exports.cleanIncompleteUnknown = exports.mapSubtypes = exports.makeInferenceContext = exports.isTypeVarSame = exports.isIncompleteUnknown = exports.isOptionalType = exports.UniqueSignatureTracker = exports.AssignTypeFlags = exports.ClassIteratorFlags = exports.ClassMemberLookupFlags = void 0;
12
- exports.convertParamSpecValueToType = exports.convertTypeToParamSpecValue = exports.getDeclaringModulesForType = exports.computeMroLinearization = exports.isVarianceOfTypeArgumentCompatible = exports.combineVariances = exports.requiresSpecialization = exports.requiresTypeArguments = exports.getGeneratorTypeArgs = exports.removeParamSpecVariadicsFromFunction = exports.removeParamSpecVariadicsFromSignature = exports.specializeTupleClass = exports.combineSameSizedTuples = exports.explodeGenericClass = exports.isPartlyUnknown = exports.containsAnyOrUnknown = exports.containsAnyRecursive = exports.getMembersForModule = exports.getMembersForClass = exports.convertToInstantiable = exports.convertToInstance = exports.isEffectivelyInstantiable = exports.isMetaclassInstance = exports.isInstantiableMetaclass = exports.getGeneratorYieldType = exports.getDeclaredGeneratorReturnType = exports.synthesizeTypeVarForSelfCls = exports.derivesFromClassRecursive = exports.derivesFromStdlibClass = exports.specializeForBaseClass = exports.buildTypeVarContext = exports.buildTypeVarContextFromSpecializedClass = exports.setTypeArgumentsRecursive = exports.specializeClassType = exports.isTypeVarLimitedToCallable = exports.getTypeVarArgumentsRecursive = exports.addTypeVarsToListIfUnique = exports.getClassFieldsRecursive = exports.getClassIterator = exports.getClassMemberIterator = exports.lookUpClassMember = exports.lookUpObjectMember = exports.getContainerDepth = exports.getProtocolSymbolsRecursive = exports.getProtocolSymbols = exports.transformExpectedType = void 0;
11
+ exports.applySourceContextTypeVarsToSignature = exports.applySourceContextTypeVars = exports.applySolvedTypeVars = exports.ensureFunctionSignaturesAreUnique = exports.populateTypeVarContextForSelfType = exports.partiallySpecializeType = exports.isTupleIndexUnambiguous = exports.isUnboundedTupleClass = exports.isTupleClass = exports.isMaybeDescriptorInstance = exports.isDescriptorInstance = exports.isCallableType = exports.isProperty = exports.isEllipsisType = exports.getUnionSubtypeCount = exports.getLiteralTypeClassName = exports.containsLiteralType = exports.isLiteralTypeOrUnion = exports.isLiteralType = exports.getSpecializedTupleType = exports.selfSpecializeClass = exports.getUnknownTypeForParamSpec = exports.getUnknownTypeForTypeVar = exports.specializeWithUnknown = exports.specializeWithDefaultTypeArgs = exports.getTypeVarScopeIds = exports.getTypeVarScopeId = exports.transformPossibleRecursiveTypeAlias = exports.isTypeAliasRecursive = exports.isTypeAliasPlaceholder = exports.getTypeCondition = exports.addConditionToType = exports.getFullNameOfType = exports.derivesFromAnyOrUnknown = exports.isUnionableType = exports.preserveUnknown = exports.areTypesSame = exports.doForEachSignature = exports.doForEachSubtype = exports.sortTypes = exports.cleanIncompleteUnknown = exports.mapSubtypes = exports.makeInferenceContext = exports.isTypeVarSame = exports.isIncompleteUnknown = exports.isOptionalType = exports.UniqueSignatureTracker = exports.AssignTypeFlags = exports.ClassIteratorFlags = exports.ClassMemberLookupFlags = void 0;
12
+ exports.convertParamSpecValueToType = exports.convertTypeToParamSpecValue = exports.getDeclaringModulesForType = exports.computeMroLinearization = exports.isVarianceOfTypeArgumentCompatible = exports.combineVariances = exports.requiresSpecialization = exports.requiresTypeArguments = exports.getGeneratorTypeArgs = exports.removeParamSpecVariadicsFromFunction = exports.removeParamSpecVariadicsFromSignature = exports.specializeTupleClass = exports.combineSameSizedTuples = exports.explodeGenericClass = exports.isPartlyUnknown = exports.containsAnyOrUnknown = exports.containsAnyRecursive = exports.getMembersForModule = exports.getMembersForClass = exports.convertToInstantiable = exports.convertToInstance = exports.isEffectivelyInstantiable = exports.isMetaclassInstance = exports.isInstantiableMetaclass = exports.getGeneratorYieldType = exports.getDeclaredGeneratorReturnType = exports.synthesizeTypeVarForSelfCls = exports.derivesFromClassRecursive = exports.derivesFromStdlibClass = exports.specializeForBaseClass = exports.buildTypeVarContext = exports.buildTypeVarContextFromSpecializedClass = exports.setTypeArgumentsRecursive = exports.specializeClassType = exports.isTypeVarLimitedToCallable = exports.getTypeVarArgumentsRecursive = exports.addTypeVarsToListIfUnique = exports.getClassFieldsRecursive = exports.getClassIterator = exports.getClassMemberIterator = exports.lookUpClassMember = exports.lookUpObjectMember = exports.getContainerDepth = exports.getProtocolSymbolsRecursive = exports.getProtocolSymbols = exports.transformExpectedType = exports.replaceTypeVarsWithAny = exports.validateTypeVarDefault = exports.applyInScopePlaceholders = void 0;
13
13
  const collectionUtils_1 = require("../common/collectionUtils");
14
14
  const debug_1 = require("../common/debug");
15
15
  const symbol_1 = require("./symbol");
@@ -671,11 +671,37 @@ function specializeWithDefaultTypeArgs(type) {
671
671
  if (type.details.typeParameters.length === 0 || type.typeArguments) {
672
672
  return type;
673
673
  }
674
- return types_1.ClassType.cloneForSpecialization(type, type.details.typeParameters.map((param) => { var _a; return (_a = param.details.defaultType) !== null && _a !== void 0 ? _a : types_1.UnknownType.create(); }),
674
+ return types_1.ClassType.cloneForSpecialization(type, type.details.typeParameters.map((param) => { var _a; return (_a = param.details.defaultType) !== null && _a !== void 0 ? _a : getUnknownTypeForTypeVar(param); }),
675
675
  /* isTypeArgumentExplicit */ false,
676
- /* includeSubclasses */ true);
676
+ /* includeSubclasses */ type.includeSubclasses);
677
677
  }
678
678
  exports.specializeWithDefaultTypeArgs = specializeWithDefaultTypeArgs;
679
+ // Specializes the class with "Unknown" type args (or the equivalent for ParamSpecs
680
+ // or TypeVarTuples).
681
+ function specializeWithUnknown(type) {
682
+ if (type.details.typeParameters.length === 0) {
683
+ return type;
684
+ }
685
+ return types_1.ClassType.cloneForSpecialization(type, type.details.typeParameters.map((param) => getUnknownTypeForTypeVar(param)),
686
+ /* isTypeArgumentExplicit */ false,
687
+ /* includeSubclasses */ type.includeSubclasses);
688
+ }
689
+ exports.specializeWithUnknown = specializeWithUnknown;
690
+ // Returns "Unknown" for simple TypeVars or the equivalent for a ParamSpec.
691
+ function getUnknownTypeForTypeVar(typeVar) {
692
+ if (typeVar.details.isParamSpec) {
693
+ return getUnknownTypeForParamSpec();
694
+ }
695
+ return types_1.UnknownType.create();
696
+ }
697
+ exports.getUnknownTypeForTypeVar = getUnknownTypeForTypeVar;
698
+ // Returns the "Unknown" equivalent for a ParamSpec.
699
+ function getUnknownTypeForParamSpec() {
700
+ const newFunction = types_1.FunctionType.createInstance('', '', '', 65536 /* ParamSpecValue */ | 32768 /* SkipArgsKwargsCompatibilityCheck */);
701
+ types_1.FunctionType.addDefaultParameters(newFunction);
702
+ return newFunction;
703
+ }
704
+ exports.getUnknownTypeForParamSpec = getUnknownTypeForParamSpec;
679
705
  // If the class is generic and not already specialized, this function
680
706
  // "self specializes" the class, filling in its own type parameters
681
707
  // as type arguments.
@@ -1501,9 +1527,7 @@ function setTypeArgumentsRecursive(destType, srcType, typeVarContext, recursionC
1501
1527
  if (destType.details.paramSpec) {
1502
1528
  // Fill in an empty signature for a ParamSpec.
1503
1529
  if (!typeVarContext.getPrimarySignature().getTypeVar(destType.details.paramSpec)) {
1504
- const newFunction = types_1.FunctionType.createInstance('', '', '', 32768 /* SkipArgsKwargsCompatibilityCheck */ | 65536 /* ParamSpecValue */);
1505
- types_1.FunctionType.addDefaultParameters(newFunction);
1506
- typeVarContext.setTypeVarType(destType.details.paramSpec, newFunction);
1530
+ typeVarContext.setTypeVarType(destType.details.paramSpec, getUnknownTypeForTypeVar(destType.details.paramSpec));
1507
1531
  }
1508
1532
  }
1509
1533
  break;
@@ -2168,18 +2192,18 @@ function requiresTypeArguments(classType) {
2168
2192
  return false;
2169
2193
  }
2170
2194
  exports.requiresTypeArguments = requiresTypeArguments;
2171
- function requiresSpecialization(type, ignorePseudoGeneric = false, ignoreSelf = false, recursionCount = 0) {
2195
+ function requiresSpecialization(type, options, recursionCount = 0) {
2172
2196
  var _a;
2173
2197
  if (recursionCount > types_1.maxTypeRecursionCount) {
2174
2198
  return false;
2175
2199
  }
2176
2200
  recursionCount++;
2177
2201
  // Is the answer cached?
2178
- const canUseCache = !ignorePseudoGeneric && !ignoreSelf;
2202
+ const canUseCache = !(options === null || options === void 0 ? void 0 : options.ignorePseudoGeneric) && !(options === null || options === void 0 ? void 0 : options.ignoreSelf);
2179
2203
  if (canUseCache && ((_a = type.cached) === null || _a === void 0 ? void 0 : _a.requiresSpecialization) !== undefined) {
2180
2204
  return type.cached.requiresSpecialization;
2181
2205
  }
2182
- const result = _requiresSpecialization(type, ignorePseudoGeneric, ignoreSelf, recursionCount);
2206
+ const result = _requiresSpecialization(type, options, recursionCount);
2183
2207
  if (canUseCache) {
2184
2208
  if (type.cached === undefined) {
2185
2209
  type.cached = {};
@@ -2189,15 +2213,18 @@ function requiresSpecialization(type, ignorePseudoGeneric = false, ignoreSelf =
2189
2213
  return result;
2190
2214
  }
2191
2215
  exports.requiresSpecialization = requiresSpecialization;
2192
- function _requiresSpecialization(type, ignorePseudoGeneric = false, ignoreSelf = false, recursionCount = 0) {
2216
+ function _requiresSpecialization(type, options, recursionCount = 0) {
2193
2217
  var _a;
2194
2218
  switch (type.category) {
2195
2219
  case 7 /* Class */: {
2196
- if (types_1.ClassType.isPseudoGenericClass(type) && ignorePseudoGeneric) {
2220
+ if (types_1.ClassType.isPseudoGenericClass(type) && (options === null || options === void 0 ? void 0 : options.ignorePseudoGeneric)) {
2221
+ return false;
2222
+ }
2223
+ if (!type.isTypeArgumentExplicit && (options === null || options === void 0 ? void 0 : options.ignoreImplicitTypeArgs)) {
2197
2224
  return false;
2198
2225
  }
2199
2226
  if (type.typeArguments) {
2200
- return type.typeArguments.some((typeArg) => requiresSpecialization(typeArg, ignorePseudoGeneric, ignoreSelf, recursionCount));
2227
+ return type.typeArguments.some((typeArg) => requiresSpecialization(typeArg, options, recursionCount));
2201
2228
  }
2202
2229
  return types_1.ClassType.getTypeParameters(type).length > 0;
2203
2230
  }
@@ -2206,7 +2233,7 @@ function _requiresSpecialization(type, ignorePseudoGeneric = false, ignoreSelf =
2206
2233
  return true;
2207
2234
  }
2208
2235
  for (let i = 0; i < type.details.parameters.length; i++) {
2209
- if (requiresSpecialization(types_1.FunctionType.getEffectiveParameterType(type, i), ignorePseudoGeneric, ignoreSelf, recursionCount)) {
2236
+ if (requiresSpecialization(types_1.FunctionType.getEffectiveParameterType(type, i), options, recursionCount)) {
2210
2237
  return true;
2211
2238
  }
2212
2239
  }
@@ -2214,27 +2241,27 @@ function _requiresSpecialization(type, ignorePseudoGeneric = false, ignoreSelf =
2214
2241
  ? type.specializedTypes.returnType
2215
2242
  : type.details.declaredReturnType;
2216
2243
  if (declaredReturnType) {
2217
- if (requiresSpecialization(declaredReturnType, ignorePseudoGeneric, ignoreSelf, recursionCount)) {
2244
+ if (requiresSpecialization(declaredReturnType, options, recursionCount)) {
2218
2245
  return true;
2219
2246
  }
2220
2247
  }
2221
2248
  else if (type.inferredReturnType) {
2222
- if (requiresSpecialization(type.inferredReturnType, ignorePseudoGeneric, ignoreSelf, recursionCount)) {
2249
+ if (requiresSpecialization(type.inferredReturnType, options, recursionCount)) {
2223
2250
  return true;
2224
2251
  }
2225
2252
  }
2226
2253
  return false;
2227
2254
  }
2228
2255
  case 6 /* OverloadedFunction */: {
2229
- return type.overloads.some((overload) => requiresSpecialization(overload, ignorePseudoGeneric, ignoreSelf, recursionCount));
2256
+ return type.overloads.some((overload) => requiresSpecialization(overload, options, recursionCount));
2230
2257
  }
2231
2258
  case 9 /* Union */: {
2232
- return type.subtypes.some((subtype) => requiresSpecialization(subtype, ignorePseudoGeneric, ignoreSelf, recursionCount));
2259
+ return type.subtypes.some((subtype) => requiresSpecialization(subtype, options, recursionCount));
2233
2260
  }
2234
2261
  case 10 /* TypeVar */: {
2235
2262
  // Most TypeVar types need to be specialized.
2236
2263
  if (!type.details.recursiveTypeAliasName) {
2237
- if (type.details.isSynthesizedSelf && ignoreSelf) {
2264
+ if (type.details.isSynthesizedSelf && (options === null || options === void 0 ? void 0 : options.ignoreSelf)) {
2238
2265
  return false;
2239
2266
  }
2240
2267
  return true;
@@ -2242,7 +2269,7 @@ function _requiresSpecialization(type, ignorePseudoGeneric = false, ignoreSelf =
2242
2269
  // If this is a recursive type alias, it may need to be specialized
2243
2270
  // if it has generic type arguments.
2244
2271
  if ((_a = type.typeAliasInfo) === null || _a === void 0 ? void 0 : _a.typeArguments) {
2245
- return type.typeAliasInfo.typeArguments.some((typeArg) => requiresSpecialization(typeArg, ignorePseudoGeneric, ignoreSelf, recursionCount));
2272
+ return type.typeAliasInfo.typeArguments.some((typeArg) => requiresSpecialization(typeArg, options, recursionCount));
2246
2273
  }
2247
2274
  }
2248
2275
  }
@@ -2497,9 +2524,7 @@ function convertTypeToParamSpecValue(type) {
2497
2524
  newFunction.details.paramSpec = type.details.paramSpec;
2498
2525
  return newFunction;
2499
2526
  }
2500
- const newFunction = types_1.FunctionType.createInstance('', '', '', 65536 /* ParamSpecValue */ | 32768 /* SkipArgsKwargsCompatibilityCheck */);
2501
- types_1.FunctionType.addDefaultParameters(newFunction);
2502
- return newFunction;
2527
+ return getUnknownTypeForParamSpec();
2503
2528
  }
2504
2529
  exports.convertTypeToParamSpecValue = convertTypeToParamSpecValue;
2505
2530
  function convertParamSpecValueToType(paramSpecValue, omitParamSpec = false) {
@@ -3007,9 +3032,7 @@ class TypeVarAnyReplacer extends TypeVarTransformer {
3007
3032
  return types_1.AnyType.create();
3008
3033
  }
3009
3034
  transformParamSpec(paramSpec) {
3010
- const paramSpecValue = types_1.FunctionType.createInstance('', '', '', 65536 /* ParamSpecValue */ | 32768 /* SkipArgsKwargsCompatibilityCheck */);
3011
- types_1.FunctionType.addDefaultParameters(paramSpecValue);
3012
- return paramSpecValue;
3035
+ return getUnknownTypeForParamSpec();
3013
3036
  }
3014
3037
  }
3015
3038
  // For a TypeVar with a default type, validates whether the default type is using
@@ -3181,19 +3204,6 @@ class ApplySolvedTypeVarsTransformer extends TypeVarTransformer {
3181
3204
  }
3182
3205
  return types_1.UnknownType.create();
3183
3206
  }
3184
- // If we're solving a default type, handle type variables with no scope ID.
3185
- if (this._isSolvingDefaultType && !typeVar.scopeId) {
3186
- const replacementEntry = signatureContext
3187
- .getTypeVars()
3188
- .find((entry) => entry.typeVar.details.name === typeVar.details.name);
3189
- if (replacementEntry) {
3190
- return signatureContext.getTypeVarType(replacementEntry.typeVar);
3191
- }
3192
- if (typeVar.details.defaultType) {
3193
- return this.apply(typeVar.details.defaultType, recursionCount);
3194
- }
3195
- return types_1.UnknownType.create();
3196
- }
3197
3207
  return undefined;
3198
3208
  }
3199
3209
  transformUnionSubtype(preTransform, postTransform) {
@@ -3252,7 +3262,7 @@ class ApplySolvedTypeVarsTransformer extends TypeVarTransformer {
3252
3262
  if (paramSpec.details.defaultType) {
3253
3263
  return convertTypeToParamSpecValue(this.apply(paramSpec.details.defaultType, recursionCount));
3254
3264
  }
3255
- return this._getUnknownParamSpec();
3265
+ return getUnknownTypeForParamSpec();
3256
3266
  }
3257
3267
  if (!paramSpec.scopeId || !this._typeVarContext.hasSolveForScope(paramSpec.scopeId)) {
3258
3268
  return undefined;
@@ -3277,7 +3287,7 @@ class ApplySolvedTypeVarsTransformer extends TypeVarTransformer {
3277
3287
  return convertTypeToParamSpecValue(this._solveDefaultType(paramSpec.details.defaultType, recursionCount));
3278
3288
  }
3279
3289
  // Convert to the ParamSpec equivalent of "Unknown".
3280
- return this._getUnknownParamSpec();
3290
+ return getUnknownTypeForParamSpec();
3281
3291
  }
3282
3292
  return undefined;
3283
3293
  }
@@ -3312,11 +3322,6 @@ class ApplySolvedTypeVarsTransformer extends TypeVarTransformer {
3312
3322
  this._isSolvingDefaultType = wasSolvingDefaultType;
3313
3323
  return result;
3314
3324
  }
3315
- _getUnknownParamSpec() {
3316
- const paramSpecValue = types_1.FunctionType.createInstance('', '', '', 65536 /* ParamSpecValue */ | 32768 /* SkipArgsKwargsCompatibilityCheck */);
3317
- types_1.FunctionType.addDefaultParameters(paramSpecValue);
3318
- return paramSpecValue;
3319
- }
3320
3325
  }
3321
3326
  class ExpectedTypeTransformer extends TypeVarTransformer {
3322
3327
  constructor(_liveTypeVarScopes, _usageOffset) {