coc-pyright 1.1.362 → 1.1.365
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.
- package/lib/index.js +1087 -803
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -12476,7 +12476,7 @@ var require_uriUtils = __commonJS({
|
|
|
12476
12476
|
"node_modules/@zzzen/pyright-internal/dist/common/uri/uriUtils.js"(exports2) {
|
|
12477
12477
|
"use strict";
|
|
12478
12478
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
12479
|
-
exports2.UriEx = exports2.
|
|
12479
|
+
exports2.UriEx = exports2.convertUriToLspUriString = exports2.getRootUri = exports2.deduplicateFolders = exports2.getDirectoryChangeKind = exports2.getFileSpec = exports2.hasPythonExtension = exports2.getWildcardRoot = exports2.getWildcardRegexPattern = exports2.getFileSystemEntriesFromDirEntries = exports2.getFileSystemEntries = exports2.tryRealpath = exports2.tryStat = exports2.isFile = exports2.isDirectory = exports2.directoryExists = exports2.fileExists = exports2.getFileSize = exports2.makeDirectories = exports2.forEachAncestorDirectory = exports2.FileSpec = void 0;
|
|
12480
12480
|
var pathUtils_1 = require_pathUtils();
|
|
12481
12481
|
var uri_1 = require_uri();
|
|
12482
12482
|
var serviceKeys_1 = require_serviceKeys();
|
|
@@ -12772,10 +12772,10 @@ var require_uriUtils = __commonJS({
|
|
|
12772
12772
|
return void 0;
|
|
12773
12773
|
}
|
|
12774
12774
|
exports2.getRootUri = getRootUri;
|
|
12775
|
-
function
|
|
12775
|
+
function convertUriToLspUriString(fs8, uri) {
|
|
12776
12776
|
return fs8.getOriginalUri(uri).toString();
|
|
12777
12777
|
}
|
|
12778
|
-
exports2.
|
|
12778
|
+
exports2.convertUriToLspUriString = convertUriToLspUriString;
|
|
12779
12779
|
var UriEx;
|
|
12780
12780
|
(function(UriEx2) {
|
|
12781
12781
|
function file(path12, arg, checkRelative) {
|
|
@@ -13207,6 +13207,10 @@ var require_console = __commonJS({
|
|
|
13207
13207
|
return obj.error !== void 0 && obj.warn !== void 0 && obj.info !== void 0 && obj.log !== void 0;
|
|
13208
13208
|
}
|
|
13209
13209
|
ConsoleInterface2.is = is;
|
|
13210
|
+
function hasLevel(console2) {
|
|
13211
|
+
return is(console2) && "level" in console2;
|
|
13212
|
+
}
|
|
13213
|
+
ConsoleInterface2.hasLevel = hasLevel;
|
|
13210
13214
|
})(ConsoleInterface || (exports2.ConsoleInterface = ConsoleInterface = {}));
|
|
13211
13215
|
var levelMap = /* @__PURE__ */ new Map([
|
|
13212
13216
|
[LogLevel.Error, 0],
|
|
@@ -13522,7 +13526,7 @@ var require_pythonVersion = __commonJS({
|
|
|
13522
13526
|
"node_modules/@zzzen/pyright-internal/dist/common/pythonVersion.js"(exports2) {
|
|
13523
13527
|
"use strict";
|
|
13524
13528
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
13525
|
-
exports2.latestStablePythonVersion = exports2.pythonVersion3_13 = exports2.pythonVersion3_12 = exports2.pythonVersion3_11 = exports2.pythonVersion3_10 = exports2.pythonVersion3_9 = exports2.pythonVersion3_8 = exports2.pythonVersion3_7 = exports2.pythonVersion3_6 = exports2.pythonVersion3_5 = exports2.pythonVersion3_4 = exports2.pythonVersion3_3 = exports2.pythonVersion3_2 = exports2.pythonVersion3_1 = exports2.pythonVersion3_0 = exports2.PythonVersion = void 0;
|
|
13529
|
+
exports2.latestStablePythonVersion = exports2.pythonVersion3_14 = exports2.pythonVersion3_13 = exports2.pythonVersion3_12 = exports2.pythonVersion3_11 = exports2.pythonVersion3_10 = exports2.pythonVersion3_9 = exports2.pythonVersion3_8 = exports2.pythonVersion3_7 = exports2.pythonVersion3_6 = exports2.pythonVersion3_5 = exports2.pythonVersion3_4 = exports2.pythonVersion3_3 = exports2.pythonVersion3_2 = exports2.pythonVersion3_1 = exports2.pythonVersion3_0 = exports2.PythonVersion = void 0;
|
|
13526
13530
|
var PythonVersion = class _PythonVersion {
|
|
13527
13531
|
constructor(_major, _minor, _micro, _releaseLevel, _serial) {
|
|
13528
13532
|
this._major = _major;
|
|
@@ -13672,6 +13676,7 @@ var require_pythonVersion = __commonJS({
|
|
|
13672
13676
|
exports2.pythonVersion3_11 = new PythonVersion(3, 11);
|
|
13673
13677
|
exports2.pythonVersion3_12 = new PythonVersion(3, 12);
|
|
13674
13678
|
exports2.pythonVersion3_13 = new PythonVersion(3, 13);
|
|
13679
|
+
exports2.pythonVersion3_14 = new PythonVersion(3, 14);
|
|
13675
13680
|
exports2.latestStablePythonVersion = exports2.pythonVersion3_12;
|
|
13676
13681
|
}
|
|
13677
13682
|
});
|
|
@@ -14272,7 +14277,7 @@ var require_configOptions = __commonJS({
|
|
|
14272
14277
|
}
|
|
14273
14278
|
exports2.matchFileSpecs = matchFileSpecs;
|
|
14274
14279
|
var ConfigOptions = class _ConfigOptions {
|
|
14275
|
-
constructor(projectRoot
|
|
14280
|
+
constructor(projectRoot) {
|
|
14276
14281
|
this.include = [];
|
|
14277
14282
|
this.exclude = [];
|
|
14278
14283
|
this.ignore = [];
|
|
@@ -14286,8 +14291,7 @@ var require_configOptions = __commonJS({
|
|
|
14286
14291
|
this.disableTaggedHints = false;
|
|
14287
14292
|
this.executionEnvironments = [];
|
|
14288
14293
|
this.projectRoot = projectRoot;
|
|
14289
|
-
this.
|
|
14290
|
-
this.diagnosticRuleSet = _ConfigOptions.getDiagnosticRuleSet(typeCheckingMode);
|
|
14294
|
+
this.diagnosticRuleSet = _ConfigOptions.getDiagnosticRuleSet();
|
|
14291
14295
|
this.functionSignatureDisplay = SignatureDisplayType.formatted;
|
|
14292
14296
|
}
|
|
14293
14297
|
static getDiagnosticRuleSet(typeCheckingMode) {
|
|
@@ -14322,8 +14326,14 @@ var require_configOptions = __commonJS({
|
|
|
14322
14326
|
}
|
|
14323
14327
|
return [this.getDefaultExecEnvironment()];
|
|
14324
14328
|
}
|
|
14329
|
+
initializeTypeCheckingMode(typeCheckingMode, severityOverrides) {
|
|
14330
|
+
this.diagnosticRuleSet = _ConfigOptions.getDiagnosticRuleSet(typeCheckingMode);
|
|
14331
|
+
if (severityOverrides) {
|
|
14332
|
+
this.applyDiagnosticOverrides(severityOverrides);
|
|
14333
|
+
}
|
|
14334
|
+
}
|
|
14325
14335
|
// Initialize the structure from a JSON object.
|
|
14326
|
-
initializeFromJson(configObj,
|
|
14336
|
+
initializeFromJson(configObj, configDirUri, serviceProvider, host, commandLineOptions) {
|
|
14327
14337
|
var _a;
|
|
14328
14338
|
this.initializedFromJson = true;
|
|
14329
14339
|
const console2 = (_a = serviceProvider.tryGet(serviceKeys_1.ServiceKeys.console)) !== null && _a !== void 0 ? _a : new console_1.NullConsole();
|
|
@@ -14339,7 +14349,7 @@ var require_configOptions = __commonJS({
|
|
|
14339
14349
|
} else if ((0, path_1.isAbsolute)(fileSpec)) {
|
|
14340
14350
|
console2.error(`Ignoring path "${fileSpec}" in "include" array because it is not relative.`);
|
|
14341
14351
|
} else {
|
|
14342
|
-
this.include.push((0, uriUtils_1.getFileSpec)(
|
|
14352
|
+
this.include.push((0, uriUtils_1.getFileSpec)(configDirUri, fileSpec));
|
|
14343
14353
|
}
|
|
14344
14354
|
});
|
|
14345
14355
|
}
|
|
@@ -14356,7 +14366,7 @@ var require_configOptions = __commonJS({
|
|
|
14356
14366
|
} else if ((0, path_1.isAbsolute)(fileSpec)) {
|
|
14357
14367
|
console2.error(`Ignoring path "${fileSpec}" in "exclude" array because it is not relative.`);
|
|
14358
14368
|
} else {
|
|
14359
|
-
this.exclude.push((0, uriUtils_1.getFileSpec)(
|
|
14369
|
+
this.exclude.push((0, uriUtils_1.getFileSpec)(configDirUri, fileSpec));
|
|
14360
14370
|
}
|
|
14361
14371
|
});
|
|
14362
14372
|
}
|
|
@@ -14373,7 +14383,7 @@ var require_configOptions = __commonJS({
|
|
|
14373
14383
|
} else if ((0, path_1.isAbsolute)(fileSpec)) {
|
|
14374
14384
|
console2.error(`Ignoring path "${fileSpec}" in "ignore" array because it is not relative.`);
|
|
14375
14385
|
} else {
|
|
14376
|
-
this.ignore.push((0, uriUtils_1.getFileSpec)(
|
|
14386
|
+
this.ignore.push((0, uriUtils_1.getFileSpec)(configDirUri, fileSpec));
|
|
14377
14387
|
}
|
|
14378
14388
|
});
|
|
14379
14389
|
}
|
|
@@ -14390,15 +14400,14 @@ var require_configOptions = __commonJS({
|
|
|
14390
14400
|
} else if ((0, path_1.isAbsolute)(fileSpec)) {
|
|
14391
14401
|
console2.error(`Ignoring path "${fileSpec}" in "strict" array because it is not relative.`);
|
|
14392
14402
|
} else {
|
|
14393
|
-
this.strict.push((0, uriUtils_1.getFileSpec)(
|
|
14403
|
+
this.strict.push((0, uriUtils_1.getFileSpec)(configDirUri, fileSpec));
|
|
14394
14404
|
}
|
|
14395
14405
|
});
|
|
14396
14406
|
}
|
|
14397
14407
|
}
|
|
14398
|
-
let configTypeCheckingMode;
|
|
14399
14408
|
if (configObj.typeCheckingMode !== void 0) {
|
|
14400
14409
|
if (configObj.typeCheckingMode === "off" || configObj.typeCheckingMode === "basic" || configObj.typeCheckingMode === "standard" || configObj.typeCheckingMode === "strict") {
|
|
14401
|
-
|
|
14410
|
+
this.diagnosticRuleSet = { ..._ConfigOptions.getDiagnosticRuleSet(configObj.typeCheckingMode) };
|
|
14402
14411
|
} else {
|
|
14403
14412
|
console2.error(`Config "typeCheckingMode" entry must contain "off", "basic", "standard", or "strict".`);
|
|
14404
14413
|
}
|
|
@@ -14410,10 +14419,6 @@ var require_configOptions = __commonJS({
|
|
|
14410
14419
|
console2.error(`Config "useLibraryCodeForTypes" entry must be true or false.`);
|
|
14411
14420
|
}
|
|
14412
14421
|
}
|
|
14413
|
-
this.typeCheckingMode = configTypeCheckingMode || typeCheckingMode;
|
|
14414
|
-
const defaultSettings = _ConfigOptions.getDiagnosticRuleSet(this.typeCheckingMode);
|
|
14415
|
-
this.diagnosticRuleSet = { ...defaultSettings };
|
|
14416
|
-
this.applyDiagnosticOverrides(commandLineOptions === null || commandLineOptions === void 0 ? void 0 : commandLineOptions.diagnosticSeverityOverrides);
|
|
14417
14422
|
getBooleanDiagnosticRules(
|
|
14418
14423
|
/* includeNonOverridable */
|
|
14419
14424
|
true
|
|
@@ -14423,15 +14428,13 @@ var require_configOptions = __commonJS({
|
|
|
14423
14428
|
getDiagLevelDiagnosticRules().forEach((ruleName) => {
|
|
14424
14429
|
this.diagnosticRuleSet[ruleName] = this._convertDiagnosticLevel(configObj[ruleName], ruleName, this.diagnosticRuleSet[ruleName]);
|
|
14425
14430
|
});
|
|
14426
|
-
this.venvPath = void 0;
|
|
14427
14431
|
if (configObj.venvPath !== void 0) {
|
|
14428
14432
|
if (typeof configObj.venvPath !== "string") {
|
|
14429
14433
|
console2.error(`Config "venvPath" field must contain a string.`);
|
|
14430
14434
|
} else {
|
|
14431
|
-
this.venvPath =
|
|
14435
|
+
this.venvPath = configDirUri.resolvePaths(configObj.venvPath);
|
|
14432
14436
|
}
|
|
14433
14437
|
}
|
|
14434
|
-
this.venv = void 0;
|
|
14435
14438
|
if (configObj.venv !== void 0) {
|
|
14436
14439
|
if (typeof configObj.venv !== "string") {
|
|
14437
14440
|
console2.error(`Config "venv" field must contain a string.`);
|
|
@@ -14449,7 +14452,7 @@ var require_configOptions = __commonJS({
|
|
|
14449
14452
|
if (typeof path12 !== "string") {
|
|
14450
14453
|
console2.error(`Config "extraPaths" field ${pathIndex} must be a string.`);
|
|
14451
14454
|
} else {
|
|
14452
|
-
this.defaultExtraPaths.push(
|
|
14455
|
+
this.defaultExtraPaths.push(configDirUri.resolvePaths(path12));
|
|
14453
14456
|
}
|
|
14454
14457
|
});
|
|
14455
14458
|
}
|
|
@@ -14481,28 +14484,26 @@ var require_configOptions = __commonJS({
|
|
|
14481
14484
|
this.defaultPythonPlatform = commandLineOptions.pythonPlatform;
|
|
14482
14485
|
}
|
|
14483
14486
|
this.ensureDefaultPythonPlatform(host, console2);
|
|
14484
|
-
this.typeshedPath = void 0;
|
|
14485
14487
|
if (configObj.typeshedPath !== void 0) {
|
|
14486
14488
|
if (typeof configObj.typeshedPath !== "string") {
|
|
14487
14489
|
console2.error(`Config "typeshedPath" field must contain a string.`);
|
|
14488
14490
|
} else {
|
|
14489
|
-
this.typeshedPath = configObj.typeshedPath ?
|
|
14491
|
+
this.typeshedPath = configObj.typeshedPath ? configDirUri.resolvePaths(configObj.typeshedPath) : void 0;
|
|
14490
14492
|
}
|
|
14491
14493
|
}
|
|
14492
|
-
this.stubPath = void 0;
|
|
14493
14494
|
if (configObj.typingsPath !== void 0) {
|
|
14494
14495
|
if (typeof configObj.typingsPath !== "string") {
|
|
14495
14496
|
console2.error(`Config "typingsPath" field must contain a string.`);
|
|
14496
14497
|
} else {
|
|
14497
14498
|
console2.error(`Config "typingsPath" is now deprecated. Please, use stubPath instead.`);
|
|
14498
|
-
this.stubPath =
|
|
14499
|
+
this.stubPath = configDirUri.resolvePaths(configObj.typingsPath);
|
|
14499
14500
|
}
|
|
14500
14501
|
}
|
|
14501
14502
|
if (configObj.stubPath !== void 0) {
|
|
14502
14503
|
if (typeof configObj.stubPath !== "string") {
|
|
14503
14504
|
console2.error(`Config "stubPath" field must contain a string.`);
|
|
14504
14505
|
} else {
|
|
14505
|
-
this.stubPath =
|
|
14506
|
+
this.stubPath = configDirUri.resolvePaths(configObj.stubPath);
|
|
14506
14507
|
}
|
|
14507
14508
|
}
|
|
14508
14509
|
if (configObj.verboseOutput !== void 0) {
|
|
@@ -14535,14 +14536,14 @@ var require_configOptions = __commonJS({
|
|
|
14535
14536
|
this.useLibraryCodeForTypes = configObj.useLibraryCodeForTypes;
|
|
14536
14537
|
}
|
|
14537
14538
|
}
|
|
14538
|
-
this.executionEnvironments = [];
|
|
14539
14539
|
if (configObj.executionEnvironments !== void 0) {
|
|
14540
14540
|
if (!Array.isArray(configObj.executionEnvironments)) {
|
|
14541
14541
|
console2.error(`Config "executionEnvironments" field must contain an array.`);
|
|
14542
14542
|
} else {
|
|
14543
|
+
this.executionEnvironments = [];
|
|
14543
14544
|
const execEnvironments = configObj.executionEnvironments;
|
|
14544
14545
|
execEnvironments.forEach((env, index) => {
|
|
14545
|
-
const execEnv = this._initExecutionEnvironmentFromJson(env, index, console2, commandLineOptions);
|
|
14546
|
+
const execEnv = this._initExecutionEnvironmentFromJson(env, configDirUri, index, console2, commandLineOptions);
|
|
14546
14547
|
if (execEnv) {
|
|
14547
14548
|
this.executionEnvironments.push(execEnv);
|
|
14548
14549
|
}
|
|
@@ -14587,6 +14588,16 @@ var require_configOptions = __commonJS({
|
|
|
14587
14588
|
}
|
|
14588
14589
|
}
|
|
14589
14590
|
}
|
|
14591
|
+
static resolveExtends(configObj, configDirUri) {
|
|
14592
|
+
if (configObj.extends !== void 0) {
|
|
14593
|
+
if (typeof configObj.extends !== "string") {
|
|
14594
|
+
console.error(`Config "extends" field must contain a string.`);
|
|
14595
|
+
} else {
|
|
14596
|
+
return configDirUri.resolvePaths(configObj.extends);
|
|
14597
|
+
}
|
|
14598
|
+
}
|
|
14599
|
+
return void 0;
|
|
14600
|
+
}
|
|
14590
14601
|
ensureDefaultPythonPlatform(host, console2) {
|
|
14591
14602
|
if (this.defaultPythonPlatform !== void 0) {
|
|
14592
14603
|
return;
|
|
@@ -14667,11 +14678,11 @@ var require_configOptions = __commonJS({
|
|
|
14667
14678
|
console.log(`Config "${fieldName}" entry must be true, false, "error", "warning", "information" or "none".`);
|
|
14668
14679
|
return defaultValue;
|
|
14669
14680
|
}
|
|
14670
|
-
_initExecutionEnvironmentFromJson(envObj, index, console2, commandLineOptions) {
|
|
14681
|
+
_initExecutionEnvironmentFromJson(envObj, configDirUri, index, console2, commandLineOptions) {
|
|
14671
14682
|
try {
|
|
14672
|
-
const newExecEnv = new ExecutionEnvironment(this._getEnvironmentName(),
|
|
14683
|
+
const newExecEnv = new ExecutionEnvironment(this._getEnvironmentName(), configDirUri, this.defaultPythonVersion, this.defaultPythonPlatform, this.defaultExtraPaths);
|
|
14673
14684
|
if (envObj.root && typeof envObj.root === "string") {
|
|
14674
|
-
newExecEnv.root =
|
|
14685
|
+
newExecEnv.root = configDirUri.resolvePaths(envObj.root);
|
|
14675
14686
|
} else {
|
|
14676
14687
|
console2.error(`Config executionEnvironments index ${index}: missing root value.`);
|
|
14677
14688
|
}
|
|
@@ -14684,7 +14695,7 @@ var require_configOptions = __commonJS({
|
|
|
14684
14695
|
if (typeof path12 !== "string") {
|
|
14685
14696
|
console2.error(`Config executionEnvironments index ${index}: extraPaths field ${pathIndex} must be a string.`);
|
|
14686
14697
|
} else {
|
|
14687
|
-
newExecEnv.extraPaths.push(
|
|
14698
|
+
newExecEnv.extraPaths.push(configDirUri.resolvePaths(path12));
|
|
14688
14699
|
}
|
|
14689
14700
|
});
|
|
14690
14701
|
}
|
|
@@ -15471,7 +15482,6 @@ var require_package_nls_cs = __commonJS({
|
|
|
15471
15482
|
paramSpecFirstArg: "O\u010Dek\xE1val se n\xE1zev parametru ParamSpec jako prvn\xED argument",
|
|
15472
15483
|
paramSpecKwargsUsage: "Atribut kwargs ParamSpec je platn\xFD jenom v p\u0159\xEDpad\u011B, \u017Ee se pou\u017E\xEDv\xE1 s parametrem **kwargs.",
|
|
15473
15484
|
paramSpecNotUsedByOuterScope: "Parametr ParamSpec {name} nem\xE1 v tomto kontextu \u017E\xE1dn\xFD v\xFDznam",
|
|
15474
|
-
paramSpecScopedToReturnType: "Parametr ParamSpec {name} je vymezen\xFD na volatelnou prom\u011Bnnou v r\xE1mci n\xE1vratov\xE9ho typu a ned\xE1 se na n\u011Bj odkazovat v t\u011Ble funkce jazyka",
|
|
15475
15485
|
paramSpecUnknownArg: "Parametr ParamSpec nepodporuje v\xEDce ne\u017E jeden argument",
|
|
15476
15486
|
paramSpecUnknownMember: "{name} nen\xED zn\xE1m\xFD atribut ParamSpec.",
|
|
15477
15487
|
paramSpecUnknownParam: "\u201E{name}\u201C je nezn\xE1m\xFD parametr parametru ParamSpec",
|
|
@@ -15623,7 +15633,6 @@ var require_package_nls_cs = __commonJS({
|
|
|
15623
15633
|
typeVarNotSubscriptable: "TypeVar {type} nen\xED mo\u017En\xE9 zadat jako doln\xED index",
|
|
15624
15634
|
typeVarNotUsedByOuterScope: "Prom\u011Bnn\xE1 typu {name} nem\xE1 v tomto kontextu \u017E\xE1dn\xFD v\xFDznam",
|
|
15625
15635
|
typeVarPossiblyUnsolvable: "Prom\u011Bnn\xE1 typu \u201E{name}\u201C m\u016F\u017Ee b\xFDt nevy\u0159e\u0161en\xE1, pokud volaj\xEDc\xED nezad\xE1 \u017E\xE1dn\xFD argument pro parametr \u201E{param}\u201C",
|
|
15626
|
-
typeVarScopedToReturnType: "Prom\u011Bnn\xE1 typu \u201E{name}\u201C je vymezen\xE1 na volatelnou prom\u011Bnnou v r\xE1mci n\xE1vratov\xE9ho typu a ned\xE1 se na to odkazovat v t\u011Ble funkce",
|
|
15627
15636
|
typeVarSingleConstraint: "TypeVar mus\xED m\xEDt alespo\u0148 dva omezen\xE9 typy",
|
|
15628
15637
|
typeVarTupleConstraints: "TypeVarTuple nem\u016F\u017Ee m\xEDt omezen\xED hodnoty",
|
|
15629
15638
|
typeVarTupleContext: "TypeVarTuple se v tomto kontextu nepovoluje",
|
|
@@ -15694,7 +15703,7 @@ var require_package_nls_cs = __commonJS({
|
|
|
15694
15703
|
unpackNotAllowed: "Rozbalen\xED se v tomto kontextu nepovoluje",
|
|
15695
15704
|
unpackOperatorNotAllowed: "Operace rozbalen\xED nen\xED v tomto kontextu povolen\xE1",
|
|
15696
15705
|
unpackTuplesIllegal: "Operace rozbalen\xED nen\xED povolen\xE1 v \u0159azen\xFDch kolekc\xEDch \u010Dlen\u016F p\u0159ed Pythonem 3.8",
|
|
15697
|
-
unpackedArgInTypeArgument: "
|
|
15706
|
+
unpackedArgInTypeArgument: "V tomto kontextu nelze pou\u017E\xEDt rozbalen\xE9 argumenty.",
|
|
15698
15707
|
unpackedArgWithVariadicParam: "Pro parametr TypeVarTuple nejde pou\u017E\xEDt rozbalen\xFD argument",
|
|
15699
15708
|
unpackedDictArgumentNotMapping: "V\xFDraz argumentu za ** mus\xED b\xFDt mapov\xE1n\xED s typem kl\xED\u010De str",
|
|
15700
15709
|
unpackedDictSubscriptIllegal: "Oper\xE1tor rozbalen\xED slovn\xEDku v doln\xEDm indexu nen\xED povolen\xFD",
|
|
@@ -16159,7 +16168,7 @@ var require_package_nls_de = __commonJS({
|
|
|
16159
16168
|
incompatibleMethodOverride: 'Die Methode "{name}" \xFCberschreibt die Klasse "{className}" auf inkompatible Weise.',
|
|
16160
16169
|
inconsistentIndent: "Der Betrag f\xFCr Nichteinzug stimmt nicht mit dem vorherigen Einzug \xFCberein.",
|
|
16161
16170
|
inconsistentTabs: "Inkonsistente Verwendung von Tabulatoren und Leerzeichen im Einzug.",
|
|
16162
|
-
initMethodSelfParamTypeVar:
|
|
16171
|
+
initMethodSelfParamTypeVar: 'Typ-Anmerkung f\xFCr "self"-Parameter der "__init__"-Methode kann keine klassen\xFCbergreifenden Typvariablen enthalten',
|
|
16163
16172
|
initMustReturnNone: 'Der R\xFCckgabetyp von "__init__" muss "None" sein.',
|
|
16164
16173
|
initSubclassCallFailed: "Falsche Schl\xFCsselwortargumente f\xFCr __init_subclass__ Methode.",
|
|
16165
16174
|
initSubclassClsParam: '__init_subclass__ Au\xDFerkraftsetzung sollte einen "cls"-Parameter annehmen.',
|
|
@@ -16281,7 +16290,6 @@ var require_package_nls_de = __commonJS({
|
|
|
16281
16290
|
paramSpecFirstArg: "Der Name von ParamSpec wurde als erstes Argument erwartet.",
|
|
16282
16291
|
paramSpecKwargsUsage: "Das Attribut \u201Ekwargs\u201C von ParamSpec ist nur g\xFCltig, wenn es mit dem Parameter \u201E*kwargs\u201C verwendet wird",
|
|
16283
16292
|
paramSpecNotUsedByOuterScope: 'ParamSpec "{name}" hat in diesem Kontext keine Bedeutung.',
|
|
16284
|
-
paramSpecScopedToReturnType: 'ParamSpec "{name}" ist auf einen Aufruf innerhalb des R\xFCckgabetyps beschr\xE4nkt und kann im Funktionstext nicht referenziert werden.',
|
|
16285
16293
|
paramSpecUnknownArg: "ParamSpec unterst\xFCtzt nur ein Argument.",
|
|
16286
16294
|
paramSpecUnknownMember: "\u201E{name}\u201C ist kein bekanntes Attribut von ParamSpec",
|
|
16287
16295
|
paramSpecUnknownParam: '"{name}" ist ein unbekannter Parameter f\xFCr ParamSpec.',
|
|
@@ -16433,7 +16441,6 @@ var require_package_nls_de = __commonJS({
|
|
|
16433
16441
|
typeVarNotSubscriptable: 'TypeVar "{type}" kann nicht tiefgestellt werden.',
|
|
16434
16442
|
typeVarNotUsedByOuterScope: 'Die Typvariable "{name}" hat in diesem Kontext keine Bedeutung.',
|
|
16435
16443
|
typeVarPossiblyUnsolvable: 'Die Typvariable "{name}" wird m\xF6glicherweise nicht aufgel\xF6st, wenn der Aufrufer kein Argument f\xFCr Parameter "{param}" bereitstellt',
|
|
16436
|
-
typeVarScopedToReturnType: 'Die Typvariable "{name}" ist auf einen Aufruf innerhalb des R\xFCckgabetyps beschr\xE4nkt und kann im Funktionstext nicht referenziert werden.',
|
|
16437
16444
|
typeVarSingleConstraint: "TypeVar muss mindestens zwei eingeschr\xE4nkte Typen aufweisen.",
|
|
16438
16445
|
typeVarTupleConstraints: "TypeVarTuple darf keine Werteinschr\xE4nkungen aufweisen.",
|
|
16439
16446
|
typeVarTupleContext: "TypeVarTuple ist in diesem Kontext nicht zul\xE4ssig.",
|
|
@@ -16504,7 +16511,7 @@ var require_package_nls_de = __commonJS({
|
|
|
16504
16511
|
unpackNotAllowed: '"Unpack" ist in diesem Kontext nicht zul\xE4ssig.',
|
|
16505
16512
|
unpackOperatorNotAllowed: "Der Entpackvorgang ist in diesem Kontext nicht zul\xE4ssig.",
|
|
16506
16513
|
unpackTuplesIllegal: "Der Entpackvorgang ist in Tupeln vor Python 3.8 nicht zul\xE4ssig.",
|
|
16507
|
-
unpackedArgInTypeArgument: "
|
|
16514
|
+
unpackedArgInTypeArgument: "Nicht gepackte Argumente k\xF6nnen in diesem Kontext nicht verwendet werden.",
|
|
16508
16515
|
unpackedArgWithVariadicParam: 'Das nicht gepackte Argument kann nicht f\xFCr den Parameter "TypeVarTuple" verwendet werden.',
|
|
16509
16516
|
unpackedDictArgumentNotMapping: 'Der Argumentausdruck nach ** muss eine Zuordnung mit dem Schl\xFCsseltyp "str" sein.',
|
|
16510
16517
|
unpackedDictSubscriptIllegal: "Der Operator zum Entpacken des W\xF6rterbuchs in tiefgestellten Zeichen ist nicht zul\xE4ssig.",
|
|
@@ -16857,6 +16864,8 @@ var require_package_nls_en_us = __commonJS({
|
|
|
16857
16864
|
ellipsisContext: '"..." is not allowed in this context',
|
|
16858
16865
|
ellipsisSecondArg: '"..." is allowed only as the second of two arguments',
|
|
16859
16866
|
enumClassOverride: 'Enum class "{name}" is final and cannot be subclassed',
|
|
16867
|
+
enumMemberDelete: 'Enum member "{name}" cannot be deleted',
|
|
16868
|
+
enumMemberSet: 'Enum member "{name}" cannot be assigned',
|
|
16860
16869
|
exceptionGroupIncompatible: 'Exception group syntax ("except*") requires Python 3.11 or newer',
|
|
16861
16870
|
exceptionTypeIncorrect: '"{type}" does not derive from BaseException',
|
|
16862
16871
|
exceptionTypeNotClass: '"{type}" is not a valid exception class',
|
|
@@ -16956,7 +16965,7 @@ var require_package_nls_en_us = __commonJS({
|
|
|
16956
16965
|
inconsistentIndent: "Unindent amount does not match previous indent",
|
|
16957
16966
|
initMustReturnNone: 'Return type of "__init__" must be None',
|
|
16958
16967
|
inconsistentTabs: "Inconsistent use of tabs and spaces in indentation",
|
|
16959
|
-
initMethodSelfParamTypeVar: 'Type annotation for "self" parameter of "__init__" method cannot contain class-scoped type
|
|
16968
|
+
initMethodSelfParamTypeVar: 'Type annotation for "self" parameter of "__init__" method cannot contain class-scoped type variables',
|
|
16960
16969
|
initSubclassClsParam: '__init_subclass__ override should take a "cls" parameter',
|
|
16961
16970
|
initSubclassCallFailed: "Incorrect keyword arguments for __init_subclass__ method",
|
|
16962
16971
|
initVarNotAllowed: '"InitVar" is not allowed in this context',
|
|
@@ -17076,7 +17085,6 @@ var require_package_nls_en_us = __commonJS({
|
|
|
17076
17085
|
paramSpecFirstArg: "Expected name of ParamSpec as first argument",
|
|
17077
17086
|
paramSpecKwargsUsage: '"kwargs" attribute of ParamSpec is valid only when used with **kwargs parameter',
|
|
17078
17087
|
paramSpecNotUsedByOuterScope: 'ParamSpec "{name}" has no meaning in this context',
|
|
17079
|
-
paramSpecScopedToReturnType: 'ParamSpec "{name}" is scoped to a callable within the return type and cannot be referenced in the function body',
|
|
17080
17088
|
paramSpecUnknownArg: "ParamSpec does not support more than one argument",
|
|
17081
17089
|
paramSpecUnknownMember: '"{name}" is not a known attribute of ParamSpec',
|
|
17082
17090
|
paramSpecUnknownParam: '"{name}" is unknown parameter to ParamSpec',
|
|
@@ -17250,7 +17258,6 @@ var require_package_nls_en_us = __commonJS({
|
|
|
17250
17258
|
typeVarNotSubscriptable: 'TypeVar "{type}" is not subscriptable',
|
|
17251
17259
|
typeVarNotUsedByOuterScope: 'Type variable "{name}" has no meaning in this context',
|
|
17252
17260
|
typeVarPossiblyUnsolvable: 'Type variable "{name}" may go unsolved if caller supplies no argument for parameter "{param}"',
|
|
17253
|
-
typeVarScopedToReturnType: 'Type variable "{name}" is scoped to a callable within the return type and cannot be referenced in the function body',
|
|
17254
17261
|
typeVarSingleConstraint: "TypeVar must have at least two constrained types",
|
|
17255
17262
|
typeVarsNotInGenericOrProtocol: "Generic[] or Protocol[] must include all type variables",
|
|
17256
17263
|
typeVarTupleContext: "TypeVarTuple is not allowed in this context",
|
|
@@ -17396,8 +17403,8 @@ var require_package_nls_en_us = __commonJS({
|
|
|
17396
17403
|
missingGetter: "Property getter method is missing",
|
|
17397
17404
|
missingSetter: "Property setter method is missing",
|
|
17398
17405
|
missingDeleter: "Property deleter method is missing",
|
|
17399
|
-
namedParamMissingInDest: '
|
|
17400
|
-
namedParamMissingInSource: '
|
|
17406
|
+
namedParamMissingInDest: 'Extra parameter "{name}"',
|
|
17407
|
+
namedParamMissingInSource: 'Missing keyword parameter "{name}"',
|
|
17401
17408
|
namedParamTypeMismatch: 'Keyword parameter "{name}" of type "{sourceType}" is incompatible with type "{destType}"',
|
|
17402
17409
|
namedTupleNotAllowed: "NamedTuple cannot be used for instance or class checks",
|
|
17403
17410
|
newMethodLocation: 'The __new__ method is defined in class "{type}"',
|
|
@@ -17779,7 +17786,7 @@ var require_package_nls_es = __commonJS({
|
|
|
17779
17786
|
incompatibleMethodOverride: 'El m\xE9todo "{name}" sobrescribe la clase "{className}" de forma incompatible',
|
|
17780
17787
|
inconsistentIndent: "La cantidad sin sangr\xEDa no coincide con la sangr\xEDa anterior",
|
|
17781
17788
|
inconsistentTabs: "Uso incoherente de tabuladores y espacios en la sangr\xEDa",
|
|
17782
|
-
initMethodSelfParamTypeVar: 'La anotaci\xF3n de tipo para el par\xE1metro "self" del m\xE9todo "__init__" no puede contener
|
|
17789
|
+
initMethodSelfParamTypeVar: 'La anotaci\xF3n de tipo para el par\xE1metro "self" del m\xE9todo "__init__" no puede contener variables de tipo con \xE1mbito de clase',
|
|
17783
17790
|
initMustReturnNone: 'El tipo de retorno de "__init__" debe ser None',
|
|
17784
17791
|
initSubclassCallFailed: "Argumentos de palabra clave incorrectos para el m\xE9todo __init_subclass__",
|
|
17785
17792
|
initSubclassClsParam: '__init_subclass__ debe tomar un par\xE1metro "cls"',
|
|
@@ -17901,7 +17908,6 @@ var require_package_nls_es = __commonJS({
|
|
|
17901
17908
|
paramSpecFirstArg: "Se esperaba el nombre de ParamSpec como primer argumento",
|
|
17902
17909
|
paramSpecKwargsUsage: 'El miembro "kwargs" de ParamSpec solo es v\xE1lido cuando se utiliza con el par\xE1metro **kwargs',
|
|
17903
17910
|
paramSpecNotUsedByOuterScope: 'ParamSpec "{name}" no tiene significado en este contexto',
|
|
17904
|
-
paramSpecScopedToReturnType: 'El \xE1mbito de ParamSpec "{name}" es un \xE1mbito al que se puede llamar dentro del tipo de valor devuelto y no se puede hacer referencia a \xE9l en el cuerpo de la funci\xF3n.',
|
|
17905
17911
|
paramSpecUnknownArg: "ParamSpec no admite m\xE1s de un argumento",
|
|
17906
17912
|
paramSpecUnknownMember: '"{name}" no es un atributo conocido de ParamSpec',
|
|
17907
17913
|
paramSpecUnknownParam: '"{name}" es un par\xE1metro desconocido para ParamSpec',
|
|
@@ -18053,7 +18059,6 @@ var require_package_nls_es = __commonJS({
|
|
|
18053
18059
|
typeVarNotSubscriptable: 'TypeVar "{type}" no es subscribible',
|
|
18054
18060
|
typeVarNotUsedByOuterScope: 'La variable de tipo "{name}" no tiene ning\xFAn significado en este contexto',
|
|
18055
18061
|
typeVarPossiblyUnsolvable: 'La variable de tipo "{name}" puede quedar sin resolver si el autor de la llamada no proporciona ning\xFAn argumento para el par\xE1metro "{param}"',
|
|
18056
|
-
typeVarScopedToReturnType: 'La variable de tipo "{name}" tiene como \xE1mbito una llamada dentro del tipo de valor devuelto y no se puede hacer referencia a ella en el cuerpo de la funci\xF3n.',
|
|
18057
18062
|
typeVarSingleConstraint: "TypeVar debe tener al menos dos tipos restringidos",
|
|
18058
18063
|
typeVarTupleConstraints: "TypeVarTuple no puede tener restricciones de valor",
|
|
18059
18064
|
typeVarTupleContext: "TypeVarTuple no est\xE1 permitido en este contexto",
|
|
@@ -18124,7 +18129,7 @@ var require_package_nls_es = __commonJS({
|
|
|
18124
18129
|
unpackNotAllowed: "El desempaquetado no est\xE1 permitido en este contexto",
|
|
18125
18130
|
unpackOperatorNotAllowed: "La operaci\xF3n de desempaquetado no est\xE1 permitida en este contexto",
|
|
18126
18131
|
unpackTuplesIllegal: "Operaci\xF3n de desempaquetado no permitida en tuplas anteriores a Python 3.8",
|
|
18127
|
-
unpackedArgInTypeArgument: "
|
|
18132
|
+
unpackedArgInTypeArgument: "No se pueden usar argumentos sin empaquetar en este contexto",
|
|
18128
18133
|
unpackedArgWithVariadicParam: "No se puede usar un argumento desempaquetado para el par\xE1metro TypeVarTuple",
|
|
18129
18134
|
unpackedDictArgumentNotMapping: 'La expresi\xF3n del argumento despu\xE9s de ** debe ser un mapeo con un tipo de clave "str".',
|
|
18130
18135
|
unpackedDictSubscriptIllegal: "El operador de desempaquetado del diccionario en el sub\xEDndice no est\xE1 permitido",
|
|
@@ -18589,7 +18594,7 @@ var require_package_nls_fr = __commonJS({
|
|
|
18589
18594
|
incompatibleMethodOverride: "La m\xE9thode \xAB\xA0{name}\xA0\xBB remplace la classe \xAB\xA0{className}\xA0\xBB de mani\xE8re incompatible",
|
|
18590
18595
|
inconsistentIndent: "Le montant du retrait ne correspond pas au retrait pr\xE9c\xE9dent",
|
|
18591
18596
|
inconsistentTabs: "Utilisation incoh\xE9rente des onglets et des espaces dans la mise en retrait",
|
|
18592
|
-
initMethodSelfParamTypeVar: "L\u2019annotation de type pour le param\xE8tre \xAB\
|
|
18597
|
+
initMethodSelfParamTypeVar: "L\u2019annotation de type pour le param\xE8tre \xAB self \xBB de la m\xE9thode \xAB __init__ \xBB ne peut pas contenir de variables de type de port\xE9e de classe",
|
|
18593
18598
|
initMustReturnNone: "Le type de retour de \xAB __init__ \xBB doit \xEAtre None",
|
|
18594
18599
|
initSubclassCallFailed: "Arguments de mot cl\xE9 incorrects pour la m\xE9thode __init_subclass__",
|
|
18595
18600
|
initSubclassClsParam: "__init_subclass__ remplacement doit prendre un param\xE8tre \xAB cls \xBB",
|
|
@@ -18711,7 +18716,6 @@ var require_package_nls_fr = __commonJS({
|
|
|
18711
18716
|
paramSpecFirstArg: "Nom attendu de ParamSpec comme premier argument",
|
|
18712
18717
|
paramSpecKwargsUsage: "L\u2019attribut \xAB\xA0kwargs\xA0\xBB de ParamSpec n\u2019est valide que lorsqu\u2019il est utilis\xE9 avec le param\xE8tre **kwargs",
|
|
18713
18718
|
paramSpecNotUsedByOuterScope: "ParamSpec \xAB\xA0{name}\xA0\xBB n\u2019a aucune signification dans ce contexte",
|
|
18714
|
-
paramSpecScopedToReturnType: 'ParamSpec "{name}" est limit\xE9 \xE0 un appelable dans le type de retour et ne peut pas \xEAtre r\xE9f\xE9renc\xE9 dans le corps de la fonction',
|
|
18715
18719
|
paramSpecUnknownArg: "ParamSpec ne prend pas en charge plus d'un argument",
|
|
18716
18720
|
paramSpecUnknownMember: "\xAB\xA0{name}\xA0\xBB n\u2019est pas un attribut connu de ParamSpec",
|
|
18717
18721
|
paramSpecUnknownParam: '"{name}" est un param\xE8tre inconnu pour ParamSpec',
|
|
@@ -18863,7 +18867,6 @@ var require_package_nls_fr = __commonJS({
|
|
|
18863
18867
|
typeVarNotSubscriptable: "TypeVar \xAB\xA0{type}\xA0\xBB n\u2019est pas subscriptible",
|
|
18864
18868
|
typeVarNotUsedByOuterScope: "La variable de type \xAB\xA0{name}\xA0\xBB n\u2019a aucune signification dans ce contexte",
|
|
18865
18869
|
typeVarPossiblyUnsolvable: `La variable de type "{name}" peut rester non r\xE9solue si l'appelant ne fournit aucun argument pour le param\xE8tre "{param}"`,
|
|
18866
|
-
typeVarScopedToReturnType: 'La variable de type "{name}" est limit\xE9e \xE0 un appelable dans le type de retour et ne peut pas \xEAtre r\xE9f\xE9renc\xE9e dans le corps de la fonction',
|
|
18867
18870
|
typeVarSingleConstraint: "TypeVar doit avoir au moins deux types contraints",
|
|
18868
18871
|
typeVarTupleConstraints: "TypeVarTuple ne peut pas avoir de contraintes de valeur",
|
|
18869
18872
|
typeVarTupleContext: "TypeVarTuple n\u2019est pas autoris\xE9 dans ce contexte",
|
|
@@ -18934,7 +18937,7 @@ var require_package_nls_fr = __commonJS({
|
|
|
18934
18937
|
unpackNotAllowed: "Le d\xE9compression n\u2019est pas autoris\xE9 dans ce contexte",
|
|
18935
18938
|
unpackOperatorNotAllowed: "L\u2019op\xE9ration de d\xE9compression n\u2019est pas autoris\xE9e dans ce contexte",
|
|
18936
18939
|
unpackTuplesIllegal: "Op\xE9ration de d\xE9compression non autoris\xE9e dans les tuples avant Python 3.8",
|
|
18937
|
-
unpackedArgInTypeArgument: "Les arguments d\xE9compress\xE9s ne peuvent pas \xEAtre utilis\xE9s dans
|
|
18940
|
+
unpackedArgInTypeArgument: "Les arguments d\xE9compress\xE9s ne peuvent pas \xEAtre utilis\xE9s dans ce contexte",
|
|
18938
18941
|
unpackedArgWithVariadicParam: "L'argument d\xE9compress\xE9 ne peut pas \xEAtre utilis\xE9 pour le param\xE8tre TypeVarTuple",
|
|
18939
18942
|
unpackedDictArgumentNotMapping: "L\u2019expression d\u2019argument apr\xE8s ** doit \xEAtre un mappage avec un type de cl\xE9 \xAB\xA0str\xA0\xBB",
|
|
18940
18943
|
unpackedDictSubscriptIllegal: "L\u2019op\xE9rateur de d\xE9compression de dictionnaire dans l\u2019indice n\u2019est pas autoris\xE9",
|
|
@@ -19521,7 +19524,6 @@ var require_package_nls_it = __commonJS({
|
|
|
19521
19524
|
paramSpecFirstArg: "Nome previsto di ParamSpec come primo argomento",
|
|
19522
19525
|
paramSpecKwargsUsage: `L'attributo "kwargs" di ParamSpec \xE8 valido solo se usato con il parametro *kwargs`,
|
|
19523
19526
|
paramSpecNotUsedByOuterScope: 'ParamSpec "{name}" non ha significato in questo contesto',
|
|
19524
|
-
paramSpecScopedToReturnType: `L\u2019ambito ParamSpec "{name}" \xE8 un elemento richiamabile all'interno del tipo restituito e non pu\xF2 essere usato come riferimento nel corpo della funzione`,
|
|
19525
19527
|
paramSpecUnknownArg: "ParamSpec non supporta pi\xF9 di un argomento",
|
|
19526
19528
|
paramSpecUnknownMember: '"{name}" non \xE8 un attributo noto di ParamSpec',
|
|
19527
19529
|
paramSpecUnknownParam: '"{name}" \xE8 un parametro sconosciuto per ParamSpec',
|
|
@@ -19673,7 +19675,6 @@ var require_package_nls_it = __commonJS({
|
|
|
19673
19675
|
typeVarNotSubscriptable: 'TypeVar "{type}" non sottoponibile a script',
|
|
19674
19676
|
typeVarNotUsedByOuterScope: 'La variabile di tipo "{name}" non ha significato in questo contesto',
|
|
19675
19677
|
typeVarPossiblyUnsolvable: 'La variabile di tipo "{name}" potrebbe non essere risolta se il chiamante non fornisce alcun argomento per il parametro "{param}"',
|
|
19676
|
-
typeVarScopedToReturnType: `La variabile di tipo "{name}" ha come ambito un elemento richiamabile all'interno del tipo restituito e non pu\xF2 essere usato come riferimento nel corpo della funzione`,
|
|
19677
19678
|
typeVarSingleConstraint: "TypeVar deve contenere almeno due tipi vincolati",
|
|
19678
19679
|
typeVarTupleConstraints: "TypeVarTuple non pu\xF2 avere vincoli di valore",
|
|
19679
19680
|
typeVarTupleContext: "TypeVarTuple non \xE8 consentito in questo contesto",
|
|
@@ -19744,7 +19745,7 @@ var require_package_nls_it = __commonJS({
|
|
|
19744
19745
|
unpackNotAllowed: "La decompressione non \xE8 consentita in questo contesto",
|
|
19745
19746
|
unpackOperatorNotAllowed: "L\u2019operazione di decompressione non \xE8 consentita in questo contesto",
|
|
19746
19747
|
unpackTuplesIllegal: "L'operazione di decompressione non \xE8 consentita nelle tuple precedenti a Python 3.8",
|
|
19747
|
-
unpackedArgInTypeArgument: "
|
|
19748
|
+
unpackedArgInTypeArgument: "Non \xE8 possibile usare argomenti decompressi in questo contesto",
|
|
19748
19749
|
unpackedArgWithVariadicParam: "Non \xE8 possibile usare l'argomento decompresso per il parametro TypeVarTuple",
|
|
19749
19750
|
unpackedDictArgumentNotMapping: `L'espressione dell'argomento dopo ** deve essere un mapping con un tipo di chiave "str"`,
|
|
19750
19751
|
unpackedDictSubscriptIllegal: "L'operatore di decompressione del dizionario nel pedice non \xE8 consentito",
|
|
@@ -20209,7 +20210,7 @@ var require_package_nls_ja = __commonJS({
|
|
|
20209
20210
|
incompatibleMethodOverride: '\u30E1\u30BD\u30C3\u30C9 "{name}" \u306F\u4E92\u63DB\u6027\u306E\u306A\u3044\u65B9\u6CD5\u3067\u30AF\u30E9\u30B9 "{className}" \u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u307E\u3059',
|
|
20210
20211
|
inconsistentIndent: "\u5143\u306E\u30B5\u30A4\u30BA\u304C\u524D\u306E\u30A4\u30F3\u30C7\u30F3\u30C8\u3068\u4E00\u81F4\u3057\u307E\u305B\u3093",
|
|
20211
20212
|
inconsistentTabs: "\u30A4\u30F3\u30C7\u30F3\u30C8\u3067\u306E\u30BF\u30D6\u3068\u30B9\u30DA\u30FC\u30B9\u306E\u4E00\u8CAB\u6027\u306E\u306A\u3044\u4F7F\u7528",
|
|
20212
|
-
initMethodSelfParamTypeVar: '"__init__" \u30E1\u30BD\u30C3\u30C9\u306E "self" \u30D1\u30E9\u30E1\u30FC\u30BF\u30FC\u306E\u578B\u6CE8\u91C8\u306B\u30AF\u30E9\u30B9 \u30B9\u30B3\u30FC\u30D7\u578B\u306E\u5909\u6570\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093',
|
|
20213
|
+
initMethodSelfParamTypeVar: '"__init__" \u30E1\u30BD\u30C3\u30C9\u306E "self" \u30D1\u30E9\u30E1\u30FC\u30BF\u30FC\u306E\u578B\u6CE8\u91C8\u306B\u3001\u30AF\u30E9\u30B9 \u30B9\u30B3\u30FC\u30D7\u578B\u306E\u5909\u6570\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093',
|
|
20213
20214
|
initMustReturnNone: '"__init__" \u306E\u623B\u308A\u5024\u306E\u578B\u306F None \u3067\u306A\u3051\u308C\u3070\u306A\u308A\u307E\u305B\u3093',
|
|
20214
20215
|
initSubclassCallFailed: "__init_subclass__ \u30E1\u30BD\u30C3\u30C9\u306E\u30AD\u30FC\u30EF\u30FC\u30C9\u5F15\u6570\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093",
|
|
20215
20216
|
initSubclassClsParam: '__class_getitem__ override \u306F "cls" \u30D1\u30E9\u30E1\u30FC\u30BF\u30FC\u3092\u53D7\u3051\u53D6\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059',
|
|
@@ -20331,7 +20332,6 @@ var require_package_nls_ja = __commonJS({
|
|
|
20331
20332
|
paramSpecFirstArg: "\u6700\u521D\u306E\u5F15\u6570\u3068\u3057\u3066 ParamSpec \u306E\u540D\u524D\u304C\u5FC5\u8981\u3067\u3059",
|
|
20332
20333
|
paramSpecKwargsUsage: 'ParamSpec \u306E "kwargs" \u5C5E\u6027\u306F\u3001**kwargs \u30D1\u30E9\u30E1\u30FC\u30BF\u30FC\u3068\u5171\u306B\u4F7F\u7528\u3059\u308B\u5834\u5408\u306B\u306E\u307F\u6709\u52B9\u3067\u3059',
|
|
20333
20334
|
paramSpecNotUsedByOuterScope: 'ParamSpec "{name}" \u306F\u3053\u306E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3067\u306F\u610F\u5473\u304C\u3042\u308A\u307E\u305B\u3093',
|
|
20334
|
-
paramSpecScopedToReturnType: 'ParamSpec "{name}" \u306F\u3001\u623B\u308A\u5024\u306E\u578B\u5185\u306E\u547C\u3073\u51FA\u3057\u53EF\u80FD\u306A\u30B9\u30B3\u30FC\u30D7\u3067\u3042\u308A\u3001\u95A2\u6570\u672C\u4F53\u3067\u306F\u53C2\u7167\u3067\u304D\u307E\u305B\u3093',
|
|
20335
20335
|
paramSpecUnknownArg: "ParamSpec \u306F\u8907\u6570\u306E\u5F15\u6570\u3092\u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u307E\u305B\u3093",
|
|
20336
20336
|
paramSpecUnknownMember: '"{name}" \u306F ParamSpec \u306E\u65E2\u77E5\u306E\u5C5E\u6027\u3067\u306F\u3042\u308A\u307E\u305B\u3093',
|
|
20337
20337
|
paramSpecUnknownParam: '"{name}" \u306F ParamSpec \u306B\u5BFE\u3059\u308B\u4E0D\u660E\u306A\u30D1\u30E9\u30E1\u30FC\u30BF\u30FC\u3067\u3059',
|
|
@@ -20483,7 +20483,6 @@ var require_package_nls_ja = __commonJS({
|
|
|
20483
20483
|
typeVarNotSubscriptable: 'TypeVar "{type}" \u306F\u6DFB\u5B57\u53EF\u80FD\u3067\u306F\u3042\u308A\u307E\u305B\u3093',
|
|
20484
20484
|
typeVarNotUsedByOuterScope: '\u578B\u5909\u6570 "{name}" \u306F\u3001\u3053\u306E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3067\u306F\u610F\u5473\u304C\u3042\u308A\u307E\u305B\u3093',
|
|
20485
20485
|
typeVarPossiblyUnsolvable: '\u547C\u3073\u51FA\u3057\u5143\u304C\u30D1\u30E9\u30E1\u30FC\u30BF\u30FC "{param}" \u306B\u5F15\u6570\u3092\u6307\u5B9A\u3057\u306A\u3044\u5834\u5408\u3001\u578B\u5909\u6570 "{name}" \u306F\u89E3\u6C7A\u3055\u308C\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059',
|
|
20486
|
-
typeVarScopedToReturnType: '\u578B\u5909\u6570 "{name}" \u306E\u30B9\u30B3\u30FC\u30D7\u306F\u623B\u308A\u5024\u306E\u578B\u5185\u306E\u547C\u3073\u51FA\u3057\u53EF\u80FD\u306A\u5909\u6570\u3067\u3042\u308A\u3001\u95A2\u6570\u672C\u4F53\u3067\u306F\u53C2\u7167\u3067\u304D\u307E\u305B\u3093',
|
|
20487
20486
|
typeVarSingleConstraint: "TypeVar \u306B\u306F\u5C11\u306A\u304F\u3068\u3082 2 \u3064\u306E\u5236\u7D04\u4ED8\u304D\u578B\u304C\u5FC5\u8981\u3067\u3059",
|
|
20488
20487
|
typeVarTupleConstraints: "TypeVarTuple \u306B\u5024\u5236\u7D04\u3092\u6301\u305F\u305B\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093",
|
|
20489
20488
|
typeVarTupleContext: "TypeVarTuple \u306F\u3053\u306E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3067\u306F\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093",
|
|
@@ -20554,7 +20553,7 @@ var require_package_nls_ja = __commonJS({
|
|
|
20554
20553
|
unpackNotAllowed: "\u30A2\u30F3\u30D1\u30C3\u30AF\u306F\u3053\u306E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3067\u306F\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093",
|
|
20555
20554
|
unpackOperatorNotAllowed: "\u3053\u306E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3067\u306F\u30A2\u30F3\u30D1\u30C3\u30AF\u64CD\u4F5C\u306F\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093",
|
|
20556
20555
|
unpackTuplesIllegal: "Python 3.8 \u3088\u308A\u524D\u306E\u30BF\u30D7\u30EB\u3067\u306F\u30A2\u30F3\u30D1\u30C3\u30AF\u64CD\u4F5C\u306F\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093",
|
|
20557
|
-
unpackedArgInTypeArgument: "\u30A2\u30F3\u30D1\u30C3\u30AF\u3055\u308C\u305F\u5F15\u6570\u306F\u3001\
|
|
20556
|
+
unpackedArgInTypeArgument: "\u30A2\u30F3\u30D1\u30C3\u30AF\u3055\u308C\u305F\u5F15\u6570\u306F\u3001\u3053\u306E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3067\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093",
|
|
20558
20557
|
unpackedArgWithVariadicParam: "\u30A2\u30F3\u30D1\u30C3\u30AF\u3055\u308C\u305F\u5F15\u6570\u306F TypeVarTuple \u30D1\u30E9\u30E1\u30FC\u30BF\u30FC\u306B\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093",
|
|
20559
20558
|
unpackedDictArgumentNotMapping: '** \u306E\u5F8C\u306E\u5F15\u6570\u5F0F\u306F\u3001"str" \u30AD\u30FC\u578B\u306E\u30DE\u30C3\u30D4\u30F3\u30B0\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059',
|
|
20560
20559
|
unpackedDictSubscriptIllegal: "\u4E0B\u4ED8\u304D\u6587\u5B57\u306E\u8F9E\u66F8\u30A2\u30F3\u30D1\u30C3\u30AF\u6F14\u7B97\u5B50\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093",
|
|
@@ -21019,7 +21018,7 @@ var require_package_nls_ko = __commonJS({
|
|
|
21019
21018
|
incompatibleMethodOverride: '"{name}" \uBA54\uC11C\uB4DC\uAC00 \uD638\uD658\uB418\uC9C0 \uC54A\uB294 \uBC29\uC2DD\uC73C\uB85C "{className}" \uD074\uB798\uC2A4\uB97C \uC7AC\uC815\uC758\uD569\uB2C8\uB2E4.',
|
|
21020
21019
|
inconsistentIndent: "\uB4E4\uC5EC\uC4F0\uAE30\uD558\uC9C0 \uC54A\uC740 \uC591\uC774 \uC774\uC804 \uB4E4\uC5EC\uC4F0\uAE30\uC640 \uC77C\uCE58\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.",
|
|
21021
21020
|
inconsistentTabs: "\uB4E4\uC5EC\uC4F0\uAE30\uC5D0\uC11C \uD0ED \uBC0F \uACF5\uBC31\uC758 \uC77C\uAD00\uC131 \uC5C6\uB294 \uC0AC\uC6A9",
|
|
21022
|
-
initMethodSelfParamTypeVar: '"__init__" \uBA54\uC11C\uB4DC\uC758 "self" \uB9E4\uAC1C \uBCC0\uC218\uC758 \uD615\uC2DD \uC8FC\uC11D\uC5D0\uB294 \uD074\uB798\uC2A4 \uBC94\uC704 \uD615\uC2DD
|
|
21021
|
+
initMethodSelfParamTypeVar: '"__init__" \uBA54\uC11C\uB4DC\uC758 "self" \uB9E4\uAC1C \uBCC0\uC218\uC758 \uD615\uC2DD \uC8FC\uC11D\uC5D0\uB294 \uD074\uB798\uC2A4 \uBC94\uC704 \uD615\uC2DD variable\uC744 \uD3EC\uD568\uD560 \uC218 \uC5C6\uC74C',
|
|
21023
21022
|
initMustReturnNone: '"__init__"\uC758 \uBC18\uD658 \uD615\uC2DD\uC740 None\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.',
|
|
21024
21023
|
initSubclassCallFailed: "__init_subclass__ \uBA54\uC11C\uB4DC\uC758 \uD0A4\uC6CC\uB4DC \uC778\uC218\uAC00 \uC798\uBABB\uB428",
|
|
21025
21024
|
initSubclassClsParam: '__init_subclass__ \uC7AC\uC815\uC758\uB294 "cls" \uB9E4\uAC1C \uBCC0\uC218\uB97C \uC0AC\uC6A9\uD574\uC57C \uD569\uB2C8\uB2E4.',
|
|
@@ -21141,7 +21140,6 @@ var require_package_nls_ko = __commonJS({
|
|
|
21141
21140
|
paramSpecFirstArg: "\uCCAB \uBC88\uC9F8 \uC778\uC218\uB85C ParamSpec\uC758 \uC774\uB984\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.",
|
|
21142
21141
|
paramSpecKwargsUsage: 'ParamSpec\uC758 "kwargs" \uD2B9\uC131\uC740 *kwargs \uB9E4\uAC1C \uBCC0\uC218\uC640 \uD568\uAED8 \uC0AC\uC6A9\uD560 \uACBD\uC6B0\uC5D0\uB9CC \uC720\uD6A8\uD568',
|
|
21143
21142
|
paramSpecNotUsedByOuterScope: 'ParamSpec "{name}"\uC740(\uB294) \uC774 \uCEE8\uD14D\uC2A4\uD2B8\uC5D0\uC11C \uC758\uBBF8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.',
|
|
21144
|
-
paramSpecScopedToReturnType: "ParamSpec \u2018{name}\u2019\uC740 \uBC18\uD658 \uD615\uC2DD \uB0B4\uC5D0\uC11C \uD638\uCD9C \uAC00\uB2A5\uC73C\uB85C \uBC94\uC704\uAC00 \uC9C0\uC815\uB418\uBA70 \uD568\uC218 \uBCF8\uBB38\uC5D0\uC11C \uCC38\uC870\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",
|
|
21145
21143
|
paramSpecUnknownArg: "ParamSpec\uC740 \uD55C \uAC1C \uC774\uC0C1\uC758 \uC778\uC218\uB97C \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.",
|
|
21146
21144
|
paramSpecUnknownMember: '"{name}"\uC740(\uB294) ParamSpec\uC758 \uC54C\uB824\uC9C4 \uD2B9\uC131\uC774 \uC544\uB2D8',
|
|
21147
21145
|
paramSpecUnknownParam: "\u2018{name}\u2019\uC740(\uB294) ParamSpec\uC5D0 \uB300\uD55C \uC54C \uC218 \uC5C6\uB294 \uB9E4\uAC1C \uBCC0\uC218\uC785\uB2C8\uB2E4.",
|
|
@@ -21293,7 +21291,6 @@ var require_package_nls_ko = __commonJS({
|
|
|
21293
21291
|
typeVarNotSubscriptable: 'TypeVar "{type}"\uC744(\uB97C) \uCCA8\uC790\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.',
|
|
21294
21292
|
typeVarNotUsedByOuterScope: '\uD615\uC2DD \uBCC0\uC218 "{name}"\uC740(\uB294) \uC774 \uCEE8\uD14D\uC2A4\uD2B8\uC5D0\uC11C \uC758\uBBF8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.',
|
|
21295
21293
|
typeVarPossiblyUnsolvable: "\uD638\uCD9C\uC790\uAC00 \u2018{param}\u2019 \uB9E4\uAC1C \uBCC0\uC218\uC5D0 \uB300\uD55C \uC778\uC218\uB97C \uC81C\uACF5\uD558\uC9C0 \uC54A\uC73C\uBA74 \u2018{name}\u2019 \uD615\uC2DD \uBCC0\uC218\uAC00 \uD655\uC778\uB418\uC9C0 \uC54A\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4.",
|
|
21296
|
-
typeVarScopedToReturnType: "\u2018{name}\u2019 \uD615\uC2DD \uBCC0\uC218\uB294 \uBC18\uD658 \uD615\uC2DD \uB0B4\uC5D0\uC11C \uD638\uCD9C \uAC00\uB2A5\uC73C\uB85C \uBC94\uC704\uAC00 \uC9C0\uC815\uB418\uBA70 \uD568\uC218 \uBCF8\uBB38\uC5D0\uC11C \uCC38\uC870\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",
|
|
21297
21294
|
typeVarSingleConstraint: "TypeVar\uC5D0\uB294 \uB450 \uAC1C \uC774\uC0C1\uC758 \uC81C\uD55C\uB41C \uD615\uC2DD\uC774 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4.",
|
|
21298
21295
|
typeVarTupleConstraints: "TypeVarTuple\uC5D0\uB294 \uAC12 \uC81C\uC57D \uC870\uAC74\uC774 \uC788\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",
|
|
21299
21296
|
typeVarTupleContext: "TypeVarTuple\uC740 \uC774 \uCEE8\uD14D\uC2A4\uD2B8\uC5D0\uC11C \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.",
|
|
@@ -21364,7 +21361,7 @@ var require_package_nls_ko = __commonJS({
|
|
|
21364
21361
|
unpackNotAllowed: "\uC774 \uCEE8\uD14D\uC2A4\uD2B8\uC5D0\uC11C\uB294 \uC555\uCD95 \uD480\uAE30\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.",
|
|
21365
21362
|
unpackOperatorNotAllowed: "\uC774 \uCEE8\uD14D\uC2A4\uD2B8\uC5D0\uC11C\uB294 \uC555\uCD95 \uD480\uAE30 \uC791\uC5C5\uC774 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.",
|
|
21366
21363
|
unpackTuplesIllegal: "Python 3.8 \uC774\uC804\uC758 \uD29C\uD50C\uC5D0\uC11C\uB294 \uC555\uCD95 \uD480\uAE30 \uC791\uC5C5\uC774 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.",
|
|
21367
|
-
unpackedArgInTypeArgument: "\uC555\uCD95\
|
|
21364
|
+
unpackedArgInTypeArgument: "\uC555\uCD95\uC744 \uD47C \uC778\uC218\uB294 \uC774 \uCEE8\uD14D\uC2A4\uD2B8\uC5D0\uC11C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC74C",
|
|
21368
21365
|
unpackedArgWithVariadicParam: "\uC555\uCD95\uC744 \uD47C \uC778\uC218\uB294 TypeVarTuple \uB9E4\uAC1C \uBCC0\uC218\uC5D0 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",
|
|
21369
21366
|
unpackedDictArgumentNotMapping: '** \uB4A4\uC758 \uC778\uC218 \uC2DD\uC740 "str" \uD0A4 \uD615\uC2DD\uC758 \uB9E4\uD551\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.',
|
|
21370
21367
|
unpackedDictSubscriptIllegal: "\uC544\uB798 \uCCA8\uC790\uC5D0\uC11C \uC0AC\uC804 \uC555\uCD95 \uD480\uAE30 \uC5F0\uC0B0\uC790\uB294 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",
|
|
@@ -21951,7 +21948,6 @@ var require_package_nls_pl = __commonJS({
|
|
|
21951
21948
|
paramSpecFirstArg: "Oczekiwano nazwy parametru ParamSpec jako pierwszego argumentu",
|
|
21952
21949
|
paramSpecKwargsUsage: "Atrybut \u201Ekwargs\u201D parametru ParamSpec jest wa\u017Cna tylko wtedy, gdy jest u\u017Cywana z parametrem **kwargs",
|
|
21953
21950
|
paramSpecNotUsedByOuterScope: "Element ParamSpec \u201E{name}\u201D nie ma znaczenia w tym kontek\u015Bcie",
|
|
21954
|
-
paramSpecScopedToReturnType: "Parametr ParamSpec \u201E{name}\u201D jest obj\u0119ty zakresem mo\u017Cliwo\u015Bci wywo\u0142ania w ramach zwracanego typu i nie mo\u017Cna odwo\u0142ywa\u0107 si\u0119 do niego w tre\u015Bci funkcji",
|
|
21955
21951
|
paramSpecUnknownArg: "Parametr ParamSpec nie obs\u0142uguje wi\u0119cej ni\u017C jednego argumentu",
|
|
21956
21952
|
paramSpecUnknownMember: "\u201E{name}\u201D nie jest znanym atrybutem parametru ParamSpec",
|
|
21957
21953
|
paramSpecUnknownParam: "\u201E{name}\u201D jest nieznanym parametrem dla parametru ParamSpec",
|
|
@@ -22103,7 +22099,6 @@ var require_package_nls_pl = __commonJS({
|
|
|
22103
22099
|
typeVarNotSubscriptable: "Typ TypeVar \u201E{type}\u201D nie mo\u017Ce by\u0107 subskrybowany",
|
|
22104
22100
|
typeVarNotUsedByOuterScope: "Zmienna typu \u201E{name}\u201D nie ma w tym kontek\u015Bcie \u017Cadnego znaczenia",
|
|
22105
22101
|
typeVarPossiblyUnsolvable: "Zmienna typu \u201E{name}\u201D mo\u017Ce zosta\u0107 nierozwi\u0105zana, je\u015Bli obiekt wywo\u0142uj\u0105cy nie poda argumentu dla parametru \u201E{param}\u201D",
|
|
22106
|
-
typeVarScopedToReturnType: "Zmienna typu \u201E{name}\u201D jest obj\u0119ta zakresem mo\u017Cliwo\u015Bci wywo\u0142ania w typie zwracanym i nie mo\u017Cna odwo\u0142ywa\u0107 si\u0119 do niej w tre\u015Bci funkcji",
|
|
22107
22102
|
typeVarSingleConstraint: "Typ TypeVar musi mie\u0107 co najmniej dwa typy ograniczone",
|
|
22108
22103
|
typeVarTupleConstraints: "Element TypeVarTuple nie mo\u017Ce mie\u0107 ogranicze\u0144 warto\u015Bci",
|
|
22109
22104
|
typeVarTupleContext: "Warto\u015B\u0107 TypeVarTuple jest niedozwolona w tym kontek\u015Bcie",
|
|
@@ -22174,7 +22169,7 @@ var require_package_nls_pl = __commonJS({
|
|
|
22174
22169
|
unpackNotAllowed: "Rozpakowywanie jest niedozwolone w tym kontek\u015Bcie",
|
|
22175
22170
|
unpackOperatorNotAllowed: "Operacja rozpakowywania jest niedozwolona w tym kontek\u015Bcie",
|
|
22176
22171
|
unpackTuplesIllegal: "Operacja rozpakowywania nie jest dozwolona w krotkach przed j\u0119zykiem Python w wersji 3.8",
|
|
22177
|
-
unpackedArgInTypeArgument: "
|
|
22172
|
+
unpackedArgInTypeArgument: "Nie mo\u017Cna u\u017Cy\u0107 nierozpakowanych argument\xF3w w tym kontek\u015Bcie",
|
|
22178
22173
|
unpackedArgWithVariadicParam: "Nie mo\u017Cna u\u017Cy\u0107 nierozpakowanego argumentu dla parametru TypeVarTuple",
|
|
22179
22174
|
unpackedDictArgumentNotMapping: "Wyra\u017Cenie argumentu po znakach ** musi by\u0107 mapowaniem z typem klucza \u201Estr\u201D",
|
|
22180
22175
|
unpackedDictSubscriptIllegal: "Operator rozpakowywania s\u0142ownika w indeksie dolnym jest niedozwolony",
|
|
@@ -22761,7 +22756,6 @@ var require_package_nls_pt_br = __commonJS({
|
|
|
22761
22756
|
paramSpecFirstArg: "Nome esperado de ParamSpec como primeiro argumento",
|
|
22762
22757
|
paramSpecKwargsUsage: 'O atributo "kwargs" de ParamSpec \xE9 v\xE1lido somente quando usado com o par\xE2metro **kwargs',
|
|
22763
22758
|
paramSpecNotUsedByOuterScope: 'O ParamSpec "{name}" n\xE3o tem significado neste contexto',
|
|
22764
|
-
paramSpecScopedToReturnType: 'ParamSpec "{name}" tem como escopo um chamador dentro do tipo de retorno e n\xE3o pode ser referenciado no corpo da fun\xE7\xE3o',
|
|
22765
22759
|
paramSpecUnknownArg: "ParamSpec n\xE3o \xE9 compat\xEDvel com mais de um argumento",
|
|
22766
22760
|
paramSpecUnknownMember: '"{name}" n\xE3o \xE9 um atributo conhecido de ParamSpec',
|
|
22767
22761
|
paramSpecUnknownParam: '"{name}" \xE9 um par\xE2metro desconhecido para ParamSpec',
|
|
@@ -22913,7 +22907,6 @@ var require_package_nls_pt_br = __commonJS({
|
|
|
22913
22907
|
typeVarNotSubscriptable: 'N\xE3o \xE9 poss\xEDvel subscrever TypeVar "{type}"',
|
|
22914
22908
|
typeVarNotUsedByOuterScope: 'A vari\xE1vel de tipo "{name}" n\xE3o tem significado neste contexto',
|
|
22915
22909
|
typeVarPossiblyUnsolvable: 'A vari\xE1vel de tipo "{name}" pode ficar sem resolu\xE7\xE3o se o chamador n\xE3o fornecer nenhum argumento para o par\xE2metro "{param}"',
|
|
22916
|
-
typeVarScopedToReturnType: 'A vari\xE1vel de tipo "{name}" tem como escopo um chamador dentro do tipo de retorno e n\xE3o pode ser referenciada no corpo da fun\xE7\xE3o',
|
|
22917
22910
|
typeVarSingleConstraint: "TypeVar deve ter pelo menos dois tipos restritos",
|
|
22918
22911
|
typeVarTupleConstraints: "TypeVarTuple n\xE3o pode ter restri\xE7\xF5es de valor",
|
|
22919
22912
|
typeVarTupleContext: "TypeVarTuple n\xE3o \xE9 permitido neste contexto",
|
|
@@ -22984,7 +22977,7 @@ var require_package_nls_pt_br = __commonJS({
|
|
|
22984
22977
|
unpackNotAllowed: "Descompactar n\xE3o \xE9 permitido neste contexto",
|
|
22985
22978
|
unpackOperatorNotAllowed: "A opera\xE7\xE3o de descompacta\xE7\xE3o n\xE3o \xE9 permitida neste contexto",
|
|
22986
22979
|
unpackTuplesIllegal: "Opera\xE7\xE3o de desempacotamento n\xE3o permitida em tuplas anteriores ao Python 3.8",
|
|
22987
|
-
unpackedArgInTypeArgument: "
|
|
22980
|
+
unpackedArgInTypeArgument: "Os argumentos descompactados n\xE3o podem ser usados nesse contexto",
|
|
22988
22981
|
unpackedArgWithVariadicParam: "O argumento desempacotado n\xE3o pode ser usado para o par\xE2metro TypeVarTuple",
|
|
22989
22982
|
unpackedDictArgumentNotMapping: 'A express\xE3o de argumento ap\xF3s ** deve ser um mapeamento com um tipo de chave "str"',
|
|
22990
22983
|
unpackedDictSubscriptIllegal: "O operador de desempacotamento de dicion\xE1rio no subscrito n\xE3o \xE9 permitido",
|
|
@@ -23449,7 +23442,7 @@ var require_package_nls_qps_ploc = __commonJS({
|
|
|
23449
23442
|
incompatibleMethodOverride: '[i45Ka][\u0E19\u0E31\u0E49M\xEBth\xF8\xF0 "{\xF1\xE6m\xEB}" \xF8v\xEBrr\xEF\xF0\xEBs \xE7l\xE6ss "{\xE7l\xE6ss\xD1\xE6m\xEB}" \xEF\xF1 \xE6\xF1 \xEF\xF1\xE7\xF8mp\xE6t\xEF\xFEl\xEB m\xE6\xF1\xF1\xEBr\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u0E19\u0E31\u0E49\u0922\u0942\u0901]',
|
|
23450
23443
|
inconsistentIndent: "[gdrcy][\u0E19\u0E31\u0E49\xDC\xF1\xEF\xF1\xF0\xEB\xF1t \xE6m\xF8\xB5\xF1t \xF0\xF8\xEBs \xF1\xF8t m\xE6t\xE7h pr\xEBv\xEF\xF8\xB5s \xEF\xF1\xF0\xEB\xF1t\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0E19\u0E31\u0E49\u0922\u0942\u0901]",
|
|
23451
23444
|
inconsistentTabs: "[I3Z6K][\u0E19\u0E31\u0E49\xCF\xF1\xE7\xF8\xF1s\xEFst\xEB\xF1t \xB5s\xEB \xF8f t\xE6\xFEs \xE6\xF1\xF0 sp\xE6\xE7\xEBs \xEF\xF1 \xEF\xF1\xF0\xEB\xF1t\xE6t\xEF\xF8\xF1\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0E19\u0E31\u0E49\u0922\u0942\u0901]",
|
|
23452
|
-
initMethodSelfParamTypeVar: '[S5RC7][\u0E19\u0E31\u0E49T\xFFp\xEB \xE6\xF1\xF1\xF8t\xE6t\xEF\xF8\xF1 f\xF8r "s\xEBlf" p\xE6r\xE6m\xEBt\xEBr \xF8f "__\xEF\xF1\xEFt__" m\xEBth\xF8\xF0 \xE7\xE6\xF1\xF1\xF8t \xE7\xF8\xF1t\xE6\xEF\xF1 \xE7l\xE6ss-s\xE7\xF8p\xEB\xF0 t\xFFp\xEB v\xE6r\
|
|
23445
|
+
initMethodSelfParamTypeVar: '[S5RC7][\u0E19\u0E31\u0E49T\xFFp\xEB \xE6\xF1\xF1\xF8t\xE6t\xEF\xF8\xF1 f\xF8r "s\xEBlf" p\xE6r\xE6m\xEBt\xEBr \xF8f "__\xEF\xF1\xEFt__" m\xEBth\xF8\xF0 \xE7\xE6\xF1\xF1\xF8t \xE7\xF8\xF1t\xE6\xEF\xF1 \xE7l\xE6ss-s\xE7\xF8p\xEB\xF0 t\xFFp\xEB v\xE6r\xEF\xE6\xFEl\xEBs\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u0E19\u0E31\u0E49\u0922\u0942\u0901]',
|
|
23453
23446
|
initMustReturnNone: '[RlXyC][\u0E19\u0E31\u0E49R\xEBt\xB5r\xF1 t\xFFp\xEB \xF8f "__\xEF\xF1\xEFt__" m\xB5st \xFE\xEB \xD1\xF8\xF1\xEB\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u0E19\u0E31\u0E49\u0922\u0942\u0901]',
|
|
23454
23447
|
initSubclassCallFailed: "[w22Kh][\u0E19\u0E31\u0E49\xCF\xF1\xE7\xF8rr\xEB\xE7t k\xEB\xFFw\xF8r\xF0 \xE6rg\xB5m\xEB\xF1ts f\xF8r __\xEF\xF1\xEFt_s\xB5\xFE\xE7l\xE6ss__ m\xEBth\xF8\xF0\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0E19\u0E31\u0E49\u0922\u0942\u0901]",
|
|
23455
23448
|
initSubclassClsParam: '[6CWuS][\u0E19\u0E31\u0E49__\xEF\xF1\xEFt_s\xB5\xFE\xE7l\xE6ss__ \xF8v\xEBrr\xEF\xF0\xEB sh\xF8\xB5l\xF0 t\xE6k\xEB \xE6 "\xE7ls" p\xE6r\xE6m\xEBt\xEBr\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0E19\u0E31\u0E49\u0922\u0942\u0901]',
|
|
@@ -23571,7 +23564,6 @@ var require_package_nls_qps_ploc = __commonJS({
|
|
|
23571
23564
|
paramSpecFirstArg: "[W2Y3X][\u0E19\u0E31\u0E49\xCBxp\xEB\xE7t\xEB\xF0 \xF1\xE6m\xEB \xF8f P\xE6r\xE6m\xA7p\xEB\xE7 \xE6s f\xEFrst \xE6rg\xB5m\xEB\xF1t\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0E19\u0E31\u0E49\u0922\u0942\u0901]",
|
|
23572
23565
|
paramSpecKwargsUsage: '[2UE71][\u0E19\u0E31\u0E49"kw\xE6rgs" \xE6ttr\xEF\xFE\xB5t\xEB \xF8f P\xE6r\xE6m\xA7p\xEB\xE7 \xEFs v\xE6l\xEF\xF0 \xF8\xF1l\xFF wh\xEB\xF1 \xB5s\xEB\xF0 w\xEFth **kw\xE6rgs p\xE6r\xE6m\xEBt\xEBr\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0E19\u0E31\u0E49\u0922\u0942\u0901]',
|
|
23573
23566
|
paramSpecNotUsedByOuterScope: '[5Pk7H][\u0E19\u0E31\u0E49P\xE6r\xE6m\xA7p\xEB\xE7 "{\xF1\xE6m\xEB}" h\xE6s \xF1\xF8 m\xEB\xE6\xF1\xEF\xF1g \xEF\xF1 th\xEFs \xE7\xF8\xF1t\xEBxt\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0E19\u0E31\u0E49\u0922\u0942\u0901]',
|
|
23574
|
-
paramSpecScopedToReturnType: '[vVuXS][\u0E19\u0E31\u0E49P\xE6r\xE6m\xA7p\xEB\xE7 "{\xF1\xE6m\xEB}" \xEFs s\xE7\xF8p\xEB\xF0 t\xF8 \xE6 \xE7\xE6ll\xE6\xFEl\xEB w\xEFth\xEF\xF1 th\xEB r\xEBt\xB5r\xF1 t\xFFp\xEB \xE6\xF1\xF0 \xE7\xE6\xF1\xF1\xF8t \xFE\xEB r\xEBf\xEBr\xEB\xF1\xE7\xEB\xF0 \xEF\xF1 th\xEB f\xB5\xF1\xE7t\xEF\xF8\xF1 \xFE\xF8\xF0\xFF\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u0E19\u0E31\u0E49\u0922\u0942\u0901]',
|
|
23575
23567
|
paramSpecUnknownArg: "[6zeYc][\u0E19\u0E31\u0E49P\xE6r\xE6m\xA7p\xEB\xE7 \xF0\xF8\xEBs \xF1\xF8t s\xB5pp\xF8rt m\xF8r\xEB th\xE6\xF1 \xF8\xF1\xEB \xE6rg\xB5m\xEB\xF1t\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0E19\u0E31\u0E49\u0922\u0942\u0901]",
|
|
23576
23568
|
paramSpecUnknownMember: '[GhhiY][\u0E19\u0E31\u0E49"{\xF1\xE6m\xEB}" \xEFs \xF1\xF8t \xE6 k\xF1\xF8w\xF1 \xE6ttr\xEF\xFE\xB5t\xEB \xF8f P\xE6r\xE6m\xA7p\xEB\xE7\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0E19\u0E31\u0E49\u0922\u0942\u0901]',
|
|
23577
23569
|
paramSpecUnknownParam: '[YADLo][\u0E19\u0E31\u0E49"{\xF1\xE6m\xEB}" \xEFs \xB5\xF1k\xF1\xF8w\xF1 p\xE6r\xE6m\xEBt\xEBr t\xF8 P\xE6r\xE6m\xA7p\xEB\xE7\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0E19\u0E31\u0E49\u0922\u0942\u0901]',
|
|
@@ -23723,7 +23715,6 @@ var require_package_nls_qps_ploc = __commonJS({
|
|
|
23723
23715
|
typeVarNotSubscriptable: '[3KoEm][\u0E19\u0E31\u0E49T\xFFp\xEBV\xE6r "{t\xFFp\xEB}" \xEFs \xF1\xF8t s\xB5\xFEs\xE7r\xEFpt\xE6\xFEl\xEB\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u0E19\u0E31\u0E49\u0922\u0942\u0901]',
|
|
23724
23716
|
typeVarNotUsedByOuterScope: '[on7uQ][\u0E19\u0E31\u0E49T\xFFp\xEB v\xE6r\xEF\xE6\xFEl\xEB "{\xF1\xE6m\xEB}" h\xE6s \xF1\xF8 m\xEB\xE6\xF1\xEF\xF1g \xEF\xF1 th\xEFs \xE7\xF8\xF1t\xEBxt\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0E19\u0E31\u0E49\u0922\u0942\u0901]',
|
|
23725
23717
|
typeVarPossiblyUnsolvable: '[PP5xz][\u0E19\u0E31\u0E49T\xFFp\xEB v\xE6r\xEF\xE6\xFEl\xEB "{\xF1\xE6m\xEB}" m\xE6\xFF g\xF8 \xB5\xF1s\xF8lv\xEB\xF0 \xEFf \xE7\xE6ll\xEBr s\xB5ppl\xEF\xEBs \xF1\xF8 \xE6rg\xB5m\xEB\xF1t f\xF8r p\xE6r\xE6m\xEBt\xEBr "{p\xE6r\xE6m}"\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0E19\u0E31\u0E49\u0922\u0942\u0901]',
|
|
23726
|
-
typeVarScopedToReturnType: '[AYNcY][\u0E19\u0E31\u0E49T\xFFp\xEB v\xE6r\xEF\xE6\xFEl\xEB "{\xF1\xE6m\xEB}" \xEFs s\xE7\xF8p\xEB\xF0 t\xF8 \xE6 \xE7\xE6ll\xE6\xFEl\xEB w\xEFth\xEF\xF1 th\xEB r\xEBt\xB5r\xF1 t\xFFp\xEB \xE6\xF1\xF0 \xE7\xE6\xF1\xF1\xF8t \xFE\xEB r\xEBf\xEBr\xEB\xF1\xE7\xEB\xF0 \xEF\xF1 th\xEB f\xB5\xF1\xE7t\xEF\xF8\xF1 \xFE\xF8\xF0\xFF\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0E19\u0E31\u0E49\u0922\u0942\u0901]',
|
|
23727
23718
|
typeVarSingleConstraint: "[51MwX][\u0E19\u0E31\u0E49T\xFFp\xEBV\xE6r m\xB5st h\xE6v\xEB \xE6t l\xEB\xE6st tw\xF8 \xE7\xF8\xF1str\xE6\xEF\xF1\xEB\xF0 t\xFFp\xEBs\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u0E19\u0E31\u0E49\u0922\u0942\u0901]",
|
|
23728
23719
|
typeVarTupleConstraints: "[ouP8u][\u0E19\u0E31\u0E49T\xFFp\xEBV\xE6rT\xB5pl\xEB \xE7\xE6\xF1\xF1\xF8t h\xE6v\xEB v\xE6l\xB5\xEB \xE7\xF8\xF1str\xE6\xEF\xF1ts\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0E19\u0E31\u0E49\u0922\u0942\u0901]",
|
|
23729
23720
|
typeVarTupleContext: "[Q8vE2][\u0E19\u0E31\u0E49T\xFFp\xEBV\xE6rT\xB5pl\xEB \xEFs \xF1\xF8t \xE6ll\xF8w\xEB\xF0 \xEF\xF1 th\xEFs \xE7\xF8\xF1t\xEBxt\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0E19\u0E31\u0E49\u0922\u0942\u0901]",
|
|
@@ -23794,7 +23785,7 @@ var require_package_nls_qps_ploc = __commonJS({
|
|
|
23794
23785
|
unpackNotAllowed: "[MZq6e][\u0E19\u0E31\u0E49\xDC\xF1p\xE6\xE7k \xEFs \xF1\xF8t \xE6ll\xF8w\xEB\xF0 \xEF\xF1 th\xEFs \xE7\xF8\xF1t\xEBxt\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u0E19\u0E31\u0E49\u0922\u0942\u0901]",
|
|
23795
23786
|
unpackOperatorNotAllowed: "[lMq2B][\u0E19\u0E31\u0E49\xDC\xF1p\xE6\xE7k \xF8p\xEBr\xE6t\xEF\xF8\xF1 \xEFs \xF1\xF8t \xE6ll\xF8w\xEB\xF0 \xEF\xF1 th\xEFs \xE7\xF8\xF1t\xEBxt\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u0E19\u0E31\u0E49\u0922\u0942\u0901]",
|
|
23796
23787
|
unpackTuplesIllegal: "[RJvzW][\u0E19\u0E31\u0E49\xDC\xF1p\xE6\xE7k \xF8p\xEBr\xE6t\xEF\xF8\xF1 \xF1\xF8t \xE6ll\xF8w\xEB\xF0 \xEF\xF1 t\xB5pl\xEBs pr\xEF\xF8r t\xF8 P\xFFth\xF8\xF1 3.8\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0E19\u0E31\u0E49\u0922\u0942\u0901]",
|
|
23797
|
-
unpackedArgInTypeArgument: "[skxlo][\u0E19\u0E31\u0E49\xDC\xF1p\xE6\xE7k\xEB\xF0 \xE6rg\xB5m\xEB\xF1ts \xE7\xE6\xF1\xF1\xF8t \xFE\xEB \xB5s\xEB\xF0 \xEF\xF1
|
|
23788
|
+
unpackedArgInTypeArgument: "[skxlo][\u0E19\u0E31\u0E49\xDC\xF1p\xE6\xE7k\xEB\xF0 \xE6rg\xB5m\xEB\xF1ts \xE7\xE6\xF1\xF1\xF8t \xFE\xEB \xB5s\xEB\xF0 \xEF\xF1 th\xEFs \xE7\xF8\xF1t\xEBxt\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0E19\u0E31\u0E49\u0922\u0942\u0901]",
|
|
23798
23789
|
unpackedArgWithVariadicParam: "[ZP3kP][\u0E19\u0E31\u0E49\xDC\xF1p\xE6\xE7k\xEB\xF0 \xE6rg\xB5m\xEB\xF1t \xE7\xE6\xF1\xF1\xF8t \xFE\xEB \xB5s\xEB\xF0 f\xF8r T\xFFp\xEBV\xE6rT\xB5pl\xEB p\xE6r\xE6m\xEBt\xEBr\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0E19\u0E31\u0E49\u0922\u0942\u0901]",
|
|
23799
23790
|
unpackedDictArgumentNotMapping: '[iSTnU][\u0E19\u0E31\u0E49\xC6rg\xB5m\xEB\xF1t \xEBxpr\xEBss\xEF\xF8\xF1 \xE6ft\xEBr ** m\xB5st \xFE\xEB \xE6 m\xE6pp\xEF\xF1g w\xEFth \xE6 "str" k\xEB\xFF t\xFFp\xEB\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u0E19\u0E31\u0E49\u0922\u0942\u0901]',
|
|
23800
23791
|
unpackedDictSubscriptIllegal: "[slATr][\u0E19\u0E31\u0E49\xD0\xEF\xE7t\xEF\xF8\xF1\xE6r\xFF \xB5\xF1p\xE6\xE7k \xF8p\xEBr\xE6t\xF8r \xEF\xF1 s\xB5\xFEs\xE7r\xEFpt \xEFs \xF1\xF8t \xE6ll\xF8w\xEB\xF0\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0E19\u0E31\u0E49\u0922\u0942\u0901]",
|
|
@@ -24259,7 +24250,7 @@ var require_package_nls_ru = __commonJS({
|
|
|
24259
24250
|
incompatibleMethodOverride: '\u041C\u0435\u0442\u043E\u0434 "{name}" \u043F\u0435\u0440\u0435\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u044F\u0435\u0442 \u043A\u043B\u0430\u0441\u0441 "{className}" \u043D\u0435\u0441\u043E\u0432\u043C\u0435\u0441\u0442\u0438\u043C\u044B\u043C \u043E\u0431\u0440\u0430\u0437\u043E\u043C',
|
|
24260
24251
|
inconsistentIndent: "\u0421\u0443\u043C\u043C\u0430 \u043E\u0442\u0441\u0442\u0443\u043F\u0430 \u043D\u0435 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0435\u043C\u0443 \u043E\u0442\u0441\u0442\u0443\u043F\u0443",
|
|
24261
24252
|
inconsistentTabs: "\u041D\u0435\u043F\u043E\u0441\u043B\u0435\u0434\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0435 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435 \u0432\u043A\u043B\u0430\u0434\u043E\u043A \u0438 \u043F\u0440\u043E\u0431\u0435\u043B\u043E\u0432 \u0432 \u043E\u0442\u0441\u0442\u0443\u043F\u0430\u0445",
|
|
24262
|
-
initMethodSelfParamTypeVar: '\
|
|
24253
|
+
initMethodSelfParamTypeVar: '\u0417\u0430\u043C\u0435\u0442\u043A\u0430 \u0442\u0438\u043F\u0430 \u0434\u043B\u044F \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430 "self" \u043C\u0435\u0442\u043E\u0434\u0430 "__init__" \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u044B\u0435 \u0442\u0438\u043F\u0430 \u0432 \u043E\u0431\u043B\u0430\u0441\u0442\u0438 \u043A\u043B\u0430\u0441\u0441\u0430.',
|
|
24263
24254
|
initMustReturnNone: '\u041C\u0435\u0442\u043E\u0434 "__init__" \u0434\u043E\u043B\u0436\u0435\u043D \u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044C \u0442\u0438\u043F None',
|
|
24264
24255
|
initSubclassCallFailed: "\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0430\u0440\u0433\u0443\u043C\u0435\u043D\u0442\u044B \u043A\u043B\u044E\u0447\u0435\u0432\u044B\u0445 \u0441\u043B\u043E\u0432 \u0434\u043B\u044F \u043C\u0435\u0442\u043E\u0434\u0430 __init_subclass__",
|
|
24265
24256
|
initSubclassClsParam: '\u041F\u0435\u0440\u0435\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u0435 \u043C\u0435\u0442\u043E\u0434\u0430 __init_subclass__ \u0434\u043E\u043B\u0436\u043D\u043E \u043F\u0440\u0438\u043D\u0438\u043C\u0430\u0442\u044C \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 "cls"',
|
|
@@ -24381,7 +24372,6 @@ var require_package_nls_ru = __commonJS({
|
|
|
24381
24372
|
paramSpecFirstArg: "\u041E\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044F \u0438\u043C\u044F ParamSpec \u0432 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043F\u0435\u0440\u0432\u043E\u0433\u043E \u0430\u0440\u0433\u0443\u043C\u0435\u043D\u0442\u0430",
|
|
24382
24373
|
paramSpecKwargsUsage: '\u0410\u0442\u0440\u0438\u0431\u0443\u0442 "kwargs" ParamSpec \u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C \u0442\u043E\u043B\u044C\u043A\u043E \u043F\u0440\u0438 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0438 \u0441 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u043C *kwargs',
|
|
24383
24374
|
paramSpecNotUsedByOuterScope: 'ParamSpec "{name}" \u043D\u0435 \u0438\u043C\u0435\u0435\u0442 \u0441\u043C\u044B\u0441\u043B\u0430 \u0432 \u044D\u0442\u043E\u043C \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0435',
|
|
24384
|
-
paramSpecScopedToReturnType: 'ParamSpec "{name}" \u043E\u0442\u043D\u043E\u0441\u0438\u0442\u0441\u044F \u043A \u043E\u0431\u043B\u0430\u0441\u0442\u0438 \u0432\u044B\u0437\u044B\u0432\u0430\u0435\u043C\u043E\u0433\u043E \u043E\u0431\u044A\u0435\u043A\u0442\u0430 \u0432 \u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043C\u043E\u043C \u0442\u0438\u043F\u0435, \u0438 \u043D\u0430 \u043D\u0435\u0433\u043E \u043D\u0435\u043B\u044C\u0437\u044F \u0441\u0441\u044B\u043B\u0430\u0442\u044C\u0441\u044F \u0432 \u0442\u0435\u043A\u0441\u0442\u0435 \u0444\u0443\u043D\u043A\u0446\u0438\u0438.',
|
|
24385
24375
|
paramSpecUnknownArg: "ParamSpec \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0431\u043E\u043B\u0435\u0435 \u043E\u0434\u043D\u043E\u0433\u043E \u0430\u0440\u0433\u0443\u043C\u0435\u043D\u0442\u0430",
|
|
24386
24376
|
paramSpecUnknownMember: '"{name}" \u043D\u0435 \u044F\u0432\u043B\u044F\u0435\u0442\u0441\u044F \u0438\u0437\u0432\u0435\u0441\u0442\u043D\u044B\u043C \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043E\u043C ParamSpec',
|
|
24387
24377
|
paramSpecUnknownParam: '"{name}" \u044F\u0432\u043B\u044F\u0435\u0442\u0441\u044F \u043D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u044B\u043C \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u043C \u0434\u043B\u044F ParamSpec',
|
|
@@ -24533,7 +24523,6 @@ var require_package_nls_ru = __commonJS({
|
|
|
24533
24523
|
typeVarNotSubscriptable: '\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0432\u0437\u044F\u0442\u044C \u043F\u043E\u0434\u0441\u0442\u0440\u043E\u043A\u0443 \u043E\u0442 "{type}" TypeVar',
|
|
24534
24524
|
typeVarNotUsedByOuterScope: '\u041F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u0430\u044F \u0442\u0438\u043F\u0430 "{name}" \u043D\u0435 \u0438\u043C\u0435\u0435\u0442 \u0441\u043C\u044B\u0441\u043B\u0430 \u0432 \u044D\u0442\u043E\u043C \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0435',
|
|
24535
24525
|
typeVarPossiblyUnsolvable: '\u041F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u0430\u044F \u0442\u0438\u043F\u0430 "{name}" \u043C\u043E\u0436\u0435\u0442 \u043E\u0441\u0442\u0430\u0442\u044C\u0441\u044F \u043D\u0435\u0440\u0435\u0448\u0435\u043D\u043D\u043E\u0439, \u0435\u0441\u043B\u0438 \u0432\u044B\u0437\u044B\u0432\u0430\u044E\u0449\u0430\u044F \u0441\u0442\u043E\u0440\u043E\u043D\u0430 \u043D\u0435 \u0443\u043A\u0430\u0437\u044B\u0432\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043C\u0435\u043D\u0442 \u0434\u043B\u044F \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430 "{param}"',
|
|
24536
|
-
typeVarScopedToReturnType: '\u041F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u0430\u044F \u0442\u0438\u043F\u0430 "{name}" \u043E\u0442\u043D\u043E\u0441\u0438\u0442\u0441\u044F \u043A \u0432\u044B\u0437\u044B\u0432\u0430\u0435\u043C\u043E\u043C\u0443 \u043E\u0431\u044A\u0435\u043A\u0442\u0443 \u0432 \u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043C\u043E\u043C \u0442\u0438\u043F\u0435, \u0438 \u043D\u0430 \u043D\u0435\u0435 \u043D\u0435\u043B\u044C\u0437\u044F \u0441\u0441\u044B\u043B\u0430\u0442\u044C\u0441\u044F \u0432 \u0442\u0435\u043A\u0441\u0442\u0435 \u0444\u0443\u043D\u043A\u0446\u0438\u0438.',
|
|
24537
24526
|
typeVarSingleConstraint: "TypeVar \u0434\u043E\u043B\u0436\u0435\u043D \u0438\u043C\u0435\u0442\u044C \u043D\u0435 \u043C\u0435\u043D\u0435\u0435 \u0434\u0432\u0443\u0445 \u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u043D\u044B\u0445 \u0442\u0438\u043F\u043E\u0432",
|
|
24538
24527
|
typeVarTupleConstraints: "TypeVarTuple \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u0438\u044F \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439",
|
|
24539
24528
|
typeVarTupleContext: "TypeVarTuple \u043D\u0435 \u0434\u043E\u043F\u0443\u0441\u043A\u0430\u0435\u0442\u0441\u044F \u0432 \u044D\u0442\u043E\u043C \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0435",
|
|
@@ -24604,7 +24593,7 @@ var require_package_nls_ru = __commonJS({
|
|
|
24604
24593
|
unpackNotAllowed: "\u0420\u0430\u0441\u043F\u0430\u043A\u043E\u0432\u043A\u0430 \u0434\u043E\u043F\u0443\u0441\u043A\u0430\u0435\u0442\u0441\u044F \u0432 \u044D\u0442\u043E\u043C \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0435",
|
|
24605
24594
|
unpackOperatorNotAllowed: "\u041E\u043F\u0435\u0440\u0430\u0446\u0438\u044F \u0440\u0430\u0441\u043F\u0430\u043A\u043E\u0432\u043A\u0438 \u0434\u043E\u043F\u0443\u0441\u043A\u0430\u0435\u0442\u0441\u044F \u0432 \u044D\u0442\u043E\u043C \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0435",
|
|
24606
24595
|
unpackTuplesIllegal: "\u041E\u043F\u0435\u0440\u0430\u0446\u0438\u044E \u0440\u0430\u0441\u043F\u0430\u043A\u043E\u0432\u043A\u0438 \u0432 \u043A\u043E\u0440\u0442\u0435\u0436\u0430\u0445 \u043C\u043E\u0436\u043D\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0432 Python \u0432\u0435\u0440\u0441\u0438\u0438 \u043D\u0435 \u043D\u0438\u0436\u0435 3.8",
|
|
24607
|
-
unpackedArgInTypeArgument: "\
|
|
24596
|
+
unpackedArgInTypeArgument: "\u0412 \u044D\u0442\u043E\u043C \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0435 \u043D\u0435\u043B\u044C\u0437\u044F \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0440\u0430\u0441\u043F\u0430\u043A\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0430\u0440\u0433\u0443\u043C\u0435\u043D\u0442\u044B",
|
|
24608
24597
|
unpackedArgWithVariadicParam: "\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0440\u0430\u0441\u043F\u0430\u043A\u043E\u0432\u0430\u043D\u043D\u044B\u0439 \u0430\u0440\u0433\u0443\u043C\u0435\u043D\u0442 \u0434\u043B\u044F \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430 TypeVarTuple",
|
|
24609
24598
|
unpackedDictArgumentNotMapping: '\u0412\u044B\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0430\u0440\u0433\u0443\u043C\u0435\u043D\u0442\u0430 \u043F\u043E\u0441\u043B\u0435 ** \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u0441\u043E\u043F\u043E\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u043C \u0441 \u0442\u0438\u043F\u043E\u043C \u043A\u043B\u044E\u0447\u0430 "str".',
|
|
24610
24599
|
unpackedDictSubscriptIllegal: "\u041E\u043F\u0435\u0440\u0430\u0442\u043E\u0440 \u0440\u0430\u0441\u043F\u0430\u043A\u043E\u0432\u043A\u0438 \u0441\u043B\u043E\u0432\u0430\u0440\u044F \u043D\u0435 \u0434\u043E\u043F\u0443\u0441\u043A\u0430\u0435\u0442\u0441\u044F \u0432\u043D\u0443\u0442\u0440\u0438 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u0437\u044F\u0442\u0438\u044F \u043F\u043E\u0434\u0441\u0442\u0440\u043E\u043A\u0438",
|
|
@@ -25191,7 +25180,6 @@ var require_package_nls_tr = __commonJS({
|
|
|
25191
25180
|
paramSpecFirstArg: "\u0130lk ba\u011F\u0131ms\u0131z de\u011Fi\u015Fken olarak ParamSpec ad\u0131 bekleniyordu",
|
|
25192
25181
|
paramSpecKwargsUsage: `ParamSpec'in "kwargs" \xF6zniteli\u011Fi yaln\u0131zca **kwargs parametresiyle kullan\u0131ld\u0131\u011F\u0131nda ge\xE7erlidir`,
|
|
25193
25182
|
paramSpecNotUsedByOuterScope: '"{name}" adl\u0131 ParamSpec bu ba\u011Flamda bir anlam ifade etmiyor',
|
|
25194
|
-
paramSpecScopedToReturnType: 'ParamSpec "{name}" d\xF6n\xFC\u015F t\xFCr\xFC i\xE7inde \xE7a\u011Fr\u0131labilir kapsam\u0131na al\u0131nd\u0131 ve i\u015Flev g\xF6vdesinde ba\u015Fvurulamaz',
|
|
25195
25183
|
paramSpecUnknownArg: "ParamSpec birden fazla ba\u011F\u0131ms\u0131z de\u011Fi\u015Fkeni desteklemiyor",
|
|
25196
25184
|
paramSpecUnknownMember: '"{name}" bilinen bir ParamSpec \xF6zniteli\u011Fi de\u011Fil',
|
|
25197
25185
|
paramSpecUnknownParam: '"{name}", ParamSpec i\xE7in bilinmeyen bir parametre',
|
|
@@ -25343,7 +25331,6 @@ var require_package_nls_tr = __commonJS({
|
|
|
25343
25331
|
typeVarNotSubscriptable: 'TypeVar "{type}" alt yaz\u0131labilir de\u011Fil',
|
|
25344
25332
|
typeVarNotUsedByOuterScope: '"{name}" t\xFCr de\u011Fi\u015Fkeni bu ba\u011Flamda bir anlam ifade etmiyor',
|
|
25345
25333
|
typeVarPossiblyUnsolvable: '"{name}" t\xFCr de\u011Fi\u015Fkeni, \xE7a\u011F\u0131ran "{param}" parametresi i\xE7in ba\u011F\u0131ms\u0131z de\u011Fi\u015Fken sa\u011Flamazsa \xE7\xF6z\xFCmlenemeyebilir',
|
|
25346
|
-
typeVarScopedToReturnType: '"{name}" t\xFCr de\u011Fi\u015Fkeni, d\xF6n\xFC\u015F t\xFCr\xFC i\xE7inde \xE7a\u011Fr\u0131labilir kapsam\u0131na al\u0131nd\u0131 ve i\u015Flev g\xF6vdesinde ba\u015Fvurulamaz',
|
|
25347
25334
|
typeVarSingleConstraint: "TypeVar en az iki k\u0131s\u0131tlanm\u0131\u015F t\xFCre sahip olmal\u0131d\u0131r",
|
|
25348
25335
|
typeVarTupleConstraints: "TypeVarTuple de\u011Fer k\u0131s\u0131tlamalar\u0131na sahip olamaz",
|
|
25349
25336
|
typeVarTupleContext: "TypeVarTuple bu ba\u011Flamda kullan\u0131lamaz",
|
|
@@ -25414,7 +25401,7 @@ var require_package_nls_tr = __commonJS({
|
|
|
25414
25401
|
unpackNotAllowed: "Bu ba\u011Flamda paketi a\xE7ma i\u015Flemine izin verilmiyor",
|
|
25415
25402
|
unpackOperatorNotAllowed: "Bu ba\u011Flamda paket a\xE7ma i\u015Flemi kullan\u0131lamaz",
|
|
25416
25403
|
unpackTuplesIllegal: "Python 3.8'den \xF6nceki demetler i\xE7inde paket a\xE7ma i\u015Flemi kullan\u0131lam\u0131yor",
|
|
25417
|
-
unpackedArgInTypeArgument: "Paketlenmemi\u015F ba\u011F\u0131ms\u0131z de\u011Fi\u015Fkenler
|
|
25404
|
+
unpackedArgInTypeArgument: "Paketlenmemi\u015F ba\u011F\u0131ms\u0131z de\u011Fi\u015Fkenler bu ba\u011Flamda kullan\u0131lamaz",
|
|
25418
25405
|
unpackedArgWithVariadicParam: "Paketlenmemi\u015F ba\u011F\u0131ms\u0131z de\u011Fi\u015Fken, TypeVarTuple parametresi i\xE7in kullan\u0131lamaz",
|
|
25419
25406
|
unpackedDictArgumentNotMapping: '** sonras\u0131ndaki ba\u011F\u0131ms\u0131z de\u011Fi\u015Fken ifadesi "str" anahtar t\xFCr\xFCne sahip bir e\u015Fleme olmal\u0131d\u0131r',
|
|
25420
25407
|
unpackedDictSubscriptIllegal: "Alt simgede s\xF6zl\xFCk a\xE7ma i\u015Flecine izin verilmiyor",
|
|
@@ -25879,7 +25866,7 @@ var require_package_nls_zh_cn = __commonJS({
|
|
|
25879
25866
|
incompatibleMethodOverride: "\u65B9\u6CD5\u201C{name}\u201D\u4EE5\u4E0D\u517C\u5BB9\u7684\u65B9\u5F0F\u66FF\u4EE3\u7C7B\u201C{className}\u201D",
|
|
25880
25867
|
inconsistentIndent: "\u53D6\u6D88\u7F29\u8FDB\u91CF\u4E0E\u4EE5\u524D\u7684\u7F29\u8FDB\u4E0D\u5339\u914D",
|
|
25881
25868
|
inconsistentTabs: "\u7F29\u8FDB\u4E2D\u5236\u8868\u7B26\u548C\u7A7A\u683C\u7684\u4F7F\u7528\u4E0D\u4E00\u81F4",
|
|
25882
|
-
initMethodSelfParamTypeVar: '"__init__" \u65B9\u6CD5 \u201Cself\u201D \u53C2\u6570\u7684\u7C7B\u578B\
|
|
25869
|
+
initMethodSelfParamTypeVar: '"__init__" \u65B9\u6CD5 \u201Cself\u201D \u53C2\u6570\u7684\u7C7B\u578B\u6CE8\u91CA\u4E0D\u80FD\u5305\u542B\u7C7B\u8303\u56F4\u7684\u7C7B\u578B\u53D8\u91CF',
|
|
25883
25870
|
initMustReturnNone: "\u201C__init__\u201D\u7684\u8FD4\u56DE\u7C7B\u578B\u5FC5\u987B\u4E3A None",
|
|
25884
25871
|
initSubclassCallFailed: "__init_subclass__ \u65B9\u6CD5\u7684\u5173\u952E\u5B57\u53C2\u6570\u4E0D\u6B63\u786E",
|
|
25885
25872
|
initSubclassClsParam: "__init_subclass__\u66FF\u4EE3\u5E94\u91C7\u7528\u201Ccls\u201D\u53C2\u6570",
|
|
@@ -26001,7 +25988,6 @@ var require_package_nls_zh_cn = __commonJS({
|
|
|
26001
25988
|
paramSpecFirstArg: "ParamSpec \u4F5C\u4E3A\u7B2C\u4E00\u4E2A\u53C2\u6570\u7684\u9884\u671F\u540D\u79F0",
|
|
26002
25989
|
paramSpecKwargsUsage: 'ParamSpec \u7684 "kwargs" \u5C5E\u6027\u4EC5\u5728\u4E0E **kwargs \u53C2\u6570\u4E00\u8D77\u4F7F\u7528\u65F6\u6709\u6548',
|
|
26003
25990
|
paramSpecNotUsedByOuterScope: "ParamSpec\u201C{name}\u201D\u5728\u6B64\u4E0A\u4E0B\u6587\u4E2D\u6CA1\u6709\u610F\u4E49",
|
|
26004
|
-
paramSpecScopedToReturnType: 'ParamSpec "{name}"\u5728\u8FD4\u56DE\u7C7B\u578B\u5185\u7684\u4F5C\u7528\u57DF\u4E3A\u53EF\u8C03\u7528\uFF0C\u4E0D\u80FD\u5728\u51FD\u6570\u4F53\u4E2D\u5F15\u7528',
|
|
26005
25991
|
paramSpecUnknownArg: "ParamSpec \u4E0D\u652F\u6301\u591A\u4E2A\u53C2\u6570",
|
|
26006
25992
|
paramSpecUnknownMember: "\u201C{name}\u201D\u4E0D\u662F ParamSpec \u7684\u5DF2\u77E5\u5C5E\u6027",
|
|
26007
25993
|
paramSpecUnknownParam: "\u201C{name}\u201D\u662F ParamSpec \u7684\u672A\u77E5\u53C2\u6570",
|
|
@@ -26153,7 +26139,6 @@ var require_package_nls_zh_cn = __commonJS({
|
|
|
26153
26139
|
typeVarNotSubscriptable: "TypeVar\u201C{type}\u201D\u4E0D\u53EF\u4E0B\u6807",
|
|
26154
26140
|
typeVarNotUsedByOuterScope: "\u7C7B\u578B\u53D8\u91CF\u201C{name}\u201D\u5728\u6B64\u4E0A\u4E0B\u6587\u4E2D\u6CA1\u6709\u610F\u4E49",
|
|
26155
26141
|
typeVarPossiblyUnsolvable: '\u5982\u679C\u8C03\u7528\u65B9\u6CA1\u6709\u4E3A\u53C2\u6570\u63D0\u4F9B\u53C2\u6570"{param}"\uFF0C\u5219\u7C7B\u578B\u53D8\u91CF"{name}"\u53EF\u80FD\u65E0\u6CD5\u89E3\u6790',
|
|
26156
|
-
typeVarScopedToReturnType: '\u7C7B\u578B\u53D8\u91CF"{name}"\u5728\u8FD4\u56DE\u7C7B\u578B\u5185\u7684\u4F5C\u7528\u57DF\u4E3A\u53EF\u8C03\u7528\uFF0C\u4E0D\u80FD\u5728\u51FD\u6570\u4F53\u4E2D\u5F15\u7528',
|
|
26157
26142
|
typeVarSingleConstraint: "TypeVar \u5FC5\u987B\u81F3\u5C11\u6709\u4E24\u79CD\u7EA6\u675F\u7C7B\u578B",
|
|
26158
26143
|
typeVarTupleConstraints: "TypeVarTuple \u4E0D\u80FD\u6709\u503C\u7EA6\u675F",
|
|
26159
26144
|
typeVarTupleContext: "\u6B64\u4E0A\u4E0B\u6587\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528 TypeVarTuple",
|
|
@@ -26224,7 +26209,7 @@ var require_package_nls_zh_cn = __commonJS({
|
|
|
26224
26209
|
unpackNotAllowed: "\u6B64\u4E0A\u4E0B\u6587\u4E2D\u4E0D\u5141\u8BB8\u89E3\u5305",
|
|
26225
26210
|
unpackOperatorNotAllowed: "\u6B64\u4E0A\u4E0B\u6587\u4E2D\u4E0D\u5141\u8BB8\u89E3\u538B\u7F29\u64CD\u4F5C",
|
|
26226
26211
|
unpackTuplesIllegal: "Python 3.8 \u4E4B\u524D\u7684\u5143\u7EC4\u4E2D\u4E0D\u5141\u8BB8\u89E3\u5305\u64CD\u4F5C",
|
|
26227
|
-
unpackedArgInTypeArgument: "\
|
|
26212
|
+
unpackedArgInTypeArgument: "\u672A\u6253\u5305\u7684\u53C2\u6570\u4E0D\u80FD\u7528\u4E8E\u6B64\u4E0A\u4E0B\u6587",
|
|
26228
26213
|
unpackedArgWithVariadicParam: "\u672A\u6253\u5305\u7684\u53C2\u6570\u4E0D\u80FD\u7528\u4E8E TypeVarTuple \u53C2\u6570",
|
|
26229
26214
|
unpackedDictArgumentNotMapping: "** \u540E\u9762\u7684\u53C2\u6570\u8868\u8FBE\u5F0F\u5FC5\u987B\u662F\u5177\u6709\u201Cstr\u201D\u952E\u7C7B\u578B\u7684\u6620\u5C04",
|
|
26230
26215
|
unpackedDictSubscriptIllegal: "\u4E0D\u5141\u8BB8\u5728\u4E0B\u6807\u4E2D\u4F7F\u7528\u5B57\u5178\u89E3\u5305\u8FD0\u7B97\u7B26",
|
|
@@ -26811,7 +26796,6 @@ var require_package_nls_zh_tw = __commonJS({
|
|
|
26811
26796
|
paramSpecFirstArg: "\u61C9\u4EE5 ParamSpec \u7684\u540D\u7A31\u4F5C\u70BA\u7B2C\u4E00\u500B\u5F15\u6578",
|
|
26812
26797
|
paramSpecKwargsUsage: '\u53EA\u6709\u642D\u914D **kwargs \u53C3\u6578\u4F7F\u7528\u6642\uFF0CParamSpec \u7684 "kwargs" \u5C6C\u6027\u624D\u6709\u6548',
|
|
26813
26798
|
paramSpecNotUsedByOuterScope: 'ParamSpec "{name}" \u5728\u6B64\u5167\u5BB9\u4E2D\u6C92\u6709\u610F\u7FA9',
|
|
26814
|
-
paramSpecScopedToReturnType: 'ParamSpec "{name}" \u7684\u7BC4\u570D\u70BA\u50B3\u56DE\u578B\u5225\u5167\u7684\u53EF\u547C\u53EB\u9805\u76EE\uFF0C\u7121\u6CD5\u5728\u51FD\u5F0F\u4E3B\u9AD4\u4E2D\u53C3\u8003',
|
|
26815
26799
|
paramSpecUnknownArg: "ParamSpec \u4E0D\u652F\u63F4\u4E00\u500B\u4EE5\u4E0A\u7684\u5F15\u6578",
|
|
26816
26800
|
paramSpecUnknownMember: '"{name}" \u4E0D\u662F ParamSpec \u7684\u5DF2\u77E5\u5C6C\u6027',
|
|
26817
26801
|
paramSpecUnknownParam: '"{name}" \u5C0D ParamSpec \u662F\u672A\u77E5\u7684\u53C3\u6578',
|
|
@@ -26963,7 +26947,6 @@ var require_package_nls_zh_tw = __commonJS({
|
|
|
26963
26947
|
typeVarNotSubscriptable: 'TypeVar "{type}" \u4E0D\u80FD\u4E0B\u6A19',
|
|
26964
26948
|
typeVarNotUsedByOuterScope: '\u985E\u578B\u8B8A\u6578 "{name}" \u5728\u6B64\u5167\u5BB9\u4E2D\u6C92\u6709\u610F\u7FA9',
|
|
26965
26949
|
typeVarPossiblyUnsolvable: '\u5982\u679C\u547C\u53EB\u8005\u672A\u63D0\u4F9B\u53C3\u6578 "{param}" \u7684\u5F15\u6578\uFF0C\u5247\u578B\u5225\u8B8A\u6578 "{name}" \u53EF\u80FD\u7121\u6CD5\u89E3\u6790',
|
|
26966
|
-
typeVarScopedToReturnType: '\u578B\u5225\u8B8A\u6578 "{name}" \u7684\u7BC4\u570D\u70BA\u50B3\u56DE\u578B\u5225\u5167\u7684\u53EF\u547C\u53EB\u9805\u76EE\uFF0C\u7121\u6CD5\u5728\u51FD\u5F0F\u4E3B\u9AD4\u4E2D\u53C3\u8003',
|
|
26967
26950
|
typeVarSingleConstraint: "TypeVar \u81F3\u5C11\u5FC5\u9808\u6709\u5169\u500B\u9650\u5236\u985E\u578B",
|
|
26968
26951
|
typeVarTupleConstraints: "TypeVarTuple \u4E0D\u80FD\u6709\u503C\u689D\u4EF6\u7D04\u675F",
|
|
26969
26952
|
typeVarTupleContext: "\u6B64\u5167\u5BB9\u4E2D\u4E0D\u5141\u8A31 TypeVarTuple",
|
|
@@ -27034,7 +27017,7 @@ var require_package_nls_zh_tw = __commonJS({
|
|
|
27034
27017
|
unpackNotAllowed: "\u6B64\u5167\u5BB9\u4E2D\u4E0D\u5141\u8A31\u89E3\u58D3\u7E2E",
|
|
27035
27018
|
unpackOperatorNotAllowed: "\u6B64\u5167\u5BB9\u4E2D\u4E0D\u5141\u8A31\u89E3\u58D3\u7E2E\u4F5C\u696D",
|
|
27036
27019
|
unpackTuplesIllegal: "Python 3.8 \u4E4B\u524D\u7684 Tuple \u4E2D\u4E0D\u5141\u8A31\u89E3\u58D3\u7E2E\u4F5C\u696D",
|
|
27037
|
-
unpackedArgInTypeArgument: "\
|
|
27020
|
+
unpackedArgInTypeArgument: "\u7121\u6CD5\u5728\u6B64\u5167\u5BB9\u4E2D\u4F7F\u7528\u672A\u5C01\u88DD\u7684\u5F15\u6578",
|
|
27038
27021
|
unpackedArgWithVariadicParam: "\u672A\u5C01\u88DD\u7684\u5F15\u6578\u7121\u6CD5\u7528\u65BC TypeVarTuple \u53C3\u6578",
|
|
27039
27022
|
unpackedDictArgumentNotMapping: '** \u5F8C\u7684\u5F15\u6578\u904B\u7B97\u5F0F\u5FC5\u9808\u662F\u5177\u6709 "str" \u91D1\u9470\u985E\u578B\u7684\u5C0D\u61C9',
|
|
27040
27023
|
unpackedDictSubscriptIllegal: "\u5B57\u5178\u89E3\u58D3\u7E2E\u904B\u7B97\u5B50\u5728\u4E0B\u6A19\u4E2D\u4E0D\u88AB\u5141\u8A31",
|
|
@@ -27536,6 +27519,8 @@ var require_localize = __commonJS({
|
|
|
27536
27519
|
Diagnostic6.ellipsisContext = () => getRawString("Diagnostic.ellipsisContext");
|
|
27537
27520
|
Diagnostic6.ellipsisSecondArg = () => getRawString("Diagnostic.ellipsisSecondArg");
|
|
27538
27521
|
Diagnostic6.enumClassOverride = () => new ParameterizedString(getRawString("Diagnostic.enumClassOverride"));
|
|
27522
|
+
Diagnostic6.enumMemberDelete = () => new ParameterizedString(getRawString("Diagnostic.enumMemberDelete"));
|
|
27523
|
+
Diagnostic6.enumMemberSet = () => new ParameterizedString(getRawString("Diagnostic.enumMemberSet"));
|
|
27539
27524
|
Diagnostic6.exceptionGroupIncompatible = () => getRawString("Diagnostic.exceptionGroupIncompatible");
|
|
27540
27525
|
Diagnostic6.exceptionTypeIncorrect = () => new ParameterizedString(getRawString("Diagnostic.exceptionTypeIncorrect"));
|
|
27541
27526
|
Diagnostic6.exceptionTypeNotClass = () => new ParameterizedString(getRawString("Diagnostic.exceptionTypeNotClass"));
|
|
@@ -27755,7 +27740,6 @@ var require_localize = __commonJS({
|
|
|
27755
27740
|
Diagnostic6.paramSpecFirstArg = () => getRawString("Diagnostic.paramSpecFirstArg");
|
|
27756
27741
|
Diagnostic6.paramSpecKwargsUsage = () => getRawString("Diagnostic.paramSpecKwargsUsage");
|
|
27757
27742
|
Diagnostic6.paramSpecNotUsedByOuterScope = () => new ParameterizedString(getRawString("Diagnostic.paramSpecNotUsedByOuterScope"));
|
|
27758
|
-
Diagnostic6.paramSpecScopedToReturnType = () => new ParameterizedString(getRawString("Diagnostic.paramSpecScopedToReturnType"));
|
|
27759
27743
|
Diagnostic6.paramSpecUnknownArg = () => getRawString("Diagnostic.paramSpecUnknownArg");
|
|
27760
27744
|
Diagnostic6.paramSpecUnknownMember = () => new ParameterizedString(getRawString("Diagnostic.paramSpecUnknownMember"));
|
|
27761
27745
|
Diagnostic6.paramSpecUnknownParam = () => new ParameterizedString(getRawString("Diagnostic.paramSpecUnknownParam"));
|
|
@@ -27928,7 +27912,6 @@ var require_localize = __commonJS({
|
|
|
27928
27912
|
Diagnostic6.typeVarNotSubscriptable = () => new ParameterizedString(getRawString("Diagnostic.typeVarNotSubscriptable"));
|
|
27929
27913
|
Diagnostic6.typeVarNotUsedByOuterScope = () => new ParameterizedString(getRawString("Diagnostic.typeVarNotUsedByOuterScope"));
|
|
27930
27914
|
Diagnostic6.typeVarPossiblyUnsolvable = () => new ParameterizedString(getRawString("Diagnostic.typeVarPossiblyUnsolvable"));
|
|
27931
|
-
Diagnostic6.typeVarScopedToReturnType = () => new ParameterizedString(getRawString("Diagnostic.typeVarScopedToReturnType"));
|
|
27932
27915
|
Diagnostic6.typeVarSingleConstraint = () => getRawString("Diagnostic.typeVarSingleConstraint");
|
|
27933
27916
|
Diagnostic6.typeVarsNotInGenericOrProtocol = () => getRawString("Diagnostic.typeVarsNotInGenericOrProtocol");
|
|
27934
27917
|
Diagnostic6.typeVarTupleContext = () => getRawString("Diagnostic.typeVarTupleContext");
|
|
@@ -37155,6 +37138,10 @@ var require_tokenizerTypes = __commonJS({
|
|
|
37155
37138
|
return token;
|
|
37156
37139
|
}
|
|
37157
37140
|
KeywordToken2.create = create;
|
|
37141
|
+
function isSoftKeyword(token) {
|
|
37142
|
+
return exports2.softKeywords.some((t) => token.keywordType === t);
|
|
37143
|
+
}
|
|
37144
|
+
KeywordToken2.isSoftKeyword = isSoftKeyword;
|
|
37158
37145
|
})(KeywordToken || (exports2.KeywordToken = KeywordToken = {}));
|
|
37159
37146
|
var StringToken;
|
|
37160
37147
|
(function(StringToken2) {
|
|
@@ -38420,7 +38407,7 @@ var require_tokenizer = __commonJS({
|
|
|
38420
38407
|
this._cs.skipToEol();
|
|
38421
38408
|
const length = this._cs.position - start;
|
|
38422
38409
|
const comment = tokenizerTypes_1.Comment.create(start, length, this._cs.getText().slice(start, start + length));
|
|
38423
|
-
const typeIgnoreRegexMatch = comment.value.match(/((^|#)\s*)type:\s*ignore(\s*\[([\s
|
|
38410
|
+
const typeIgnoreRegexMatch = comment.value.match(/((^|#)\s*)type:\s*ignore(\s*\[([\s\w-,]*)\]|\s|$)/);
|
|
38424
38411
|
if (typeIgnoreRegexMatch) {
|
|
38425
38412
|
const commentStart = start + ((_a = typeIgnoreRegexMatch.index) !== null && _a !== void 0 ? _a : 0);
|
|
38426
38413
|
const textRange = {
|
|
@@ -38440,7 +38427,7 @@ var require_tokenizer = __commonJS({
|
|
|
38440
38427
|
this._typeIgnoreLines.set(this._lineRanges.length, ignoreComment);
|
|
38441
38428
|
}
|
|
38442
38429
|
}
|
|
38443
|
-
const pyrightIgnoreRegexMatch = comment.value.match(/((^|#)\s*)pyright:\s*ignore(\s*\[([\s
|
|
38430
|
+
const pyrightIgnoreRegexMatch = comment.value.match(/((^|#)\s*)pyright:\s*ignore(\s*\[([\s\w-,]*)\]|\s|$)/);
|
|
38444
38431
|
if (pyrightIgnoreRegexMatch) {
|
|
38445
38432
|
const commentStart = start + ((_b = pyrightIgnoreRegexMatch.index) !== null && _b !== void 0 ? _b : 0);
|
|
38446
38433
|
const textRange = {
|
|
@@ -39395,13 +39382,16 @@ var require_scope = __commonJS({
|
|
|
39395
39382
|
symbol,
|
|
39396
39383
|
isOutsideCallerModule: !!(options === null || options === void 0 ? void 0 : options.isOutsideCallerModule),
|
|
39397
39384
|
isBeyondExecutionScope: !!(options === null || options === void 0 ? void 0 : options.isBeyondExecutionScope),
|
|
39398
|
-
scope: effectiveScope
|
|
39385
|
+
scope: effectiveScope,
|
|
39386
|
+
usesNonlocalBinding: !!(options === null || options === void 0 ? void 0 : options.usesNonlocalBinding),
|
|
39387
|
+
usesGlobalBinding: !!(options === null || options === void 0 ? void 0 : options.usesGlobalBinding)
|
|
39399
39388
|
};
|
|
39400
39389
|
}
|
|
39401
39390
|
}
|
|
39402
39391
|
let parentScope;
|
|
39403
39392
|
let isNextScopeBeyondExecutionScope = (options === null || options === void 0 ? void 0 : options.isBeyondExecutionScope) || this.isIndependentlyExecutable();
|
|
39404
|
-
|
|
39393
|
+
const notLocalBinding = this.notLocalBindings.get(name);
|
|
39394
|
+
if (notLocalBinding === 1) {
|
|
39405
39395
|
const globalScopeResult = this.getGlobalScope();
|
|
39406
39396
|
if (globalScopeResult.scope !== this) {
|
|
39407
39397
|
parentScope = globalScopeResult.scope;
|
|
@@ -39415,7 +39405,9 @@ var require_scope = __commonJS({
|
|
|
39415
39405
|
if (parentScope) {
|
|
39416
39406
|
return parentScope.lookUpSymbolRecursive(name, {
|
|
39417
39407
|
isOutsideCallerModule: !!(options === null || options === void 0 ? void 0 : options.isOutsideCallerModule) || this.type === 4,
|
|
39418
|
-
isBeyondExecutionScope: isNextScopeBeyondExecutionScope
|
|
39408
|
+
isBeyondExecutionScope: isNextScopeBeyondExecutionScope,
|
|
39409
|
+
usesNonlocalBinding: notLocalBinding === 0 || !!(options === null || options === void 0 ? void 0 : options.usesNonlocalBinding),
|
|
39410
|
+
usesGlobalBinding: notLocalBinding === 1 || !!(options === null || options === void 0 ? void 0 : options.usesGlobalBinding)
|
|
39419
39411
|
});
|
|
39420
39412
|
}
|
|
39421
39413
|
return void 0;
|
|
@@ -40640,7 +40632,8 @@ var require_binder = __commonJS({
|
|
|
40640
40632
|
uri: this._fileInfo.fileUri,
|
|
40641
40633
|
range: (0, positionUtils_1.convertTextRangeToRange)(node.name, this._fileInfo.lines),
|
|
40642
40634
|
moduleName: this._fileInfo.moduleName,
|
|
40643
|
-
isInExceptSuite: this._isInExceptSuite
|
|
40635
|
+
isInExceptSuite: this._isInExceptSuite,
|
|
40636
|
+
isExplicitBinding: this._currentScope.getBindingType(node.name.value) !== void 0
|
|
40644
40637
|
};
|
|
40645
40638
|
symbol.addDeclaration(declaration);
|
|
40646
40639
|
}
|
|
@@ -41255,7 +41248,8 @@ var require_binder = __commonJS({
|
|
|
41255
41248
|
uri: this._fileInfo.fileUri,
|
|
41256
41249
|
range: (0, positionUtils_1.convertTextRangeToRange)(node.target, this._fileInfo.lines),
|
|
41257
41250
|
moduleName: this._fileInfo.moduleName,
|
|
41258
|
-
isInExceptSuite: this._isInExceptSuite
|
|
41251
|
+
isInExceptSuite: this._isInExceptSuite,
|
|
41252
|
+
isExplicitBinding: this._currentScope.getBindingType(node.target.value) !== void 0
|
|
41259
41253
|
};
|
|
41260
41254
|
symbol.addDeclaration(declaration);
|
|
41261
41255
|
}
|
|
@@ -41316,7 +41310,8 @@ var require_binder = __commonJS({
|
|
|
41316
41310
|
uri: this._fileInfo.fileUri,
|
|
41317
41311
|
range: (0, positionUtils_1.convertTextRangeToRange)(slotNameNode, this._fileInfo.lines),
|
|
41318
41312
|
moduleName: this._fileInfo.moduleName,
|
|
41319
|
-
isInExceptSuite: this._isInExceptSuite
|
|
41313
|
+
isInExceptSuite: this._isInExceptSuite,
|
|
41314
|
+
isExplicitBinding: this._currentScope.getBindingType(slotName) !== void 0
|
|
41320
41315
|
};
|
|
41321
41316
|
symbol.addDeclaration(declaration);
|
|
41322
41317
|
}
|
|
@@ -41364,7 +41359,8 @@ var require_binder = __commonJS({
|
|
|
41364
41359
|
uri: this._fileInfo.fileUri,
|
|
41365
41360
|
range: (0, positionUtils_1.convertTextRangeToRange)(target, this._fileInfo.lines),
|
|
41366
41361
|
moduleName: this._fileInfo.moduleName,
|
|
41367
|
-
isInExceptSuite: this._isInExceptSuite
|
|
41362
|
+
isInExceptSuite: this._isInExceptSuite,
|
|
41363
|
+
isExplicitBinding: this._currentScope.getBindingType(target.value) !== void 0
|
|
41368
41364
|
};
|
|
41369
41365
|
symbol.addDeclaration(declaration);
|
|
41370
41366
|
}
|
|
@@ -42222,7 +42218,8 @@ var require_binder = __commonJS({
|
|
|
42222
42218
|
range: (0, positionUtils_1.convertTextRangeToRange)(name, this._fileInfo.lines),
|
|
42223
42219
|
moduleName: this._fileInfo.moduleName,
|
|
42224
42220
|
isInExceptSuite: this._isInExceptSuite,
|
|
42225
|
-
docString: this._getVariableDocString(target)
|
|
42221
|
+
docString: this._getVariableDocString(target),
|
|
42222
|
+
isExplicitBinding: this._currentScope.getBindingType(name.value) !== void 0
|
|
42226
42223
|
};
|
|
42227
42224
|
symbolWithScope.symbol.addDeclaration(declaration);
|
|
42228
42225
|
}
|
|
@@ -42334,7 +42331,8 @@ var require_binder = __commonJS({
|
|
|
42334
42331
|
range: (0, positionUtils_1.convertTextRangeToRange)(name, this._fileInfo.lines),
|
|
42335
42332
|
moduleName: this._fileInfo.moduleName,
|
|
42336
42333
|
isInExceptSuite: this._isInExceptSuite,
|
|
42337
|
-
docString: this._getVariableDocString(target)
|
|
42334
|
+
docString: this._getVariableDocString(target),
|
|
42335
|
+
isExplicitBinding: this._currentScope.getBindingType(name.value) !== void 0
|
|
42338
42336
|
};
|
|
42339
42337
|
symbolWithScope.symbol.addDeclaration(declaration);
|
|
42340
42338
|
if (isFinalAssignedInClassBody) {
|
|
@@ -42450,6 +42448,10 @@ var require_binder = __commonJS({
|
|
|
42450
42448
|
let isFinal = false;
|
|
42451
42449
|
let finalTypeNode;
|
|
42452
42450
|
if (typeAnnotation) {
|
|
42451
|
+
const classVarInfo = this._isAnnotationClassVar(typeAnnotation);
|
|
42452
|
+
if (classVarInfo === null || classVarInfo === void 0 ? void 0 : classVarInfo.classVarTypeNode) {
|
|
42453
|
+
typeAnnotation = classVarInfo.classVarTypeNode;
|
|
42454
|
+
}
|
|
42453
42455
|
if (this._isTypingAnnotation(typeAnnotation, "Final")) {
|
|
42454
42456
|
isFinal = true;
|
|
42455
42457
|
} else if (typeAnnotation.nodeType === 24 && typeAnnotation.items.length === 1) {
|
|
@@ -44773,6 +44775,9 @@ var require_types = __commonJS({
|
|
|
44773
44775
|
if (params1.length !== params2.length) {
|
|
44774
44776
|
return false;
|
|
44775
44777
|
}
|
|
44778
|
+
if (FunctionType.shouldSkipArgsKwargsCompatibilityCheck(type1) !== FunctionType.shouldSkipArgsKwargsCompatibilityCheck(functionType2)) {
|
|
44779
|
+
return false;
|
|
44780
|
+
}
|
|
44776
44781
|
const positionOnlyIndex1 = params1.findIndex((param) => isPositionOnlySeparator(param));
|
|
44777
44782
|
const positionOnlyIndex2 = params2.findIndex((param) => isPositionOnlySeparator(param));
|
|
44778
44783
|
for (let i = 0; i < params1.length; i++) {
|
|
@@ -45646,8 +45651,8 @@ var require_typeUtils = __commonJS({
|
|
|
45646
45651
|
"use strict";
|
|
45647
45652
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
45648
45653
|
exports2.isTupleClass = exports2.isMaybeDescriptorInstance = exports2.isDescriptorInstance = exports2.isCallableType = exports2.isProperty = exports2.isEllipsisType = exports2.getUnionSubtypeCount = exports2.getLiteralTypeClassName = exports2.containsLiteralType = exports2.isLiteralTypeOrUnion = exports2.isLiteralType = exports2.getSpecializedTupleType = exports2.selfSpecializeClass = exports2.getUnknownTypeForCallable = exports2.getUnknownTypeForParamSpec = exports2.getUnknownTypeForTypeVar = exports2.specializeWithUnknownTypeArgs = exports2.specializeWithDefaultTypeArgs = exports2.getTypeVarScopeIds = exports2.getTypeVarScopeId = exports2.transformPossibleRecursiveTypeAlias = exports2.isTypeAliasRecursive = exports2.isTypeAliasPlaceholder = exports2.getTypeCondition = exports2.addConditionToType = exports2.getFullNameOfType = exports2.derivesFromAnyOrUnknown = exports2.isUnionableType = exports2.preserveUnknown = exports2.areTypesSame = exports2.doForEachSignature = exports2.allSubtypes = exports2.someSubtypes = exports2.doForEachSubtype = exports2.sortTypes = exports2.cleanIncompleteUnknown = exports2.mapSignatures = exports2.mapSubtypes = exports2.makeInferenceContext = exports2.isBuiltInDeprecatedType = exports2.isTypeVarSame = exports2.isIncompleteUnknown = exports2.removeNoneFromUnion = exports2.isNoneTypeClass = exports2.isNoneInstance = exports2.isOptionalType = exports2.UniqueSignatureTracker = exports2.AssignTypeFlags = exports2.ClassIteratorFlags = exports2.MemberAccessFlags = void 0;
|
|
45649
|
-
exports2.requiresTypeArguments = exports2.getGeneratorTypeArgs = exports2.removeParamSpecVariadicsFromFunction = exports2.removeParamSpecVariadicsFromSignature = exports2.specializeTupleClass = exports2.combineSameSizedTuples = exports2.explodeGenericClass = exports2.isPartlyUnknown = exports2.containsAnyOrUnknown = exports2.containsAnyRecursive = exports2.getMembersForModule = exports2.getMembersForClass = exports2.convertToInstantiable = exports2.convertToInstance = exports2.isEffectivelyInstantiable = exports2.isMetaclassInstance = exports2.isInstantiableMetaclass = exports2.getGeneratorYieldType = exports2.getDeclaredGeneratorReturnType = exports2.synthesizeTypeVarForSelfCls = exports2.derivesFromClassRecursive = exports2.derivesFromStdlibClass = exports2.specializeForBaseClass = exports2.buildTypeVarContext = exports2.buildTypeVarContextFromSpecializedClass = exports2.setTypeArgumentsRecursive = exports2.specializeClassType = exports2.
|
|
45650
|
-
exports2.convertParamSpecValueToType = exports2.convertTypeToParamSpecValue = exports2.getDeclaringModulesForType = exports2.computeMroLinearization = exports2.isVarianceOfTypeArgumentCompatible = exports2.combineVariances =
|
|
45654
|
+
exports2.requiresSpecialization = exports2.requiresTypeArguments = exports2.getGeneratorTypeArgs = exports2.removeParamSpecVariadicsFromFunction = exports2.removeParamSpecVariadicsFromSignature = exports2.specializeTupleClass = exports2.combineSameSizedTuples = exports2.explodeGenericClass = exports2.isPartlyUnknown = exports2.containsAnyOrUnknown = exports2.containsAnyRecursive = exports2.getMembersForModule = exports2.getMembersForClass = exports2.convertToInstantiable = exports2.convertToInstance = exports2.isEffectivelyInstantiable = exports2.isMetaclassInstance = exports2.isInstantiableMetaclass = exports2.getGeneratorYieldType = exports2.getDeclaredGeneratorReturnType = exports2.synthesizeTypeVarForSelfCls = exports2.derivesFromClassRecursive = exports2.derivesFromStdlibClass = exports2.specializeForBaseClass = exports2.buildTypeVarContext = exports2.buildTypeVarContextFromSpecializedClass = exports2.setTypeArgumentsRecursive = exports2.specializeClassType = exports2.getTypeVarArgumentsRecursive = exports2.addTypeVarsToListIfUnique = exports2.getClassFieldsRecursive = exports2.getClassIterator = exports2.getClassMemberIterator = exports2.lookUpClassMember = exports2.lookUpObjectMember = exports2.getContainerDepth = exports2.getProtocolSymbolsRecursive = exports2.getProtocolSymbols = exports2.transformExpectedType = exports2.replaceTypeVarsWithAny = exports2.validateTypeVarDefault = exports2.applyInScopePlaceholders = exports2.applySourceContextTypeVarsToSignature = exports2.applySourceContextTypeVars = exports2.applySolvedTypeVars = exports2.ensureFunctionSignaturesAreUnique = exports2.populateTypeVarContextForSelfType = exports2.partiallySpecializeType = exports2.isTupleIndexUnambiguous = exports2.isUnboundedTupleClass = void 0;
|
|
45655
|
+
exports2.convertParamSpecValueToType = exports2.convertTypeToParamSpecValue = exports2.getDeclaringModulesForType = exports2.computeMroLinearization = exports2.isVarianceOfTypeArgumentCompatible = exports2.combineVariances = void 0;
|
|
45651
45656
|
var collectionUtils_1 = require_collectionUtils();
|
|
45652
45657
|
var debug_1 = require_debug();
|
|
45653
45658
|
var symbol_1 = require_symbol();
|
|
@@ -45796,11 +45801,11 @@ var require_typeUtils = __commonJS({
|
|
|
45796
45801
|
return false;
|
|
45797
45802
|
}
|
|
45798
45803
|
exports2.isBuiltInDeprecatedType = isBuiltInDeprecatedType;
|
|
45799
|
-
function makeInferenceContext(expectedType, isTypeIncomplete
|
|
45804
|
+
function makeInferenceContext(expectedType, isTypeIncomplete) {
|
|
45800
45805
|
if (!expectedType) {
|
|
45801
45806
|
return void 0;
|
|
45802
45807
|
}
|
|
45803
|
-
return { expectedType, isTypeIncomplete
|
|
45808
|
+
return { expectedType, isTypeIncomplete };
|
|
45804
45809
|
}
|
|
45805
45810
|
exports2.makeInferenceContext = makeInferenceContext;
|
|
45806
45811
|
function mapSubtypes(type, callback, sortSubtypes = false) {
|
|
@@ -46283,6 +46288,14 @@ var require_typeUtils = __commonJS({
|
|
|
46283
46288
|
if (type.details.typeParameters.length === 0) {
|
|
46284
46289
|
return type;
|
|
46285
46290
|
}
|
|
46291
|
+
if (isTupleClass(type)) {
|
|
46292
|
+
return types_1.ClassType.cloneIncludeSubclasses(specializeTupleClass(
|
|
46293
|
+
type,
|
|
46294
|
+
[{ type: types_1.UnknownType.create(), isUnbounded: true }],
|
|
46295
|
+
/* isTypeArgumentExplicit */
|
|
46296
|
+
false
|
|
46297
|
+
), !!type.includeSubclasses);
|
|
46298
|
+
}
|
|
46286
46299
|
return types_1.ClassType.cloneForSpecialization(
|
|
46287
46300
|
type,
|
|
46288
46301
|
type.details.typeParameters.map((param) => getUnknownTypeForTypeVar(param)),
|
|
@@ -46985,73 +46998,6 @@ var require_typeUtils = __commonJS({
|
|
|
46985
46998
|
return [];
|
|
46986
46999
|
}
|
|
46987
47000
|
exports2.getTypeVarArgumentsRecursive = getTypeVarArgumentsRecursive;
|
|
46988
|
-
function isTypeVarLimitedToCallable(type, typeVar) {
|
|
46989
|
-
const info = getTypeVarWithinTypeInfoRecursive(type, typeVar);
|
|
46990
|
-
return info.isTypeVarUsed && info.isUsedInCallable;
|
|
46991
|
-
}
|
|
46992
|
-
exports2.isTypeVarLimitedToCallable = isTypeVarLimitedToCallable;
|
|
46993
|
-
function getTypeVarWithinTypeInfoRecursive(type, typeVar, recursionCount = 0) {
|
|
46994
|
-
if (recursionCount > types_1.maxTypeRecursionCount) {
|
|
46995
|
-
return { isTypeVarUsed: false, isUsedInCallable: false };
|
|
46996
|
-
}
|
|
46997
|
-
recursionCount++;
|
|
46998
|
-
let typeVarUsedCount = 0;
|
|
46999
|
-
let usedInCallableCount = 0;
|
|
47000
|
-
if ((0, types_1.isTypeVar)(type)) {
|
|
47001
|
-
if (!(0, types_1.isParamSpec)(type) || !type.paramSpecAccess) {
|
|
47002
|
-
if ((0, types_1.isTypeSame)(typeVar, convertToInstance(type))) {
|
|
47003
|
-
typeVarUsedCount++;
|
|
47004
|
-
}
|
|
47005
|
-
}
|
|
47006
|
-
} else if ((0, types_1.isClass)(type)) {
|
|
47007
|
-
if (type.typeArguments) {
|
|
47008
|
-
type.typeArguments.forEach((typeArg) => {
|
|
47009
|
-
const subResult = getTypeVarWithinTypeInfoRecursive(typeArg, typeVar, recursionCount);
|
|
47010
|
-
if (subResult.isTypeVarUsed) {
|
|
47011
|
-
typeVarUsedCount++;
|
|
47012
|
-
}
|
|
47013
|
-
if (subResult.isUsedInCallable) {
|
|
47014
|
-
usedInCallableCount++;
|
|
47015
|
-
}
|
|
47016
|
-
});
|
|
47017
|
-
}
|
|
47018
|
-
} else if ((0, types_1.isUnion)(type)) {
|
|
47019
|
-
doForEachSubtype(type, (subtype) => {
|
|
47020
|
-
const subResult = getTypeVarWithinTypeInfoRecursive(subtype, typeVar, recursionCount);
|
|
47021
|
-
if (subResult.isTypeVarUsed) {
|
|
47022
|
-
typeVarUsedCount++;
|
|
47023
|
-
}
|
|
47024
|
-
if (subResult.isUsedInCallable) {
|
|
47025
|
-
usedInCallableCount++;
|
|
47026
|
-
}
|
|
47027
|
-
});
|
|
47028
|
-
} else if ((0, types_1.isFunction)(type)) {
|
|
47029
|
-
for (let i = 0; i < type.details.parameters.length; i++) {
|
|
47030
|
-
if (getTypeVarWithinTypeInfoRecursive(types_1.FunctionType.getEffectiveParameterType(type, i), typeVar, recursionCount).isTypeVarUsed) {
|
|
47031
|
-
typeVarUsedCount++;
|
|
47032
|
-
}
|
|
47033
|
-
}
|
|
47034
|
-
if (type.details.paramSpec) {
|
|
47035
|
-
if ((0, types_1.isTypeSame)(typeVar, convertToInstance(type.details.paramSpec))) {
|
|
47036
|
-
typeVarUsedCount++;
|
|
47037
|
-
}
|
|
47038
|
-
}
|
|
47039
|
-
const returnType = types_1.FunctionType.getSpecializedReturnType(type);
|
|
47040
|
-
if (returnType) {
|
|
47041
|
-
if (getTypeVarWithinTypeInfoRecursive(returnType, typeVar, recursionCount).isTypeVarUsed) {
|
|
47042
|
-
typeVarUsedCount++;
|
|
47043
|
-
}
|
|
47044
|
-
}
|
|
47045
|
-
if (typeVarUsedCount > 0) {
|
|
47046
|
-
typeVarUsedCount = 1;
|
|
47047
|
-
usedInCallableCount = 1;
|
|
47048
|
-
}
|
|
47049
|
-
}
|
|
47050
|
-
return {
|
|
47051
|
-
isTypeVarUsed: typeVarUsedCount > 0,
|
|
47052
|
-
isUsedInCallable: usedInCallableCount === 1 && typeVarUsedCount === 1
|
|
47053
|
-
};
|
|
47054
|
-
}
|
|
47055
47001
|
function specializeClassType(type) {
|
|
47056
47002
|
const typeVarContext = new typeVarContext_1.TypeVarContext(getTypeVarScopeId(type));
|
|
47057
47003
|
const typeParams = types_1.ClassType.getTypeParameters(type);
|
|
@@ -48229,10 +48175,8 @@ var require_typeUtils = __commonJS({
|
|
|
48229
48175
|
specializationNeeded = true;
|
|
48230
48176
|
} else {
|
|
48231
48177
|
const newTypeArgType = this.apply(typeParams[0], recursionCount);
|
|
48232
|
-
|
|
48233
|
-
|
|
48234
|
-
specializationNeeded = true;
|
|
48235
|
-
}
|
|
48178
|
+
newTupleTypeArgs = [{ type: newTypeArgType, isUnbounded: true }];
|
|
48179
|
+
specializationNeeded = true;
|
|
48236
48180
|
}
|
|
48237
48181
|
}
|
|
48238
48182
|
if (newTupleTypeArgs && newTupleTypeArgs.length > 0) {
|
|
@@ -48556,7 +48500,7 @@ var require_typeUtils = __commonJS({
|
|
|
48556
48500
|
subtype = types_1.ClassType.cloneAsInstance(types_1.ClassType.cloneAsInstantiable(subtype));
|
|
48557
48501
|
}
|
|
48558
48502
|
if (this._options.unknownIfNotFound) {
|
|
48559
|
-
return specializeWithDefaultTypeArgs(subtype);
|
|
48503
|
+
return this._options.useUnknownOverDefault ? specializeWithUnknownTypeArgs(subtype) : specializeWithDefaultTypeArgs(subtype);
|
|
48560
48504
|
}
|
|
48561
48505
|
}
|
|
48562
48506
|
return subtype;
|
|
@@ -48565,7 +48509,9 @@ var require_typeUtils = __commonJS({
|
|
|
48565
48509
|
if ((0, types_1.isTypeVar)(replacement) && typeVar.isVariadicUnpacked && replacement.details.isVariadic) {
|
|
48566
48510
|
return types_1.TypeVarType.cloneForUnpacked(replacement, typeVar.isVariadicInUnion);
|
|
48567
48511
|
}
|
|
48568
|
-
|
|
48512
|
+
if (!(0, types_1.isTypeVar)(replacement) || !replacement.isInScopePlaceholder || !this._options.unknownIfNotFound) {
|
|
48513
|
+
return replacement;
|
|
48514
|
+
}
|
|
48569
48515
|
}
|
|
48570
48516
|
let useDefaultOrUnknown = false;
|
|
48571
48517
|
if (this._options.unknownIfNotFound) {
|
|
@@ -48578,7 +48524,7 @@ var require_typeUtils = __commonJS({
|
|
|
48578
48524
|
useDefaultOrUnknown = true;
|
|
48579
48525
|
}
|
|
48580
48526
|
if (useDefaultOrUnknown) {
|
|
48581
|
-
if (typeVar.details.isDefaultExplicit) {
|
|
48527
|
+
if (typeVar.details.isDefaultExplicit && !this._options.useUnknownOverDefault) {
|
|
48582
48528
|
return this._solveDefaultType(typeVar.details.defaultType, recursionCount);
|
|
48583
48529
|
}
|
|
48584
48530
|
return types_1.UnknownType.create();
|
|
@@ -48656,7 +48602,7 @@ var require_typeUtils = __commonJS({
|
|
|
48656
48602
|
useDefaultOrUnknown = true;
|
|
48657
48603
|
}
|
|
48658
48604
|
if (useDefaultOrUnknown) {
|
|
48659
|
-
if (paramSpec.details.isDefaultExplicit) {
|
|
48605
|
+
if (paramSpec.details.isDefaultExplicit && !this._options.useUnknownOverDefault) {
|
|
48660
48606
|
return convertTypeToParamSpecValue(this._solveDefaultType(paramSpec.details.defaultType, recursionCount));
|
|
48661
48607
|
}
|
|
48662
48608
|
return getUnknownTypeForParamSpec();
|
|
@@ -49909,6 +49855,7 @@ var require_typeEvaluatorTypes = __commonJS({
|
|
|
49909
49855
|
EvaluatorFlags2[EvaluatorFlags2["SkipConvertParamSpecToRuntimeObject"] = 33554432] = "SkipConvertParamSpecToRuntimeObject";
|
|
49910
49856
|
EvaluatorFlags2[EvaluatorFlags2["DisallowNonTypeSpecialForms"] = 67108864] = "DisallowNonTypeSpecialForms";
|
|
49911
49857
|
EvaluatorFlags2[EvaluatorFlags2["AllowConcatenate"] = 134217728] = "AllowConcatenate";
|
|
49858
|
+
EvaluatorFlags2[EvaluatorFlags2["StripLiteralTypeForTuple"] = 268435456] = "StripLiteralTypeForTuple";
|
|
49912
49859
|
EvaluatorFlags2[EvaluatorFlags2["CallBaseDefaults"] = 2] = "CallBaseDefaults";
|
|
49913
49860
|
EvaluatorFlags2[EvaluatorFlags2["IndexBaseDefaults"] = 2] = "IndexBaseDefaults";
|
|
49914
49861
|
EvaluatorFlags2[EvaluatorFlags2["MemberAccessBaseDefaults"] = 2] = "MemberAccessBaseDefaults";
|
|
@@ -50214,24 +50161,24 @@ var require_constraintSolver = __commonJS({
|
|
|
50214
50161
|
}
|
|
50215
50162
|
if (curWideTypeBound && newNarrowTypeBound) {
|
|
50216
50163
|
if (!(0, types_1.isTypeSame)(curWideTypeBound, newNarrowTypeBound, {}, recursionCount)) {
|
|
50217
|
-
let
|
|
50218
|
-
if ((0, types_1.isTypeVar)(curWideTypeBound)) {
|
|
50219
|
-
if ((0, types_1.isTypeSame)(newNarrowTypeBound, curWideTypeBound)) {
|
|
50220
|
-
makeConcrete = false;
|
|
50221
|
-
} else if ((0, types_1.isUnion)(newNarrowTypeBound) && newNarrowTypeBound.subtypes.some((subtype) => (0, types_1.isTypeSame)(subtype, curWideTypeBound))) {
|
|
50222
|
-
makeConcrete = false;
|
|
50223
|
-
}
|
|
50224
|
-
}
|
|
50225
|
-
const adjWideTypeBound = makeConcrete ? evaluator.makeTopLevelTypeVarsConcrete(
|
|
50164
|
+
let adjWideTypeBound = evaluator.makeTopLevelTypeVarsConcrete(
|
|
50226
50165
|
curWideTypeBound,
|
|
50227
50166
|
/* makeParamSpecsConcrete */
|
|
50228
50167
|
true
|
|
50229
|
-
)
|
|
50168
|
+
);
|
|
50169
|
+
adjWideTypeBound = (0, typeUtils_1.transformExpectedType)(
|
|
50170
|
+
adjWideTypeBound,
|
|
50171
|
+
/* liveTypeVarScopes */
|
|
50172
|
+
[],
|
|
50173
|
+
/* usageOffset */
|
|
50174
|
+
void 0
|
|
50175
|
+
);
|
|
50230
50176
|
if (!evaluator.assignType(
|
|
50231
50177
|
adjWideTypeBound,
|
|
50232
50178
|
newNarrowTypeBound,
|
|
50233
50179
|
diag === null || diag === void 0 ? void 0 : diag.createAddendum(),
|
|
50234
|
-
|
|
50180
|
+
/* destTypeVarContext */
|
|
50181
|
+
void 0,
|
|
50235
50182
|
/* srcTypeVarContext */
|
|
50236
50183
|
void 0,
|
|
50237
50184
|
1024,
|
|
@@ -50820,7 +50767,7 @@ var require_parameterUtils = __commonJS({
|
|
|
50820
50767
|
"node_modules/@zzzen/pyright-internal/dist/analyzer/parameterUtils.js"(exports2) {
|
|
50821
50768
|
"use strict";
|
|
50822
50769
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
50823
|
-
exports2.isParamSpecKwargsArgument = exports2.isParamSpecArgsArgument = exports2.getParameterListDetails = exports2.firstParametersExcludingSelf = exports2.
|
|
50770
|
+
exports2.isParamSpecKwargsArgument = exports2.isParamSpecArgsArgument = exports2.getParameterListDetails = exports2.firstParametersExcludingSelf = exports2.ParameterKind = exports2.isTypedKwargs = void 0;
|
|
50824
50771
|
var symbolNameUtils_1 = require_symbolNameUtils();
|
|
50825
50772
|
var types_1 = require_types();
|
|
50826
50773
|
var typeUtils_1 = require_typeUtils();
|
|
@@ -50828,12 +50775,12 @@ var require_parameterUtils = __commonJS({
|
|
|
50828
50775
|
return param.category === 2 && (0, types_1.isClassInstance)(param.type) && (0, types_1.isUnpackedClass)(param.type) && types_1.ClassType.isTypedDictClass(param.type) && !!param.type.details.typedDictEntries;
|
|
50829
50776
|
}
|
|
50830
50777
|
exports2.isTypedKwargs = isTypedKwargs;
|
|
50831
|
-
var
|
|
50832
|
-
(function(
|
|
50833
|
-
|
|
50834
|
-
|
|
50835
|
-
|
|
50836
|
-
})(
|
|
50778
|
+
var ParameterKind;
|
|
50779
|
+
(function(ParameterKind2) {
|
|
50780
|
+
ParameterKind2[ParameterKind2["Positional"] = 0] = "Positional";
|
|
50781
|
+
ParameterKind2[ParameterKind2["Standard"] = 1] = "Standard";
|
|
50782
|
+
ParameterKind2[ParameterKind2["Keyword"] = 2] = "Keyword";
|
|
50783
|
+
})(ParameterKind || (exports2.ParameterKind = ParameterKind = {}));
|
|
50837
50784
|
function firstParametersExcludingSelf(type) {
|
|
50838
50785
|
return type.details.parameters.find((p) => !((0, types_1.isTypeVar)(p.type) && p.type.details.isSynthesizedSelf));
|
|
50839
50786
|
}
|
|
@@ -50876,24 +50823,24 @@ var require_parameterUtils = __commonJS({
|
|
|
50876
50823
|
let sawKeywordOnlySeparator = false;
|
|
50877
50824
|
const addVirtualParameter = (param, index, typeOverride, defaultArgTypeOverride, sourceOverride) => {
|
|
50878
50825
|
if (param.name) {
|
|
50879
|
-
let
|
|
50826
|
+
let kind;
|
|
50880
50827
|
if (sourceOverride !== void 0) {
|
|
50881
|
-
|
|
50828
|
+
kind = sourceOverride;
|
|
50882
50829
|
} else if (param.category === 1) {
|
|
50883
|
-
|
|
50830
|
+
kind = ParameterKind.Positional;
|
|
50884
50831
|
} else if (sawKeywordOnlySeparator) {
|
|
50885
|
-
|
|
50832
|
+
kind = ParameterKind.Keyword;
|
|
50886
50833
|
} else if (positionOnlyIndex >= 0 && index < positionOnlyIndex) {
|
|
50887
|
-
|
|
50834
|
+
kind = ParameterKind.Positional;
|
|
50888
50835
|
} else {
|
|
50889
|
-
|
|
50836
|
+
kind = ParameterKind.Standard;
|
|
50890
50837
|
}
|
|
50891
50838
|
result.params.push({
|
|
50892
50839
|
param,
|
|
50893
50840
|
index,
|
|
50894
50841
|
type: typeOverride !== null && typeOverride !== void 0 ? typeOverride : types_1.FunctionType.getEffectiveParameterType(type, index),
|
|
50895
50842
|
defaultArgType: defaultArgTypeOverride,
|
|
50896
|
-
|
|
50843
|
+
kind
|
|
50897
50844
|
});
|
|
50898
50845
|
}
|
|
50899
50846
|
};
|
|
@@ -50923,7 +50870,7 @@ var require_parameterUtils = __commonJS({
|
|
|
50923
50870
|
tupleArg.type,
|
|
50924
50871
|
/* defaultArgTypeOverride */
|
|
50925
50872
|
void 0,
|
|
50926
|
-
|
|
50873
|
+
ParameterKind.Positional
|
|
50927
50874
|
);
|
|
50928
50875
|
if (category === 0) {
|
|
50929
50876
|
result.positionParamCount++;
|
|
@@ -51011,7 +50958,7 @@ var require_parameterUtils = __commonJS({
|
|
|
51011
50958
|
result.paramSpec = types_1.TypeVarType.cloneForParamSpecAccess(secondLastParam.type, void 0);
|
|
51012
50959
|
}
|
|
51013
50960
|
}
|
|
51014
|
-
result.firstPositionOrKeywordIndex = result.params.findIndex((p) => p.
|
|
50961
|
+
result.firstPositionOrKeywordIndex = result.params.findIndex((p) => p.kind !== ParameterKind.Positional);
|
|
51015
50962
|
if (result.firstPositionOrKeywordIndex < 0) {
|
|
51016
50963
|
result.firstPositionOrKeywordIndex = result.params.length;
|
|
51017
50964
|
}
|
|
@@ -51078,14 +51025,14 @@ var require_constructorTransform = __commonJS({
|
|
|
51078
51025
|
return false;
|
|
51079
51026
|
}
|
|
51080
51027
|
exports2.hasConstructorTransform = hasConstructorTransform;
|
|
51081
|
-
function applyConstructorTransform(evaluator, errorNode, argList, classType, result) {
|
|
51028
|
+
function applyConstructorTransform(evaluator, errorNode, argList, classType, result, signatureTracker) {
|
|
51082
51029
|
if (classType.details.fullName === "functools.partial") {
|
|
51083
|
-
return applyPartialTransform(evaluator, errorNode, argList, result);
|
|
51030
|
+
return applyPartialTransform(evaluator, errorNode, argList, result, signatureTracker);
|
|
51084
51031
|
}
|
|
51085
51032
|
return result;
|
|
51086
51033
|
}
|
|
51087
51034
|
exports2.applyConstructorTransform = applyConstructorTransform;
|
|
51088
|
-
function applyPartialTransform(evaluator, errorNode, argList, result) {
|
|
51035
|
+
function applyPartialTransform(evaluator, errorNode, argList, result, signatureTracker) {
|
|
51089
51036
|
if (!(0, types_1.isClassInstance)(result.returnType) || result.returnType.details.fullName !== "functools.partial") {
|
|
51090
51037
|
return result;
|
|
51091
51038
|
}
|
|
@@ -51105,7 +51052,12 @@ var require_constructorTransform = __commonJS({
|
|
|
51105
51052
|
if (argList.length < 1) {
|
|
51106
51053
|
return result;
|
|
51107
51054
|
}
|
|
51108
|
-
const origFunctionTypeResult = evaluator.getTypeOfArgument(
|
|
51055
|
+
const origFunctionTypeResult = evaluator.getTypeOfArgument(
|
|
51056
|
+
argList[0],
|
|
51057
|
+
/* inferenceContext */
|
|
51058
|
+
void 0,
|
|
51059
|
+
signatureTracker
|
|
51060
|
+
);
|
|
51109
51061
|
let origFunctionType = origFunctionTypeResult.type;
|
|
51110
51062
|
const origFunctionTypeConcrete = evaluator.makeTopLevelTypeVarsConcrete(origFunctionType);
|
|
51111
51063
|
if ((0, types_1.isInstantiableClass)(origFunctionTypeConcrete)) {
|
|
@@ -51198,7 +51150,7 @@ var require_constructorTransform = __commonJS({
|
|
|
51198
51150
|
return;
|
|
51199
51151
|
}
|
|
51200
51152
|
if (!arg.name) {
|
|
51201
|
-
if (argIndex >= paramListDetails.params.length || paramListDetails.params[argIndex].
|
|
51153
|
+
if (argIndex >= paramListDetails.params.length || paramListDetails.params[argIndex].kind === parameterUtils_1.ParameterKind.Keyword) {
|
|
51202
51154
|
if (paramListDetails.argsIndex !== void 0) {
|
|
51203
51155
|
const paramType = types_1.FunctionType.getEffectiveParameterType(origFunctionType, paramListDetails.params[paramListDetails.argsIndex].index);
|
|
51204
51156
|
const diag = new diagnostic_1.DiagnosticAddendum();
|
|
@@ -51256,7 +51208,7 @@ var require_constructorTransform = __commonJS({
|
|
|
51256
51208
|
} else {
|
|
51257
51209
|
const matchingParam = paramListDetails.params.find((paramInfo) => {
|
|
51258
51210
|
var _a2;
|
|
51259
|
-
return paramInfo.param.name === ((_a2 = arg.name) === null || _a2 === void 0 ? void 0 : _a2.value) && paramInfo.
|
|
51211
|
+
return paramInfo.param.name === ((_a2 = arg.name) === null || _a2 === void 0 ? void 0 : _a2.value) && paramInfo.kind !== parameterUtils_1.ParameterKind.Positional;
|
|
51260
51212
|
});
|
|
51261
51213
|
if (!matchingParam) {
|
|
51262
51214
|
if (paramListDetails.kwargsIndex === void 0) {
|
|
@@ -51402,9 +51354,9 @@ var require_constructors = __commonJS({
|
|
|
51402
51354
|
);
|
|
51403
51355
|
}
|
|
51404
51356
|
exports2.getBoundCallMethod = getBoundCallMethod;
|
|
51405
|
-
function validateConstructorArguments(evaluator, errorNode, argList, type, skipUnknownArgCheck, inferenceContext) {
|
|
51357
|
+
function validateConstructorArguments(evaluator, errorNode, argList, type, skipUnknownArgCheck, inferenceContext, signatureTracker) {
|
|
51406
51358
|
var _a;
|
|
51407
|
-
const metaclassResult = validateMetaclassCall(evaluator, errorNode, argList, type, skipUnknownArgCheck, inferenceContext);
|
|
51359
|
+
const metaclassResult = validateMetaclassCall(evaluator, errorNode, argList, type, skipUnknownArgCheck, inferenceContext, signatureTracker);
|
|
51408
51360
|
if (metaclassResult) {
|
|
51409
51361
|
const metaclassReturnType = (_a = metaclassResult.returnType) !== null && _a !== void 0 ? _a : types_1.UnknownType.create();
|
|
51410
51362
|
if (metaclassResult.argumentErrors || shouldSkipNewAndInitEvaluation(evaluator, type, metaclassReturnType)) {
|
|
@@ -51418,19 +51370,19 @@ var require_constructors = __commonJS({
|
|
|
51418
51370
|
}
|
|
51419
51371
|
const useConstructorTransform = (0, constructorTransform_1.hasConstructorTransform)(type);
|
|
51420
51372
|
const returnResult = evaluator.useSpeculativeMode(useConstructorTransform ? errorNode : void 0, () => {
|
|
51421
|
-
return validateNewAndInitMethods(evaluator, errorNode, argList, type, skipUnknownArgCheck, inferenceContext, newMethodTypeResult);
|
|
51373
|
+
return validateNewAndInitMethods(evaluator, errorNode, argList, type, skipUnknownArgCheck, inferenceContext, signatureTracker, newMethodTypeResult);
|
|
51422
51374
|
});
|
|
51423
51375
|
let validatedArgExpressions = !useConstructorTransform || returnResult.argumentErrors;
|
|
51424
51376
|
if (useConstructorTransform) {
|
|
51425
51377
|
if (returnResult.argumentErrors) {
|
|
51426
|
-
validateNewAndInitMethods(evaluator, errorNode, argList, type, skipUnknownArgCheck, inferenceContext, newMethodTypeResult);
|
|
51378
|
+
validateNewAndInitMethods(evaluator, errorNode, argList, type, skipUnknownArgCheck, inferenceContext, signatureTracker, newMethodTypeResult);
|
|
51427
51379
|
validatedArgExpressions = true;
|
|
51428
51380
|
} else if (returnResult.returnType) {
|
|
51429
51381
|
const transformed = (0, constructorTransform_1.applyConstructorTransform)(evaluator, errorNode, argList, type, {
|
|
51430
51382
|
argumentErrors: !!returnResult.argumentErrors,
|
|
51431
51383
|
returnType: returnResult.returnType,
|
|
51432
51384
|
isTypeIncomplete: !!returnResult.isTypeIncomplete
|
|
51433
|
-
});
|
|
51385
|
+
}, signatureTracker);
|
|
51434
51386
|
returnResult.returnType = transformed.returnType;
|
|
51435
51387
|
if (transformed.isTypeIncomplete) {
|
|
51436
51388
|
returnResult.isTypeIncomplete = true;
|
|
@@ -51451,7 +51403,7 @@ var require_constructors = __commonJS({
|
|
|
51451
51403
|
return returnResult;
|
|
51452
51404
|
}
|
|
51453
51405
|
exports2.validateConstructorArguments = validateConstructorArguments;
|
|
51454
|
-
function validateNewAndInitMethods(evaluator, errorNode, argList, type, skipUnknownArgCheck, inferenceContext, newMethodTypeResult) {
|
|
51406
|
+
function validateNewAndInitMethods(evaluator, errorNode, argList, type, skipUnknownArgCheck, inferenceContext, signatureTracker, newMethodTypeResult) {
|
|
51455
51407
|
var _a, _b;
|
|
51456
51408
|
let returnType;
|
|
51457
51409
|
let validatedArgExpressions = false;
|
|
@@ -51467,6 +51419,7 @@ var require_constructors = __commonJS({
|
|
|
51467
51419
|
type,
|
|
51468
51420
|
skipUnknownArgCheck,
|
|
51469
51421
|
inferenceContext,
|
|
51422
|
+
signatureTracker,
|
|
51470
51423
|
newMethodTypeResult,
|
|
51471
51424
|
/* useSpeculativeModeForArgs */
|
|
51472
51425
|
true
|
|
@@ -51498,7 +51451,7 @@ var require_constructors = __commonJS({
|
|
|
51498
51451
|
evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, initMethodDiag.getString(), errorNode);
|
|
51499
51452
|
}
|
|
51500
51453
|
if (initMethodTypeResult) {
|
|
51501
|
-
const initCallResult = validateInitMethod(evaluator, errorNode, argList, initMethodBindToType, skipUnknownArgCheck, inferenceContext, initMethodTypeResult.type);
|
|
51454
|
+
const initCallResult = validateInitMethod(evaluator, errorNode, argList, initMethodBindToType, skipUnknownArgCheck, inferenceContext, signatureTracker, initMethodTypeResult.type);
|
|
51502
51455
|
if (initCallResult.argumentErrors) {
|
|
51503
51456
|
argumentErrors = true;
|
|
51504
51457
|
} else if (initCallResult.overloadsUsedForCall) {
|
|
@@ -51521,6 +51474,7 @@ var require_constructors = __commonJS({
|
|
|
51521
51474
|
type,
|
|
51522
51475
|
skipUnknownArgCheck,
|
|
51523
51476
|
inferenceContext,
|
|
51477
|
+
signatureTracker,
|
|
51524
51478
|
newMethodTypeResult,
|
|
51525
51479
|
/* useSpeculativeModeForArgs */
|
|
51526
51480
|
false
|
|
@@ -51543,13 +51497,13 @@ var require_constructors = __commonJS({
|
|
|
51543
51497
|
}
|
|
51544
51498
|
return { argumentErrors, returnType, isTypeIncomplete, overloadsUsedForCall };
|
|
51545
51499
|
}
|
|
51546
|
-
function validateNewMethod(evaluator, errorNode, argList, type, skipUnknownArgCheck, inferenceContext, newMethodTypeResult, useSpeculativeModeForArgs) {
|
|
51500
|
+
function validateNewMethod(evaluator, errorNode, argList, type, skipUnknownArgCheck, inferenceContext, signatureTracker, newMethodTypeResult, useSpeculativeModeForArgs) {
|
|
51547
51501
|
let newReturnType;
|
|
51548
51502
|
let isTypeIncomplete = false;
|
|
51549
51503
|
let argumentErrors = false;
|
|
51550
51504
|
const overloadsUsedForCall = [];
|
|
51551
|
-
if (
|
|
51552
|
-
newMethodTypeResult.type = (0, typeUtils_1.ensureFunctionSignaturesAreUnique)(newMethodTypeResult.type,
|
|
51505
|
+
if (signatureTracker) {
|
|
51506
|
+
newMethodTypeResult.type = (0, typeUtils_1.ensureFunctionSignaturesAreUnique)(newMethodTypeResult.type, signatureTracker, errorNode.start);
|
|
51553
51507
|
}
|
|
51554
51508
|
const typeVarContext = new typeVarContext_1.TypeVarContext((0, typeUtils_1.getTypeVarScopeId)(type));
|
|
51555
51509
|
typeVarContext.addSolveForScope((0, typeUtils_1.getTypeVarScopeId)(newMethodTypeResult.type));
|
|
@@ -51557,7 +51511,7 @@ var require_constructors = __commonJS({
|
|
|
51557
51511
|
typeVarContext.addSolveForScope(type.typeAliasInfo.typeVarScopeId);
|
|
51558
51512
|
}
|
|
51559
51513
|
const callResult = evaluator.useSpeculativeMode(useSpeculativeModeForArgs ? errorNode : void 0, () => {
|
|
51560
|
-
return evaluator.validateCallArguments(errorNode, argList, newMethodTypeResult, typeVarContext, skipUnknownArgCheck, inferenceContext);
|
|
51514
|
+
return evaluator.validateCallArguments(errorNode, argList, newMethodTypeResult, typeVarContext, skipUnknownArgCheck, inferenceContext, signatureTracker);
|
|
51561
51515
|
});
|
|
51562
51516
|
if (callResult.isTypeIncomplete) {
|
|
51563
51517
|
isTypeIncomplete = true;
|
|
@@ -51565,7 +51519,7 @@ var require_constructors = __commonJS({
|
|
|
51565
51519
|
if (callResult.argumentErrors) {
|
|
51566
51520
|
argumentErrors = true;
|
|
51567
51521
|
typeVarContext.unlock();
|
|
51568
|
-
evaluator.validateCallArguments(errorNode, argList, newMethodTypeResult, typeVarContext, skipUnknownArgCheck);
|
|
51522
|
+
evaluator.validateCallArguments(errorNode, argList, newMethodTypeResult, typeVarContext, skipUnknownArgCheck, inferenceContext, signatureTracker);
|
|
51569
51523
|
} else {
|
|
51570
51524
|
newReturnType = callResult.returnType;
|
|
51571
51525
|
if (overloadsUsedForCall.length === 0 && callResult.overloadsUsedForCall) {
|
|
@@ -51586,13 +51540,13 @@ var require_constructors = __commonJS({
|
|
|
51586
51540
|
}
|
|
51587
51541
|
return { argumentErrors, returnType: newReturnType, isTypeIncomplete, overloadsUsedForCall };
|
|
51588
51542
|
}
|
|
51589
|
-
function validateInitMethod(evaluator, errorNode, argList, type, skipUnknownArgCheck, inferenceContext, initMethodType) {
|
|
51543
|
+
function validateInitMethod(evaluator, errorNode, argList, type, skipUnknownArgCheck, inferenceContext, signatureTracker, initMethodType) {
|
|
51590
51544
|
let returnType;
|
|
51591
51545
|
let isTypeIncomplete = false;
|
|
51592
51546
|
let argumentErrors = false;
|
|
51593
51547
|
const overloadsUsedForCall = [];
|
|
51594
|
-
if (
|
|
51595
|
-
initMethodType = (0, typeUtils_1.ensureFunctionSignaturesAreUnique)(initMethodType,
|
|
51548
|
+
if (signatureTracker) {
|
|
51549
|
+
initMethodType = (0, typeUtils_1.ensureFunctionSignaturesAreUnique)(initMethodType, signatureTracker, errorNode.start);
|
|
51596
51550
|
}
|
|
51597
51551
|
if (inferenceContext) {
|
|
51598
51552
|
let foundWorkingExpectedType = false;
|
|
@@ -51612,10 +51566,28 @@ var require_constructors = __commonJS({
|
|
|
51612
51566
|
const specializedConstructor = (0, typeUtils_1.applySolvedTypeVars)(initMethodType, typeVarContext);
|
|
51613
51567
|
let callResult;
|
|
51614
51568
|
callResult = evaluator.useSpeculativeMode(errorNode, () => {
|
|
51615
|
-
return evaluator.validateCallArguments(
|
|
51569
|
+
return evaluator.validateCallArguments(
|
|
51570
|
+
errorNode,
|
|
51571
|
+
argList,
|
|
51572
|
+
{ type: specializedConstructor },
|
|
51573
|
+
typeVarContext.clone(),
|
|
51574
|
+
skipUnknownArgCheck,
|
|
51575
|
+
/* inferenceContext */
|
|
51576
|
+
void 0,
|
|
51577
|
+
signatureTracker
|
|
51578
|
+
);
|
|
51616
51579
|
});
|
|
51617
51580
|
if (!callResult.argumentErrors) {
|
|
51618
|
-
callResult = evaluator.validateCallArguments(
|
|
51581
|
+
callResult = evaluator.validateCallArguments(
|
|
51582
|
+
errorNode,
|
|
51583
|
+
argList,
|
|
51584
|
+
{ type: specializedConstructor },
|
|
51585
|
+
typeVarContext,
|
|
51586
|
+
skipUnknownArgCheck,
|
|
51587
|
+
/* inferenceContext */
|
|
51588
|
+
void 0,
|
|
51589
|
+
signatureTracker
|
|
51590
|
+
);
|
|
51619
51591
|
if (callResult.isTypeIncomplete) {
|
|
51620
51592
|
isTypeIncomplete = true;
|
|
51621
51593
|
}
|
|
@@ -51641,7 +51613,16 @@ var require_constructors = __commonJS({
|
|
|
51641
51613
|
if (!returnType) {
|
|
51642
51614
|
const typeVarContext = type.typeArguments ? (0, typeUtils_1.buildTypeVarContextFromSpecializedClass)(type) : new typeVarContext_1.TypeVarContext((0, typeUtils_1.getTypeVarScopeId)(type));
|
|
51643
51615
|
typeVarContext.addSolveForScope((0, typeUtils_1.getTypeVarScopeId)(initMethodType));
|
|
51644
|
-
const callResult = evaluator.validateCallArguments(
|
|
51616
|
+
const callResult = evaluator.validateCallArguments(
|
|
51617
|
+
errorNode,
|
|
51618
|
+
argList,
|
|
51619
|
+
{ type: initMethodType },
|
|
51620
|
+
typeVarContext,
|
|
51621
|
+
skipUnknownArgCheck,
|
|
51622
|
+
/* inferenceContext */
|
|
51623
|
+
void 0,
|
|
51624
|
+
signatureTracker
|
|
51625
|
+
);
|
|
51645
51626
|
let adjustedClassType = type;
|
|
51646
51627
|
if (callResult.specializedInitSelfType && (0, types_1.isClassInstance)(callResult.specializedInitSelfType) && types_1.ClassType.isSameGenericClass(callResult.specializedInitSelfType, adjustedClassType)) {
|
|
51647
51628
|
adjustedClassType = types_1.ClassType.cloneAsInstantiable(callResult.specializedInitSelfType);
|
|
@@ -51704,7 +51685,7 @@ var require_constructors = __commonJS({
|
|
|
51704
51685
|
returnType: applyExpectedTypeForConstructor(evaluator, type, inferenceContext, typeVarContext)
|
|
51705
51686
|
};
|
|
51706
51687
|
}
|
|
51707
|
-
function validateMetaclassCall(evaluator, errorNode, argList, type, skipUnknownArgCheck, inferenceContext) {
|
|
51688
|
+
function validateMetaclassCall(evaluator, errorNode, argList, type, skipUnknownArgCheck, inferenceContext, signatureTracker) {
|
|
51708
51689
|
const metaclassCallMethodInfo = getBoundCallMethod(evaluator, errorNode, type);
|
|
51709
51690
|
if (!metaclassCallMethodInfo) {
|
|
51710
51691
|
return void 0;
|
|
@@ -51716,7 +51697,8 @@ var require_constructors = __commonJS({
|
|
|
51716
51697
|
/* typeVarContext */
|
|
51717
51698
|
void 0,
|
|
51718
51699
|
skipUnknownArgCheck,
|
|
51719
|
-
inferenceContext
|
|
51700
|
+
inferenceContext,
|
|
51701
|
+
signatureTracker
|
|
51720
51702
|
);
|
|
51721
51703
|
const callType = metaclassCallMethodInfo.type;
|
|
51722
51704
|
if ((0, types_1.isFunction)(callType) && !callType.details.declaredReturnType) {
|
|
@@ -52186,7 +52168,8 @@ var require_deprecatedSymbols = __commonJS({
|
|
|
52186
52168
|
{
|
|
52187
52169
|
version: pythonVersion_1.pythonVersion3_9,
|
|
52188
52170
|
fullName: "typing.AbstractSet",
|
|
52189
|
-
replacementText: "collections.abc.Set"
|
|
52171
|
+
replacementText: "collections.abc.Set",
|
|
52172
|
+
typingImportOnly: true
|
|
52190
52173
|
}
|
|
52191
52174
|
],
|
|
52192
52175
|
[
|
|
@@ -53684,6 +53667,7 @@ var require_typeGuards = __commonJS({
|
|
|
53684
53667
|
var parseNodes_1 = require_parseNodes();
|
|
53685
53668
|
var analyzerNodeInfo_1 = require_analyzerNodeInfo();
|
|
53686
53669
|
var constraintSolver_1 = require_constraintSolver();
|
|
53670
|
+
var enums_1 = require_enums();
|
|
53687
53671
|
var ParseTreeUtils = __importStar(require_parseTreeUtils());
|
|
53688
53672
|
var scopeUtils_1 = require_scopeUtils();
|
|
53689
53673
|
var symbol_1 = require_symbol();
|
|
@@ -53988,8 +53972,8 @@ var require_typeGuards = __commonJS({
|
|
|
53988
53972
|
const isInstanceCheck = callType.details.builtInName === "isinstance";
|
|
53989
53973
|
const arg1TypeResult = evaluator.getTypeOfExpression(
|
|
53990
53974
|
arg1Expr,
|
|
53991
|
-
512 | 8 | 32 | 64
|
|
53992
|
-
/* EvaluatorFlags.
|
|
53975
|
+
512 | 8 | 32 | 64 | 16 | 2
|
|
53976
|
+
/* EvaluatorFlags.DoNotSpecialize */
|
|
53993
53977
|
);
|
|
53994
53978
|
const arg1Type = arg1TypeResult.type;
|
|
53995
53979
|
const classTypeList = getIsInstanceClassTypes(arg1Type);
|
|
@@ -53997,7 +53981,16 @@ var require_typeGuards = __commonJS({
|
|
|
53997
53981
|
if (classTypeList) {
|
|
53998
53982
|
return (type) => {
|
|
53999
53983
|
return {
|
|
54000
|
-
type: narrowTypeForIsInstance(
|
|
53984
|
+
type: narrowTypeForIsInstance(
|
|
53985
|
+
evaluator,
|
|
53986
|
+
type,
|
|
53987
|
+
classTypeList,
|
|
53988
|
+
isInstanceCheck,
|
|
53989
|
+
/* isTypeIsCheck */
|
|
53990
|
+
false,
|
|
53991
|
+
isPositiveTest,
|
|
53992
|
+
testExpression
|
|
53993
|
+
),
|
|
54001
53994
|
isIncomplete
|
|
54002
53995
|
};
|
|
54003
53996
|
};
|
|
@@ -54213,6 +54206,8 @@ var require_typeGuards = __commonJS({
|
|
|
54213
54206
|
filterTypes,
|
|
54214
54207
|
/* isInstanceCheck */
|
|
54215
54208
|
true,
|
|
54209
|
+
/* isTypeIsCheck */
|
|
54210
|
+
true,
|
|
54216
54211
|
isPositiveTest,
|
|
54217
54212
|
errorNode
|
|
54218
54213
|
);
|
|
@@ -54323,6 +54318,12 @@ var require_typeGuards = __commonJS({
|
|
|
54323
54318
|
const classTypeList = [];
|
|
54324
54319
|
const addClassTypesToList = (types) => {
|
|
54325
54320
|
types.forEach((subtype) => {
|
|
54321
|
+
if ((0, types_1.isClass)(subtype)) {
|
|
54322
|
+
subtype = (0, typeUtils_1.specializeWithUnknownTypeArgs)(subtype);
|
|
54323
|
+
if ((0, types_1.isInstantiableClass)(subtype) && types_1.ClassType.isBuiltIn(subtype, "Callable")) {
|
|
54324
|
+
subtype = (0, typeUtils_1.convertToInstantiable)((0, typeUtils_1.getUnknownTypeForCallable)());
|
|
54325
|
+
}
|
|
54326
|
+
}
|
|
54326
54327
|
if ((0, types_1.isInstantiableClass)(subtype) || (0, types_1.isTypeVar)(subtype) && types_1.TypeBase.isInstantiable(subtype)) {
|
|
54327
54328
|
classTypeList.push(subtype);
|
|
54328
54329
|
} else if ((0, typeUtils_1.isNoneTypeClass)(subtype)) {
|
|
@@ -54389,12 +54390,13 @@ var require_typeGuards = __commonJS({
|
|
|
54389
54390
|
return false;
|
|
54390
54391
|
}
|
|
54391
54392
|
exports2.isIsinstanceFilterSubclass = isIsinstanceFilterSubclass;
|
|
54392
|
-
function narrowTypeForIsInstance(evaluator, type, filterTypes, isInstanceCheck, isPositiveTest, errorNode) {
|
|
54393
|
+
function narrowTypeForIsInstance(evaluator, type, filterTypes, isInstanceCheck, isTypeIsCheck, isPositiveTest, errorNode) {
|
|
54393
54394
|
const narrowedType = narrowTypeForIsInstanceInternal(
|
|
54394
54395
|
evaluator,
|
|
54395
54396
|
type,
|
|
54396
54397
|
filterTypes,
|
|
54397
54398
|
isInstanceCheck,
|
|
54399
|
+
isTypeIsCheck,
|
|
54398
54400
|
isPositiveTest,
|
|
54399
54401
|
/* allowIntersections */
|
|
54400
54402
|
false,
|
|
@@ -54408,13 +54410,14 @@ var require_typeGuards = __commonJS({
|
|
|
54408
54410
|
type,
|
|
54409
54411
|
filterTypes,
|
|
54410
54412
|
isInstanceCheck,
|
|
54413
|
+
isTypeIsCheck,
|
|
54411
54414
|
isPositiveTest,
|
|
54412
54415
|
/* allowIntersections */
|
|
54413
54416
|
true,
|
|
54414
54417
|
errorNode
|
|
54415
54418
|
);
|
|
54416
54419
|
}
|
|
54417
|
-
function narrowTypeForIsInstanceInternal(evaluator, type, filterTypes, isInstanceCheck, isPositiveTest, allowIntersections, errorNode) {
|
|
54420
|
+
function narrowTypeForIsInstanceInternal(evaluator, type, filterTypes, isInstanceCheck, isTypeIsCheck, isPositiveTest, allowIntersections, errorNode) {
|
|
54418
54421
|
let expandedTypes = (0, typeUtils_1.mapSubtypes)(type, (subtype) => {
|
|
54419
54422
|
return (0, typeUtils_1.transformPossibleRecursiveTypeAlias)(subtype);
|
|
54420
54423
|
});
|
|
@@ -54426,17 +54429,24 @@ var require_typeGuards = __commonJS({
|
|
|
54426
54429
|
for (const filterType of filterTypes) {
|
|
54427
54430
|
let concreteFilterType = evaluator.makeTopLevelTypeVarsConcrete(filterType);
|
|
54428
54431
|
if ((0, types_1.isInstantiableClass)(concreteFilterType)) {
|
|
54429
|
-
|
|
54430
|
-
|
|
54431
|
-
|
|
54432
|
-
|
|
54433
|
-
|
|
54434
|
-
|
|
54435
|
-
|
|
54436
|
-
|
|
54432
|
+
let filterIsSuperclass;
|
|
54433
|
+
let filterIsSubclass;
|
|
54434
|
+
if (isTypeIsCheck) {
|
|
54435
|
+
filterIsSuperclass = evaluator.assignType(filterType, concreteVarType);
|
|
54436
|
+
filterIsSubclass = evaluator.assignType(concreteVarType, filterType);
|
|
54437
|
+
} else {
|
|
54438
|
+
if (concreteFilterType.typeArguments && !concreteFilterType.isTypeArgumentExplicit) {
|
|
54439
|
+
concreteFilterType = (0, typeUtils_1.specializeWithUnknownTypeArgs)(types_1.ClassType.cloneForSpecialization(
|
|
54440
|
+
concreteFilterType,
|
|
54441
|
+
/* typeArguments */
|
|
54442
|
+
void 0,
|
|
54443
|
+
/* isTypeArgumentExplicit */
|
|
54444
|
+
false
|
|
54445
|
+
));
|
|
54446
|
+
}
|
|
54447
|
+
filterIsSuperclass = isIsinstanceFilterSuperclass(evaluator, varType, concreteVarType, filterType, concreteFilterType, isInstanceCheck);
|
|
54448
|
+
filterIsSubclass = isIsinstanceFilterSubclass(evaluator, concreteVarType, concreteFilterType, isInstanceCheck);
|
|
54437
54449
|
}
|
|
54438
|
-
const filterIsSuperclass = isIsinstanceFilterSuperclass(evaluator, varType, concreteVarType, filterType, concreteFilterType, isInstanceCheck);
|
|
54439
|
-
const filterIsSubclass = isIsinstanceFilterSubclass(evaluator, concreteVarType, concreteFilterType, isInstanceCheck);
|
|
54440
54450
|
if (filterIsSuperclass) {
|
|
54441
54451
|
foundSuperclass = true;
|
|
54442
54452
|
}
|
|
@@ -54469,24 +54479,26 @@ var require_typeGuards = __commonJS({
|
|
|
54469
54479
|
let specializedFilterType = filterType;
|
|
54470
54480
|
if ((0, types_1.isClass)(filterType)) {
|
|
54471
54481
|
if (types_1.ClassType.isSpecialBuiltIn(filterType) || filterType.details.typeParameters.length > 0) {
|
|
54472
|
-
|
|
54473
|
-
|
|
54474
|
-
|
|
54475
|
-
|
|
54476
|
-
|
|
54477
|
-
|
|
54478
|
-
|
|
54479
|
-
|
|
54480
|
-
|
|
54481
|
-
|
|
54482
|
-
|
|
54483
|
-
|
|
54484
|
-
|
|
54485
|
-
|
|
54486
|
-
|
|
54487
|
-
|
|
54488
|
-
|
|
54489
|
-
|
|
54482
|
+
if (!filterType.typeArguments || !filterType.isTypeArgumentExplicit || !types_1.ClassType.isSameGenericClass(concreteVarType, filterType)) {
|
|
54483
|
+
const typeVarContext = new typeVarContext_1.TypeVarContext((0, typeUtils_1.getTypeVarScopeId)(filterType));
|
|
54484
|
+
const unspecializedFilterType = types_1.ClassType.cloneForSpecialization(
|
|
54485
|
+
filterType,
|
|
54486
|
+
/* typeArguments */
|
|
54487
|
+
void 0,
|
|
54488
|
+
/* isTypeArgumentExplicit */
|
|
54489
|
+
false
|
|
54490
|
+
);
|
|
54491
|
+
if ((0, constraintSolver_1.populateTypeVarContextBasedOnExpectedType)(
|
|
54492
|
+
evaluator,
|
|
54493
|
+
unspecializedFilterType,
|
|
54494
|
+
concreteVarType,
|
|
54495
|
+
typeVarContext,
|
|
54496
|
+
/* liveTypeVarScopes */
|
|
54497
|
+
void 0,
|
|
54498
|
+
errorNode.start
|
|
54499
|
+
)) {
|
|
54500
|
+
specializedFilterType = (0, typeUtils_1.applySolvedTypeVars)(unspecializedFilterType, typeVarContext, { unknownIfNotFound: true, useUnknownOverDefault: true });
|
|
54501
|
+
}
|
|
54490
54502
|
}
|
|
54491
54503
|
}
|
|
54492
54504
|
}
|
|
@@ -54726,7 +54738,7 @@ var require_typeGuards = __commonJS({
|
|
|
54726
54738
|
}
|
|
54727
54739
|
}
|
|
54728
54740
|
if ((0, types_1.isClassInstance)(subtype)) {
|
|
54729
|
-
return (0, types_1.combineTypes)(filterClassType(
|
|
54741
|
+
return (0, types_1.combineTypes)(filterClassType(unexpandedSubtype, types_1.ClassType.cloneAsInstantiable(subtype), (0, typeUtils_1.getTypeCondition)(subtype), negativeFallback));
|
|
54730
54742
|
}
|
|
54731
54743
|
if (((0, types_1.isFunction)(subtype) || (0, types_1.isOverloadedFunction)(subtype)) && isInstanceCheck) {
|
|
54732
54744
|
return (0, types_1.combineTypes)(filterFunctionType(subtype, (0, typeUtils_1.convertToInstance)(unexpandedSubtype)));
|
|
@@ -54796,6 +54808,9 @@ var require_typeGuards = __commonJS({
|
|
|
54796
54808
|
false
|
|
54797
54809
|
);
|
|
54798
54810
|
}
|
|
54811
|
+
if ((0, types_1.isParamSpec)(subtype) && subtype.paramSpecAccess) {
|
|
54812
|
+
return subtype;
|
|
54813
|
+
}
|
|
54799
54814
|
const maxTupleUnionExpansion = 32;
|
|
54800
54815
|
if (elementsToAdd > maxTupleUnionExpansion) {
|
|
54801
54816
|
return subtype;
|
|
@@ -55229,9 +55244,11 @@ var require_typeGuards = __commonJS({
|
|
|
55229
55244
|
}
|
|
55230
55245
|
const enumList = [];
|
|
55231
55246
|
const fields = types_1.ClassType.getSymbolTable(type);
|
|
55232
|
-
fields.forEach((symbol) => {
|
|
55247
|
+
fields.forEach((symbol, name) => {
|
|
55248
|
+
var _a;
|
|
55233
55249
|
if (!symbol.isIgnoredForProtocolMatch()) {
|
|
55234
|
-
|
|
55250
|
+
let symbolType = evaluator.getEffectiveTypeOfSymbol(symbol);
|
|
55251
|
+
symbolType = (_a = (0, enums_1.transformTypeForEnumMember)(evaluator, type, name)) !== null && _a !== void 0 ? _a : symbolType;
|
|
55235
55252
|
if ((0, types_1.isClassInstance)(symbolType) && types_1.ClassType.isSameGenericClass(type, symbolType) && symbolType.literalValue !== void 0) {
|
|
55236
55253
|
enumList.push(symbolType);
|
|
55237
55254
|
}
|
|
@@ -55344,7 +55361,7 @@ var require_enums = __commonJS({
|
|
|
55344
55361
|
"node_modules/@zzzen/pyright-internal/dist/analyzer/enums.js"(exports2) {
|
|
55345
55362
|
"use strict";
|
|
55346
55363
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
55347
|
-
exports2.getEnumAutoValueType = exports2.getTypeOfEnumMember = exports2.getEnumDeclaredValueType = exports2.isDeclInEnumClass = exports2.
|
|
55364
|
+
exports2.getEnumAutoValueType = exports2.getTypeOfEnumMember = exports2.getEnumDeclaredValueType = exports2.isDeclInEnumClass = exports2.transformTypeForEnumMember = exports2.createEnumType = exports2.isEnumClassWithMembers = exports2.isEnumMetaclass = void 0;
|
|
55348
55365
|
var debug_1 = require_debug();
|
|
55349
55366
|
var analyzerNodeInfo_1 = require_analyzerNodeInfo();
|
|
55350
55367
|
var parseTreeUtils_1 = require_parseTreeUtils();
|
|
@@ -55361,14 +55378,14 @@ var require_enums = __commonJS({
|
|
|
55361
55378
|
if (!(0, types_1.isClass)(classType) || !types_1.ClassType.isEnumClass(classType)) {
|
|
55362
55379
|
return false;
|
|
55363
55380
|
}
|
|
55364
|
-
let
|
|
55365
|
-
types_1.ClassType.getSymbolTable(classType).forEach((symbol) => {
|
|
55366
|
-
const symbolType = evaluator
|
|
55367
|
-
if ((0, types_1.isClassInstance)(symbolType) && types_1.ClassType.isSameGenericClass(symbolType, classType)) {
|
|
55368
|
-
|
|
55381
|
+
let definesMember = false;
|
|
55382
|
+
types_1.ClassType.getSymbolTable(classType).forEach((symbol, name) => {
|
|
55383
|
+
const symbolType = transformTypeForEnumMember(evaluator, classType, name);
|
|
55384
|
+
if (symbolType && (0, types_1.isClassInstance)(symbolType) && types_1.ClassType.isSameGenericClass(symbolType, classType)) {
|
|
55385
|
+
definesMember = true;
|
|
55369
55386
|
}
|
|
55370
55387
|
});
|
|
55371
|
-
return
|
|
55388
|
+
return definesMember;
|
|
55372
55389
|
}
|
|
55373
55390
|
exports2.isEnumClassWithMembers = isEnumClassWithMembers;
|
|
55374
55391
|
function createEnumType(evaluator, errorNode, enumClass, argList) {
|
|
@@ -55490,33 +55507,46 @@ var require_enums = __commonJS({
|
|
|
55490
55507
|
return classType;
|
|
55491
55508
|
}
|
|
55492
55509
|
exports2.createEnumType = createEnumType;
|
|
55493
|
-
function
|
|
55494
|
-
var _a, _b, _c, _d;
|
|
55495
|
-
|
|
55496
|
-
statementNode,
|
|
55497
|
-
/* stopAtFunction */
|
|
55498
|
-
true
|
|
55499
|
-
);
|
|
55500
|
-
if (!enclosingClassNode) {
|
|
55510
|
+
function transformTypeForEnumMember(evaluator, classType, memberName, recursionCount = 0) {
|
|
55511
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
55512
|
+
if (recursionCount > types_1.maxTypeRecursionCount) {
|
|
55501
55513
|
return void 0;
|
|
55502
55514
|
}
|
|
55503
|
-
|
|
55504
|
-
if (!
|
|
55515
|
+
recursionCount++;
|
|
55516
|
+
if (!types_1.ClassType.isEnumClass(classType)) {
|
|
55505
55517
|
return void 0;
|
|
55506
55518
|
}
|
|
55519
|
+
const memberInfo = (0, typeUtils_1.lookUpClassMember)(classType, memberName);
|
|
55520
|
+
if (!memberInfo || !(0, types_1.isClass)(memberInfo.classType) || !types_1.ClassType.isEnumClass(memberInfo.classType)) {
|
|
55521
|
+
return void 0;
|
|
55522
|
+
}
|
|
55523
|
+
const decls = memberInfo.symbol.getDeclarations();
|
|
55524
|
+
if (decls.length < 1) {
|
|
55525
|
+
return void 0;
|
|
55526
|
+
}
|
|
55527
|
+
const primaryDecl = decls[0];
|
|
55507
55528
|
let isMemberOfEnumeration = false;
|
|
55508
55529
|
let isUnpackedTuple = false;
|
|
55509
|
-
|
|
55530
|
+
let valueTypeExprNode;
|
|
55531
|
+
let declaredTypeNode;
|
|
55532
|
+
let nameNode;
|
|
55533
|
+
if (primaryDecl.node.nodeType === 38) {
|
|
55534
|
+
nameNode = primaryDecl.node;
|
|
55535
|
+
} else if (primaryDecl.node.nodeType === 28) {
|
|
55536
|
+
nameNode = primaryDecl.node.name;
|
|
55537
|
+
} else {
|
|
55538
|
+
return void 0;
|
|
55539
|
+
}
|
|
55540
|
+
if (((_a = nameNode.parent) === null || _a === void 0 ? void 0 : _a.nodeType) === 3 && nameNode.parent.leftExpression === nameNode) {
|
|
55510
55541
|
isMemberOfEnumeration = true;
|
|
55511
|
-
|
|
55512
|
-
|
|
55513
|
-
52
|
|
55514
|
-
/* ParseNodeType.Tuple */
|
|
55515
|
-
)) {
|
|
55516
|
-
isUnpackedTuple = true;
|
|
55517
|
-
}
|
|
55518
|
-
} else if ((0, analyzerNodeInfo_1.getFileInfo)(nameNode).isStubFile && ((_a = nameNode.parent) === null || _a === void 0 ? void 0 : _a.nodeType) === 54 && nameNode.parent.valueExpression === nameNode) {
|
|
55542
|
+
valueTypeExprNode = nameNode.parent.rightExpression;
|
|
55543
|
+
} else if (((_b = nameNode.parent) === null || _b === void 0 ? void 0 : _b.nodeType) === 52 && ((_c = nameNode.parent.parent) === null || _c === void 0 ? void 0 : _c.nodeType) === 3) {
|
|
55519
55544
|
isMemberOfEnumeration = true;
|
|
55545
|
+
isUnpackedTuple = true;
|
|
55546
|
+
valueTypeExprNode = nameNode.parent.parent.rightExpression;
|
|
55547
|
+
} else if ((0, analyzerNodeInfo_1.getFileInfo)(nameNode).isStubFile && ((_d = nameNode.parent) === null || _d === void 0 ? void 0 : _d.nodeType) === 54 && nameNode.parent.valueExpression === nameNode) {
|
|
55548
|
+
isMemberOfEnumeration = true;
|
|
55549
|
+
declaredTypeNode = nameNode.parent.typeAnnotation;
|
|
55520
55550
|
}
|
|
55521
55551
|
if ((0, symbolNameUtils_1.isSingleDunderName)(nameNode.value)) {
|
|
55522
55552
|
return void 0;
|
|
@@ -55524,19 +55554,34 @@ var require_enums = __commonJS({
|
|
|
55524
55554
|
if (nameNode.value === "name" || nameNode.value === "value") {
|
|
55525
55555
|
return void 0;
|
|
55526
55556
|
}
|
|
55527
|
-
const
|
|
55528
|
-
|
|
55529
|
-
|
|
55530
|
-
|
|
55557
|
+
const declaredType = declaredTypeNode ? evaluator.getTypeOfAnnotation(declaredTypeNode) : void 0;
|
|
55558
|
+
let assignedType;
|
|
55559
|
+
if (valueTypeExprNode) {
|
|
55560
|
+
const evalFlags = (0, analyzerNodeInfo_1.getFileInfo)(valueTypeExprNode).isStubFile ? 1 : void 0;
|
|
55561
|
+
assignedType = evaluator.getTypeOfExpression(valueTypeExprNode, evalFlags).type;
|
|
55562
|
+
}
|
|
55563
|
+
if ((valueTypeExprNode === null || valueTypeExprNode === void 0 ? void 0 : valueTypeExprNode.nodeType) === 38 && valueTypeExprNode.value !== memberName) {
|
|
55564
|
+
const aliasedEnumType = transformTypeForEnumMember(evaluator, classType, valueTypeExprNode.value, recursionCount);
|
|
55565
|
+
if (aliasedEnumType && (0, types_1.isClassInstance)(aliasedEnumType) && types_1.ClassType.isSameGenericClass(aliasedEnumType, types_1.ClassType.cloneAsInstance(memberInfo.classType)) && aliasedEnumType.literalValue !== void 0) {
|
|
55566
|
+
return aliasedEnumType;
|
|
55567
|
+
}
|
|
55568
|
+
}
|
|
55569
|
+
if (primaryDecl.node.nodeType === 28) {
|
|
55570
|
+
const functionType = evaluator.getTypeOfFunction(primaryDecl.node);
|
|
55571
|
+
if (functionType) {
|
|
55572
|
+
assignedType = functionType.decoratedType;
|
|
55573
|
+
}
|
|
55574
|
+
}
|
|
55575
|
+
let valueType = (_e = declaredType !== null && declaredType !== void 0 ? declaredType : assignedType) !== null && _e !== void 0 ? _e : types_1.UnknownType.create();
|
|
55531
55576
|
if (isUnpackedTuple) {
|
|
55532
|
-
valueType = (
|
|
55577
|
+
valueType = (_g = (_f = evaluator.getTypeOfIterator(
|
|
55533
55578
|
{ type: valueType },
|
|
55534
55579
|
/* isAsync */
|
|
55535
55580
|
false,
|
|
55536
55581
|
nameNode,
|
|
55537
55582
|
/* emitNotIterableError */
|
|
55538
55583
|
false
|
|
55539
|
-
)) === null ||
|
|
55584
|
+
)) === null || _f === void 0 ? void 0 : _f.type) !== null && _g !== void 0 ? _g : types_1.UnknownType.create();
|
|
55540
55585
|
}
|
|
55541
55586
|
if ((0, types_1.isClassInstance)(valueType) && types_1.ClassType.getSymbolTable(valueType).get("__get__")) {
|
|
55542
55587
|
return void 0;
|
|
@@ -55547,9 +55592,9 @@ var require_enums = __commonJS({
|
|
|
55547
55592
|
if (!(0, types_1.findSubtype)(valueType, (subtype) => !(0, types_1.isFunction)(subtype) && !(0, types_1.isOverloadedFunction)(subtype))) {
|
|
55548
55593
|
return void 0;
|
|
55549
55594
|
}
|
|
55550
|
-
if (!assignedType &&
|
|
55595
|
+
if (!assignedType && ((_h = nameNode.parent) === null || _h === void 0 ? void 0 : _h.nodeType) === 3 && nameNode.parent.leftExpression === nameNode) {
|
|
55551
55596
|
assignedType = evaluator.getTypeOfExpression(
|
|
55552
|
-
|
|
55597
|
+
nameNode.parent.rightExpression,
|
|
55553
55598
|
/* flags */
|
|
55554
55599
|
void 0,
|
|
55555
55600
|
(0, typeUtils_1.makeInferenceContext)(declaredType)
|
|
@@ -55568,16 +55613,13 @@ var require_enums = __commonJS({
|
|
|
55568
55613
|
isMemberOfEnumeration = true;
|
|
55569
55614
|
}
|
|
55570
55615
|
}
|
|
55571
|
-
if ((0, types_1.isClassInstance)(valueType) && types_1.ClassType.isSameGenericClass(valueType, types_1.ClassType.cloneAsInstance(enumClassInfo.classType)) && valueType.literalValue !== void 0) {
|
|
55572
|
-
return void 0;
|
|
55573
|
-
}
|
|
55574
55616
|
if (!isMemberOfEnumeration) {
|
|
55575
55617
|
return void 0;
|
|
55576
55618
|
}
|
|
55577
|
-
const enumLiteral = new types_1.EnumLiteral(
|
|
55578
|
-
return types_1.ClassType.cloneAsInstance(types_1.ClassType.cloneWithLiteral(
|
|
55619
|
+
const enumLiteral = new types_1.EnumLiteral(memberInfo.classType.details.fullName, memberInfo.classType.details.name, nameNode.value, valueType);
|
|
55620
|
+
return types_1.ClassType.cloneAsInstance(types_1.ClassType.cloneWithLiteral(memberInfo.classType, enumLiteral));
|
|
55579
55621
|
}
|
|
55580
|
-
exports2.
|
|
55622
|
+
exports2.transformTypeForEnumMember = transformTypeForEnumMember;
|
|
55581
55623
|
function isDeclInEnumClass(evaluator, decl) {
|
|
55582
55624
|
const classNode = (0, parseTreeUtils_1.getEnclosingClass)(
|
|
55583
55625
|
decl.node,
|
|
@@ -55609,11 +55651,22 @@ var require_enums = __commonJS({
|
|
|
55609
55651
|
}
|
|
55610
55652
|
exports2.getEnumDeclaredValueType = getEnumDeclaredValueType;
|
|
55611
55653
|
function getTypeOfEnumMember(evaluator, errorNode, classType, memberName, isIncomplete) {
|
|
55612
|
-
if (!
|
|
55654
|
+
if (!types_1.ClassType.isEnumClass(classType)) {
|
|
55655
|
+
return void 0;
|
|
55656
|
+
}
|
|
55657
|
+
const type = transformTypeForEnumMember(evaluator, classType, memberName);
|
|
55658
|
+
if (type) {
|
|
55659
|
+
return { type, isIncomplete };
|
|
55660
|
+
}
|
|
55661
|
+
if (types_1.TypeBase.isInstantiable(classType)) {
|
|
55613
55662
|
return void 0;
|
|
55614
55663
|
}
|
|
55615
55664
|
const literalValue = classType.literalValue;
|
|
55616
55665
|
if (memberName === "name" || memberName === "_name_") {
|
|
55666
|
+
const memberInfo = (0, typeUtils_1.lookUpClassMember)(classType, memberName);
|
|
55667
|
+
if (memberInfo && (0, types_1.isClass)(memberInfo.classType) && !types_1.ClassType.isBuiltIn(memberInfo.classType, "Enum")) {
|
|
55668
|
+
return void 0;
|
|
55669
|
+
}
|
|
55617
55670
|
const strClass = evaluator.getBuiltInType(errorNode, "str");
|
|
55618
55671
|
if (!(0, types_1.isInstantiableClass)(strClass)) {
|
|
55619
55672
|
return void 0;
|
|
@@ -55639,6 +55692,10 @@ var require_enums = __commonJS({
|
|
|
55639
55692
|
}
|
|
55640
55693
|
const valueType = getEnumDeclaredValueType(evaluator, classType);
|
|
55641
55694
|
if (memberName === "value" || memberName === "_value_") {
|
|
55695
|
+
const memberInfo = (0, typeUtils_1.lookUpClassMember)(classType, memberName);
|
|
55696
|
+
if (memberInfo && (0, types_1.isClass)(memberInfo.classType) && !types_1.ClassType.isBuiltIn(memberInfo.classType)) {
|
|
55697
|
+
return void 0;
|
|
55698
|
+
}
|
|
55642
55699
|
const metaclass = classType.details.effectiveMetaclass;
|
|
55643
55700
|
if (metaclass && (0, types_1.isClass)(metaclass) && !types_1.ClassType.isBuiltIn(metaclass)) {
|
|
55644
55701
|
return { type: valueType !== null && valueType !== void 0 ? valueType : types_1.AnyType.create(), isIncomplete };
|
|
@@ -56332,7 +56389,7 @@ var require_parentDirectoryCache = __commonJS({
|
|
|
56332
56389
|
var _a, _b, _c, _d;
|
|
56333
56390
|
const result = (_a = this._cachedResults.get(importName)) === null || _a === void 0 ? void 0 : _a.get(path12.key);
|
|
56334
56391
|
if (result) {
|
|
56335
|
-
return result
|
|
56392
|
+
return result;
|
|
56336
56393
|
}
|
|
56337
56394
|
const checked = (_b = this._importChecked.get(importName)) === null || _b === void 0 ? void 0 : _b.get(path12.key);
|
|
56338
56395
|
if (checked) {
|
|
@@ -56637,7 +56694,7 @@ var require_importResolver = __commonJS({
|
|
|
56637
56694
|
}
|
|
56638
56695
|
isStdlibModule(module3, execEnv) {
|
|
56639
56696
|
if (!this._stdlibModules) {
|
|
56640
|
-
this._stdlibModules = this._buildStdlibCache(this.getTypeshedStdLibPath(execEnv));
|
|
56697
|
+
this._stdlibModules = this._buildStdlibCache(this.getTypeshedStdLibPath(execEnv), execEnv);
|
|
56641
56698
|
}
|
|
56642
56699
|
return this._stdlibModules.has(module3.nameParts.join("."));
|
|
56643
56700
|
}
|
|
@@ -56779,6 +56836,7 @@ var require_importResolver = __commonJS({
|
|
|
56779
56836
|
if (!this.cachedParentImportResults.checkValidPath(this.fileSystem, sourceFileUri, root)) {
|
|
56780
56837
|
return importResult;
|
|
56781
56838
|
}
|
|
56839
|
+
const localImportFailureInfo = [`Attempting to resolve using local imports: ${importName}`];
|
|
56782
56840
|
const importPath = { importPath: void 0 };
|
|
56783
56841
|
let current = origin;
|
|
56784
56842
|
while (this._shouldWalkUp(current, root, execEnv) && current) {
|
|
@@ -56788,7 +56846,7 @@ var require_importResolver = __commonJS({
|
|
|
56788
56846
|
execEnv,
|
|
56789
56847
|
moduleDescriptor,
|
|
56790
56848
|
importName,
|
|
56791
|
-
|
|
56849
|
+
localImportFailureInfo,
|
|
56792
56850
|
/* allowPartial */
|
|
56793
56851
|
void 0,
|
|
56794
56852
|
/* allowNativeLib */
|
|
@@ -56813,6 +56871,10 @@ var require_importResolver = __commonJS({
|
|
|
56813
56871
|
if (current) {
|
|
56814
56872
|
this.cachedParentImportResults.checked(current, importName, importPath);
|
|
56815
56873
|
}
|
|
56874
|
+
if (this._configOptions.verboseOutput) {
|
|
56875
|
+
const console2 = this.serviceProvider.console();
|
|
56876
|
+
localImportFailureInfo.forEach((diag) => console2.log(diag));
|
|
56877
|
+
}
|
|
56816
56878
|
return importResult;
|
|
56817
56879
|
}
|
|
56818
56880
|
fileExistsCached(uri) {
|
|
@@ -57672,7 +57734,7 @@ var require_importResolver = __commonJS({
|
|
|
57672
57734
|
return void 0;
|
|
57673
57735
|
}
|
|
57674
57736
|
// Finds all of the stdlib modules and returns a Set containing all of their names.
|
|
57675
|
-
_buildStdlibCache(stdlibRoot) {
|
|
57737
|
+
_buildStdlibCache(stdlibRoot, executionEnvironment) {
|
|
57676
57738
|
const cache = /* @__PURE__ */ new Set();
|
|
57677
57739
|
if (stdlibRoot) {
|
|
57678
57740
|
const readDir = (root, prefix) => {
|
|
@@ -57683,7 +57745,9 @@ var require_importResolver = __commonJS({
|
|
|
57683
57745
|
} else if (entry.name.includes(".py")) {
|
|
57684
57746
|
const stripped = (0, pathUtils_1.stripFileExtension)(entry.name);
|
|
57685
57747
|
if (!stripped.startsWith("_")) {
|
|
57686
|
-
|
|
57748
|
+
if (this._isStdlibTypeshedStubValidForVersion(createImportedModuleDescriptor(stripped), root, executionEnvironment.pythonVersion, executionEnvironment.pythonPlatform, [])) {
|
|
57749
|
+
cache.add(prefix ? `${prefix}.${stripped}` : stripped);
|
|
57750
|
+
}
|
|
57687
57751
|
}
|
|
57688
57752
|
}
|
|
57689
57753
|
});
|
|
@@ -58669,7 +58733,7 @@ var require_patternMatching = __commonJS({
|
|
|
58669
58733
|
).type;
|
|
58670
58734
|
if ((0, types_1.isClass)(exprType) && !exprType.typeAliasInfo) {
|
|
58671
58735
|
exprType = types_1.ClassType.cloneRemoveTypePromotions(exprType);
|
|
58672
|
-
exprType = (0, typeUtils_1.
|
|
58736
|
+
exprType = (0, typeUtils_1.specializeWithUnknownTypeArgs)(exprType);
|
|
58673
58737
|
}
|
|
58674
58738
|
let positionalArgNames = [];
|
|
58675
58739
|
if (pattern.arguments.some((arg) => !arg.name) && (0, types_1.isInstantiableClass)(exprType)) {
|
|
@@ -59799,7 +59863,7 @@ var require_properties = __commonJS({
|
|
|
59799
59863
|
type: types_1.AnyType.create(),
|
|
59800
59864
|
hasDeclaredType: true
|
|
59801
59865
|
});
|
|
59802
|
-
const objType = fget.details.parameters.length > 0 ?
|
|
59866
|
+
const objType = fget.details.parameters.length > 0 ? types_1.FunctionType.getEffectiveParameterType(fget, 0) : types_1.AnyType.create();
|
|
59803
59867
|
types_1.FunctionType.addParameter(getFunction2, {
|
|
59804
59868
|
category: 0,
|
|
59805
59869
|
name: "obj",
|
|
@@ -59831,7 +59895,7 @@ var require_properties = __commonJS({
|
|
|
59831
59895
|
type: types_1.AnyType.create(),
|
|
59832
59896
|
hasDeclaredType: true
|
|
59833
59897
|
});
|
|
59834
|
-
let objType = fset.details.parameters.length > 0 ?
|
|
59898
|
+
let objType = fset.details.parameters.length > 0 ? types_1.FunctionType.getEffectiveParameterType(fset, 0) : types_1.AnyType.create();
|
|
59835
59899
|
if ((0, types_1.isTypeVar)(objType) && objType.details.isSynthesizedSelf) {
|
|
59836
59900
|
objType = evaluator.makeTopLevelTypeVarsConcrete(objType);
|
|
59837
59901
|
}
|
|
@@ -59868,7 +59932,7 @@ var require_properties = __commonJS({
|
|
|
59868
59932
|
});
|
|
59869
59933
|
delFunction.details.typeVarScopeId = (0, typeUtils_1.getTypeVarScopeId)(fdel);
|
|
59870
59934
|
delFunction.details.deprecatedMessage = fdel.details.deprecatedMessage;
|
|
59871
|
-
let objType = fdel.details.parameters.length > 0 ?
|
|
59935
|
+
let objType = fdel.details.parameters.length > 0 ? types_1.FunctionType.getEffectiveParameterType(fdel, 0) : types_1.AnyType.create();
|
|
59872
59936
|
if ((0, types_1.isTypeVar)(objType) && objType.details.isSynthesizedSelf) {
|
|
59873
59937
|
objType = evaluator.makeTopLevelTypeVarsConcrete(objType);
|
|
59874
59938
|
}
|
|
@@ -60552,7 +60616,7 @@ var require_analyzerFileInfo = __commonJS({
|
|
|
60552
60616
|
if (fileInfo.futureImports.has("annotations")) {
|
|
60553
60617
|
return true;
|
|
60554
60618
|
}
|
|
60555
|
-
if (fileInfo.executionEnvironment.pythonVersion.isGreaterOrEqualTo(pythonVersion_1.
|
|
60619
|
+
if (fileInfo.executionEnvironment.pythonVersion.isGreaterOrEqualTo(pythonVersion_1.pythonVersion3_14)) {
|
|
60556
60620
|
return true;
|
|
60557
60621
|
}
|
|
60558
60622
|
return false;
|
|
@@ -60977,6 +61041,17 @@ var require_codeFlowEngine = __commonJS({
|
|
|
60977
61041
|
}
|
|
60978
61042
|
return flowNodeTypeCache;
|
|
60979
61043
|
}
|
|
61044
|
+
function isGetTypeFromCodeFlowPending(referenceKeyFilter) {
|
|
61045
|
+
if (!referenceKeyFilter) {
|
|
61046
|
+
return false;
|
|
61047
|
+
}
|
|
61048
|
+
for (const [key, value] of flowNodeTypeCacheSet.entries()) {
|
|
61049
|
+
if (key !== referenceKeyFilter && value.pendingNodes.size > 0) {
|
|
61050
|
+
return true;
|
|
61051
|
+
}
|
|
61052
|
+
}
|
|
61053
|
+
return false;
|
|
61054
|
+
}
|
|
60980
61055
|
function getTypeFromCodeFlow(flowNode, reference, options) {
|
|
60981
61056
|
var _a, _b;
|
|
60982
61057
|
if (enablePrintControlFlowGraph) {
|
|
@@ -61558,7 +61633,7 @@ var require_codeFlowEngine = __commonJS({
|
|
|
61558
61633
|
}
|
|
61559
61634
|
if (!sawIncomplete || attemptCount >= maxAttemptCount) {
|
|
61560
61635
|
let reportIncomplete = sawIncomplete;
|
|
61561
|
-
if (sawIncomplete && !sawPending && effectiveType && !(0, typeUtils_1.isIncompleteUnknown)(effectiveType) && !firstAntecedentTypeIsIncomplete) {
|
|
61636
|
+
if (sawIncomplete && !sawPending && !isGetTypeFromCodeFlowPending(referenceKeyWithSymbolId) && effectiveType && !(0, typeUtils_1.isIncompleteUnknown)(effectiveType) && !firstAntecedentTypeIsIncomplete) {
|
|
61562
61637
|
reportIncomplete = false;
|
|
61563
61638
|
}
|
|
61564
61639
|
if (sawPending || sawIncomplete) {
|
|
@@ -61811,8 +61886,8 @@ var require_codeFlowEngine = __commonJS({
|
|
|
61811
61886
|
const arg1Expr = testExpression.arguments[1].valueExpression;
|
|
61812
61887
|
const arg1Type = evaluator.getTypeOfExpression(
|
|
61813
61888
|
arg1Expr,
|
|
61814
|
-
8 | 32 | 64
|
|
61815
|
-
/* EvaluatorFlags.
|
|
61889
|
+
512 | 8 | 32 | 64 | 16 | 2
|
|
61890
|
+
/* EvaluatorFlags.DoNotSpecialize */
|
|
61816
61891
|
).type;
|
|
61817
61892
|
if ((0, types_1.isInstantiableClass)(arg1Type)) {
|
|
61818
61893
|
return priorRemainingConstraints.filter((subtype) => {
|
|
@@ -61938,10 +62013,14 @@ var require_codeFlowEngine = __commonJS({
|
|
|
61938
62013
|
node,
|
|
61939
62014
|
node.arguments,
|
|
61940
62015
|
{ type: callSubtype, isIncomplete: callTypeResult.isIncomplete },
|
|
62016
|
+
/* typeVarContext */
|
|
61941
62017
|
void 0,
|
|
62018
|
+
/* skipUnknownArgCheck */
|
|
61942
62019
|
false,
|
|
62020
|
+
/* inferenceContext */
|
|
62021
|
+
void 0,
|
|
62022
|
+
/* signatureTracker */
|
|
61943
62023
|
void 0
|
|
61944
|
-
/* expectedType */
|
|
61945
62024
|
);
|
|
61946
62025
|
if (callResult.returnType && (0, types_1.isNever)(callResult.returnType)) {
|
|
61947
62026
|
noReturnTypeCount++;
|
|
@@ -62649,7 +62728,9 @@ var require_dataClasses = __commonJS({
|
|
|
62649
62728
|
return ((_a3 = arg.name) === null || _a3 === void 0 ? void 0 : _a3.value) === "converter";
|
|
62650
62729
|
});
|
|
62651
62730
|
if (converterArg && converterArg.valueExpression) {
|
|
62652
|
-
|
|
62731
|
+
if (AnalyzerNodeInfo.getFileInfo(node).diagnosticRuleSet.enableExperimentalFeatures) {
|
|
62732
|
+
converter = converterArg;
|
|
62733
|
+
}
|
|
62653
62734
|
}
|
|
62654
62735
|
}
|
|
62655
62736
|
}
|
|
@@ -62952,36 +63033,43 @@ var require_dataClasses = __commonJS({
|
|
|
62952
63033
|
hasDeclaredType: true
|
|
62953
63034
|
});
|
|
62954
63035
|
types_1.FunctionType.addPositionOnlyParameterSeparator(targetFunction);
|
|
62955
|
-
if ((0, types_1.isFunction)(converterType)) {
|
|
62956
|
-
const typeVarContext = new typeVarContext_1.TypeVarContext(typeVar.scopeId);
|
|
62957
|
-
const diagAddendum = new diagnostic_1.DiagnosticAddendum();
|
|
62958
|
-
if (evaluator.assignType(targetFunction, converterType, diagAddendum, typeVarContext)) {
|
|
62959
|
-
const solution = (0, typeUtils_1.applySolvedTypeVars)(typeVar, typeVarContext, { unknownIfNotFound: true });
|
|
62960
|
-
return solution;
|
|
62961
|
-
}
|
|
62962
|
-
evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.dataClassConverterFunction().format({
|
|
62963
|
-
argType: evaluator.printType(converterType),
|
|
62964
|
-
fieldType: evaluator.printType(fieldType),
|
|
62965
|
-
fieldName
|
|
62966
|
-
}) + diagAddendum.getString(), converterNode, (_a = diagAddendum.getEffectiveTextRange()) !== null && _a !== void 0 ? _a : converterNode);
|
|
62967
|
-
} else {
|
|
63036
|
+
if ((0, types_1.isFunction)(converterType) || (0, types_1.isOverloadedFunction)(converterType)) {
|
|
62968
63037
|
const acceptedTypes = [];
|
|
62969
63038
|
const diagAddendum = new diagnostic_1.DiagnosticAddendum();
|
|
62970
|
-
|
|
62971
|
-
|
|
62972
|
-
|
|
62973
|
-
|
|
63039
|
+
(0, typeUtils_1.doForEachSignature)(converterType, (signature) => {
|
|
63040
|
+
var _a2;
|
|
63041
|
+
const returnTypeVarContext = new typeVarContext_1.TypeVarContext((0, typeUtils_1.getTypeVarScopeIds)(signature));
|
|
63042
|
+
if (evaluator.assignType(
|
|
63043
|
+
(_a2 = types_1.FunctionType.getSpecializedReturnType(signature)) !== null && _a2 !== void 0 ? _a2 : types_1.UnknownType.create(),
|
|
63044
|
+
fieldType,
|
|
63045
|
+
/* diag */
|
|
63046
|
+
void 0,
|
|
63047
|
+
returnTypeVarContext
|
|
63048
|
+
)) {
|
|
63049
|
+
signature = (0, typeUtils_1.applySolvedTypeVars)(signature, returnTypeVarContext);
|
|
63050
|
+
}
|
|
63051
|
+
const inputTypeVarContext = new typeVarContext_1.TypeVarContext(typeVar.scopeId);
|
|
63052
|
+
if (evaluator.assignType(targetFunction, signature, diagAddendum, inputTypeVarContext)) {
|
|
63053
|
+
const overloadSolution = (0, typeUtils_1.applySolvedTypeVars)(typeVar, inputTypeVarContext, { unknownIfNotFound: true });
|
|
62974
63054
|
acceptedTypes.push(overloadSolution);
|
|
62975
63055
|
}
|
|
62976
63056
|
});
|
|
62977
63057
|
if (acceptedTypes.length > 0) {
|
|
62978
63058
|
return (0, types_1.combineTypes)(acceptedTypes);
|
|
62979
63059
|
}
|
|
62980
|
-
|
|
62981
|
-
|
|
62982
|
-
|
|
62983
|
-
|
|
62984
|
-
|
|
63060
|
+
if ((0, types_1.isFunction)(converterType)) {
|
|
63061
|
+
evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.dataClassConverterFunction().format({
|
|
63062
|
+
argType: evaluator.printType(converterType),
|
|
63063
|
+
fieldType: evaluator.printType(fieldType),
|
|
63064
|
+
fieldName
|
|
63065
|
+
}) + diagAddendum.getString(), converterNode, (_a = diagAddendum.getEffectiveTextRange()) !== null && _a !== void 0 ? _a : converterNode);
|
|
63066
|
+
} else {
|
|
63067
|
+
evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.dataClassConverterOverloads().format({
|
|
63068
|
+
funcName: converterType.overloads[0].details.name || "<anonymous function>",
|
|
63069
|
+
fieldType: evaluator.printType(fieldType),
|
|
63070
|
+
fieldName
|
|
63071
|
+
}) + diagAddendum.getString(), converterNode);
|
|
63072
|
+
}
|
|
62985
63073
|
}
|
|
62986
63074
|
return fieldType;
|
|
62987
63075
|
}
|
|
@@ -64259,7 +64347,11 @@ var require_decorators = __commonJS({
|
|
|
64259
64347
|
/* typeVarContext */
|
|
64260
64348
|
void 0,
|
|
64261
64349
|
/* skipUnknownArgCheck */
|
|
64262
|
-
true
|
|
64350
|
+
true,
|
|
64351
|
+
/* inferenceContext */
|
|
64352
|
+
void 0,
|
|
64353
|
+
/* signatureTracker */
|
|
64354
|
+
void 0
|
|
64263
64355
|
);
|
|
64264
64356
|
evaluator.setTypeResultForNode(node, {
|
|
64265
64357
|
type: (_a = callTypeResult.returnType) !== null && _a !== void 0 ? _a : types_1.UnknownType.create(),
|
|
@@ -65202,7 +65294,22 @@ var require_operations = __commonJS({
|
|
|
65202
65294
|
type = exprType;
|
|
65203
65295
|
} else {
|
|
65204
65296
|
const magicMethodName = unaryOperatorMap[node.operator];
|
|
65205
|
-
|
|
65297
|
+
let isResultValid = true;
|
|
65298
|
+
type = evaluator.mapSubtypesExpandTypeVars(
|
|
65299
|
+
exprType,
|
|
65300
|
+
/* options */
|
|
65301
|
+
void 0,
|
|
65302
|
+
(subtypeExpanded) => {
|
|
65303
|
+
const result = evaluator.getTypeOfMagicMethodCall(subtypeExpanded, magicMethodName, [], node, inferenceContext);
|
|
65304
|
+
if (!result) {
|
|
65305
|
+
isResultValid = false;
|
|
65306
|
+
}
|
|
65307
|
+
return result;
|
|
65308
|
+
}
|
|
65309
|
+
);
|
|
65310
|
+
if (!isResultValid) {
|
|
65311
|
+
type = void 0;
|
|
65312
|
+
}
|
|
65206
65313
|
}
|
|
65207
65314
|
if (!type) {
|
|
65208
65315
|
if (!isIncomplete) {
|
|
@@ -65639,6 +65746,7 @@ var require_typePrinter = __commonJS({
|
|
|
65639
65746
|
}
|
|
65640
65747
|
exports2.printLiteralValue = printLiteralValue;
|
|
65641
65748
|
function printTypeInternal(type, printTypeFlags, returnTypeCallback, uniqueNameMap, recursionTypes, recursionCount) {
|
|
65749
|
+
var _a;
|
|
65642
65750
|
const originalPrintTypeFlags = printTypeFlags;
|
|
65643
65751
|
const parenthesizeUnion = (printTypeFlags & 16) !== 0;
|
|
65644
65752
|
printTypeFlags &= ~(16 | 128);
|
|
@@ -65707,8 +65815,8 @@ var require_typePrinter = __commonJS({
|
|
|
65707
65815
|
}
|
|
65708
65816
|
}
|
|
65709
65817
|
if (recursionTypes.find((t) => {
|
|
65710
|
-
var
|
|
65711
|
-
return t === type || t.typeAliasInfo !== void 0 && t.typeAliasInfo.fullName === ((
|
|
65818
|
+
var _a2;
|
|
65819
|
+
return t === type || t.typeAliasInfo !== void 0 && t.typeAliasInfo.fullName === ((_a2 = type.typeAliasInfo) === null || _a2 === void 0 ? void 0 : _a2.fullName);
|
|
65712
65820
|
}) || recursionTypes.length > types_1.maxTypeRecursionCount) {
|
|
65713
65821
|
if ((0, types_1.isTypeVar)(type) && type.details.isSynthesized && type.details.recursiveTypeAliasName) {
|
|
65714
65822
|
return type.details.recursiveTypeAliasName;
|
|
@@ -65774,7 +65882,7 @@ var require_typePrinter = __commonJS({
|
|
|
65774
65882
|
typeToWrap = `Literal[${printLiteralValue(type)}]`;
|
|
65775
65883
|
}
|
|
65776
65884
|
} else {
|
|
65777
|
-
typeToWrap = printObjectTypeForClassInternal(type, printTypeFlags, returnTypeCallback, uniqueNameMap, recursionTypes, recursionCount);
|
|
65885
|
+
typeToWrap = printObjectTypeForClassInternal((_a = type.specialForm) !== null && _a !== void 0 ? _a : type, printTypeFlags, returnTypeCallback, uniqueNameMap, recursionTypes, recursionCount);
|
|
65778
65886
|
}
|
|
65779
65887
|
return `${_printNestedInstantiable(type, typeToWrap)}${getConditionalIndicator(type)}`;
|
|
65780
65888
|
}
|
|
@@ -65797,6 +65905,9 @@ var require_typePrinter = __commonJS({
|
|
|
65797
65905
|
return `Overload[${overloads.join(", ")}]`;
|
|
65798
65906
|
}
|
|
65799
65907
|
case 8: {
|
|
65908
|
+
if (types_1.TypeBase.isInstantiable(type) && type.specialForm && !type.typeAliasInfo) {
|
|
65909
|
+
return printTypeInternal(type.specialForm, printTypeFlags, returnTypeCallback, uniqueNameMap, recursionTypes, recursionCount);
|
|
65910
|
+
}
|
|
65800
65911
|
const subtypeHandledSet = /* @__PURE__ */ new Set();
|
|
65801
65912
|
const subtypeStrings = /* @__PURE__ */ new Set();
|
|
65802
65913
|
const updatedPrintTypeFlags = printTypeFlags & 8 ? printTypeFlags | 128 : printTypeFlags;
|
|
@@ -66798,7 +66909,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
66798
66909
|
}
|
|
66799
66910
|
}
|
|
66800
66911
|
}
|
|
66801
|
-
function getTypeOfExpression(node, flags = 0, inferenceContext) {
|
|
66912
|
+
function getTypeOfExpression(node, flags = 0, inferenceContext, signatureTracker) {
|
|
66802
66913
|
const cacheEntry = readTypeCacheEntry(node);
|
|
66803
66914
|
if (cacheEntry && (!cacheEntry.typeResult.isIncomplete || cacheEntry.incompleteGenerationCount === incompleteGenerationCount)) {
|
|
66804
66915
|
if (printExpressionTypes) {
|
|
@@ -66823,9 +66934,50 @@ var require_typeEvaluator = __commonJS({
|
|
|
66823
66934
|
inferenceContext.expectedType = (0, typeUtils_1.transformPossibleRecursiveTypeAlias)(inferenceContext.expectedType);
|
|
66824
66935
|
}
|
|
66825
66936
|
initializedBasicTypes(node);
|
|
66937
|
+
let typeResult = getTypeOfExpressionCore(node, flags, inferenceContext, signatureTracker);
|
|
66938
|
+
if ((0, types_1.isInstantiableClass)(typeResult.type) && typeResult.type.includePromotions && !typeResult.type.includeSubclasses && types_1.ClassType.isBuiltIn(typeResult.type, "bytes")) {
|
|
66939
|
+
if (AnalyzerNodeInfo.getFileInfo(node).diagnosticRuleSet.disableBytesTypePromotions) {
|
|
66940
|
+
typeResult = {
|
|
66941
|
+
...typeResult,
|
|
66942
|
+
type: types_1.ClassType.cloneRemoveTypePromotions(typeResult.type)
|
|
66943
|
+
};
|
|
66944
|
+
}
|
|
66945
|
+
}
|
|
66946
|
+
const allowSpeculativeCaching = node.nodeType !== 4;
|
|
66947
|
+
writeTypeCache(node, typeResult, flags, inferenceContext, allowSpeculativeCaching);
|
|
66948
|
+
if (inferenceContext && !(0, types_1.isAnyOrUnknown)(inferenceContext.expectedType) && !(0, types_1.isNever)(inferenceContext.expectedType)) {
|
|
66949
|
+
expectedTypeCache.set(node.id, inferenceContext.expectedType);
|
|
66950
|
+
if (signatureTracker && (0, types_1.isFunction)(typeResult.type)) {
|
|
66951
|
+
typeResult.type = (0, typeUtils_1.ensureFunctionSignaturesAreUnique)(typeResult.type, signatureTracker, node.start);
|
|
66952
|
+
}
|
|
66953
|
+
if (!typeResult.isIncomplete && !typeResult.expectedTypeDiagAddendum) {
|
|
66954
|
+
const diag = new diagnostic_1.DiagnosticAddendum();
|
|
66955
|
+
if (!assignType(
|
|
66956
|
+
inferenceContext.expectedType,
|
|
66957
|
+
typeResult.type,
|
|
66958
|
+
diag,
|
|
66959
|
+
/* destTypeVarContext */
|
|
66960
|
+
void 0,
|
|
66961
|
+
/* srcTypeVarContext */
|
|
66962
|
+
void 0,
|
|
66963
|
+
1024
|
|
66964
|
+
/* AssignTypeFlags.IgnoreTypeVarScope */
|
|
66965
|
+
)) {
|
|
66966
|
+
typeResult.typeErrors = true;
|
|
66967
|
+
typeResult.expectedTypeDiagAddendum = diag;
|
|
66968
|
+
diag.addTextRange(node);
|
|
66969
|
+
}
|
|
66970
|
+
}
|
|
66971
|
+
}
|
|
66972
|
+
if (printExpressionTypes) {
|
|
66973
|
+
printExpressionSpaceCount--;
|
|
66974
|
+
console.log(`${getPrintExpressionTypesSpaces()}${ParseTreeUtils.printExpression(node)} (${getLineNum(node)}): Post ${printType(typeResult.type)}${typeResult.isIncomplete ? " Incomplete" : ""}`);
|
|
66975
|
+
}
|
|
66976
|
+
return typeResult;
|
|
66977
|
+
}
|
|
66978
|
+
function getTypeOfExpressionCore(node, flags = 0, inferenceContext, signatureTracker) {
|
|
66826
66979
|
let typeResult;
|
|
66827
66980
|
let expectingInstantiable = (flags & 128) !== 0;
|
|
66828
|
-
let allowSpeculativeCaching = true;
|
|
66829
66981
|
switch (node.nodeType) {
|
|
66830
66982
|
case 38: {
|
|
66831
66983
|
typeResult = getTypeOfName(node, flags);
|
|
@@ -66840,11 +66992,11 @@ var require_typeEvaluator = __commonJS({
|
|
|
66840
66992
|
break;
|
|
66841
66993
|
}
|
|
66842
66994
|
case 9: {
|
|
66843
|
-
typeResult = getTypeOfCall(node, flags, inferenceContext);
|
|
66995
|
+
typeResult = getTypeOfCall(node, flags, inferenceContext, signatureTracker);
|
|
66844
66996
|
break;
|
|
66845
66997
|
}
|
|
66846
66998
|
case 52: {
|
|
66847
|
-
typeResult = getTypeOfTuple(node, flags, inferenceContext);
|
|
66999
|
+
typeResult = getTypeOfTuple(node, flags, inferenceContext, signatureTracker);
|
|
66848
67000
|
break;
|
|
66849
67001
|
}
|
|
66850
67002
|
case 11: {
|
|
@@ -66901,7 +67053,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
66901
67053
|
break;
|
|
66902
67054
|
}
|
|
66903
67055
|
case 32: {
|
|
66904
|
-
typeResult = getTypeOfListComprehension(node, inferenceContext);
|
|
67056
|
+
typeResult = getTypeOfListComprehension(node, flags, inferenceContext);
|
|
66905
67057
|
break;
|
|
66906
67058
|
}
|
|
66907
67059
|
case 15: {
|
|
@@ -66913,7 +67065,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
66913
67065
|
break;
|
|
66914
67066
|
}
|
|
66915
67067
|
case 3: {
|
|
66916
|
-
typeResult = getTypeOfExpression(node.rightExpression, flags, inferenceContext);
|
|
67068
|
+
typeResult = getTypeOfExpression(node.rightExpression, flags, inferenceContext, signatureTracker);
|
|
66917
67069
|
assignTypeToExpression(
|
|
66918
67070
|
node.leftExpression,
|
|
66919
67071
|
typeResult.type,
|
|
@@ -66930,7 +67082,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
66930
67082
|
if ((flags & 256) !== 0) {
|
|
66931
67083
|
addError(localize_1.LocMessage.walrusNotAllowed(), node);
|
|
66932
67084
|
}
|
|
66933
|
-
typeResult = getTypeOfExpression(node.rightExpression, flags, inferenceContext);
|
|
67085
|
+
typeResult = getTypeOfExpression(node.rightExpression, flags, inferenceContext, signatureTracker);
|
|
66934
67086
|
assignTypeToExpression(
|
|
66935
67087
|
node.name,
|
|
66936
67088
|
typeResult.type,
|
|
@@ -66939,7 +67091,6 @@ var require_typeEvaluator = __commonJS({
|
|
|
66939
67091
|
/* ignoreEmptyContainers */
|
|
66940
67092
|
true
|
|
66941
67093
|
);
|
|
66942
|
-
allowSpeculativeCaching = false;
|
|
66943
67094
|
break;
|
|
66944
67095
|
}
|
|
66945
67096
|
case 60: {
|
|
@@ -66985,43 +67136,6 @@ var require_typeEvaluator = __commonJS({
|
|
|
66985
67136
|
if (expectingInstantiable) {
|
|
66986
67137
|
validateTypeIsInstantiable(typeResult, flags, node);
|
|
66987
67138
|
}
|
|
66988
|
-
if ((0, types_1.isInstantiableClass)(typeResult.type) && typeResult.type.includePromotions && !typeResult.type.includeSubclasses && types_1.ClassType.isBuiltIn(typeResult.type, "bytes")) {
|
|
66989
|
-
if (AnalyzerNodeInfo.getFileInfo(node).diagnosticRuleSet.disableBytesTypePromotions) {
|
|
66990
|
-
typeResult = {
|
|
66991
|
-
...typeResult,
|
|
66992
|
-
type: types_1.ClassType.cloneRemoveTypePromotions(typeResult.type)
|
|
66993
|
-
};
|
|
66994
|
-
}
|
|
66995
|
-
}
|
|
66996
|
-
writeTypeCache(node, typeResult, flags, inferenceContext, allowSpeculativeCaching);
|
|
66997
|
-
if (inferenceContext && !(0, types_1.isAnyOrUnknown)(inferenceContext.expectedType) && !(0, types_1.isNever)(inferenceContext.expectedType)) {
|
|
66998
|
-
expectedTypeCache.set(node.id, inferenceContext.expectedType);
|
|
66999
|
-
if (inferenceContext.signatureTracker && (0, types_1.isFunction)(typeResult.type)) {
|
|
67000
|
-
typeResult.type = (0, typeUtils_1.ensureFunctionSignaturesAreUnique)(typeResult.type, inferenceContext.signatureTracker, node.start);
|
|
67001
|
-
}
|
|
67002
|
-
if (!typeResult.isIncomplete && !typeResult.expectedTypeDiagAddendum) {
|
|
67003
|
-
const diag = new diagnostic_1.DiagnosticAddendum();
|
|
67004
|
-
if (!assignType(
|
|
67005
|
-
inferenceContext.expectedType,
|
|
67006
|
-
typeResult.type,
|
|
67007
|
-
diag,
|
|
67008
|
-
/* destTypeVarContext */
|
|
67009
|
-
void 0,
|
|
67010
|
-
/* srcTypeVarContext */
|
|
67011
|
-
void 0,
|
|
67012
|
-
1024
|
|
67013
|
-
/* AssignTypeFlags.IgnoreTypeVarScope */
|
|
67014
|
-
)) {
|
|
67015
|
-
typeResult.typeErrors = true;
|
|
67016
|
-
typeResult.expectedTypeDiagAddendum = diag;
|
|
67017
|
-
diag.addTextRange(node);
|
|
67018
|
-
}
|
|
67019
|
-
}
|
|
67020
|
-
}
|
|
67021
|
-
if (printExpressionTypes) {
|
|
67022
|
-
printExpressionSpaceCount--;
|
|
67023
|
-
console.log(`${getPrintExpressionTypesSpaces()}${ParseTreeUtils.printExpression(node)} (${getLineNum(node)}): Post ${printType(typeResult.type)}${typeResult.isIncomplete ? " Incomplete" : ""}`);
|
|
67024
|
-
}
|
|
67025
67139
|
return typeResult;
|
|
67026
67140
|
}
|
|
67027
67141
|
function reportUseOfTypeCheckOnly(type, node) {
|
|
@@ -67716,7 +67830,11 @@ var require_typeEvaluator = __commonJS({
|
|
|
67716
67830
|
{ type },
|
|
67717
67831
|
new typeVarContext_1.TypeVarContext((0, typeUtils_1.getTypeVarScopeId)(type)),
|
|
67718
67832
|
/* skipUnknownArgCheck */
|
|
67719
|
-
true
|
|
67833
|
+
true,
|
|
67834
|
+
/* inferenceContext */
|
|
67835
|
+
void 0,
|
|
67836
|
+
/* signatureTracker */
|
|
67837
|
+
void 0
|
|
67720
67838
|
);
|
|
67721
67839
|
});
|
|
67722
67840
|
signatures.push({
|
|
@@ -69060,6 +69178,8 @@ var require_typeEvaluator = __commonJS({
|
|
|
69060
69178
|
/* skipUnknownArgCheck */
|
|
69061
69179
|
false,
|
|
69062
69180
|
/* inferenceContext */
|
|
69181
|
+
void 0,
|
|
69182
|
+
/* signatureTracker */
|
|
69063
69183
|
void 0
|
|
69064
69184
|
);
|
|
69065
69185
|
});
|
|
@@ -69324,6 +69444,9 @@ var require_typeEvaluator = __commonJS({
|
|
|
69324
69444
|
return types_1.ClassType.cloneAsInstance(type.specialForm);
|
|
69325
69445
|
}
|
|
69326
69446
|
function getCodeFlowTypeForCapturedVariable(node, symbolWithScope, effectiveType) {
|
|
69447
|
+
if (symbolWithScope.usesGlobalBinding || symbolWithScope.usesNonlocalBinding) {
|
|
69448
|
+
return void 0;
|
|
69449
|
+
}
|
|
69327
69450
|
const decls = symbolWithScope.symbol.getDeclarations();
|
|
69328
69451
|
if (!decls.every(
|
|
69329
69452
|
(decl) => decl.type === 1 || decl.type === 2 || decl.type === 8
|
|
@@ -69400,13 +69523,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
69400
69523
|
if (memberName === "args" || memberName === "kwargs") {
|
|
69401
69524
|
const outerFunctionScope = ParseTreeUtils.getEnclosingClassOrFunction(enclosingScope);
|
|
69402
69525
|
if ((outerFunctionScope === null || outerFunctionScope === void 0 ? void 0 : outerFunctionScope.nodeType) === 28) {
|
|
69403
|
-
|
|
69404
|
-
addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.paramSpecScopedToReturnType().format({
|
|
69405
|
-
name: type.details.name
|
|
69406
|
-
}), node);
|
|
69407
|
-
} else {
|
|
69408
|
-
enclosingScope = outerFunctionScope;
|
|
69409
|
-
}
|
|
69526
|
+
enclosingScope = outerFunctionScope;
|
|
69410
69527
|
} else if (!scopedTypeVarInfo.type.scopeId) {
|
|
69411
69528
|
addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.paramSpecNotUsedByOuterScope().format({
|
|
69412
69529
|
name: type.details.name
|
|
@@ -69437,12 +69554,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
69437
69554
|
}
|
|
69438
69555
|
} else if ((flags & 4096) === 0) {
|
|
69439
69556
|
if ((type.scopeId === void 0 || scopedTypeVarInfo.foundInterveningClass) && !type.details.isSynthesized) {
|
|
69440
|
-
|
|
69441
|
-
if (scopedTypeVarInfo.isRescoped) {
|
|
69442
|
-
message = (0, types_1.isParamSpec)(type) ? localize_1.LocMessage.paramSpecScopedToReturnType() : localize_1.LocMessage.typeVarScopedToReturnType();
|
|
69443
|
-
} else {
|
|
69444
|
-
message = (0, types_1.isParamSpec)(type) ? localize_1.LocMessage.paramSpecNotUsedByOuterScope() : localize_1.LocMessage.typeVarNotUsedByOuterScope();
|
|
69445
|
-
}
|
|
69557
|
+
const message = (0, types_1.isParamSpec)(type) ? localize_1.LocMessage.paramSpecNotUsedByOuterScope() : localize_1.LocMessage.typeVarNotUsedByOuterScope();
|
|
69446
69558
|
addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, message.format({ name: type.details.name }), node);
|
|
69447
69559
|
}
|
|
69448
69560
|
}
|
|
@@ -69510,7 +69622,6 @@ var require_typeEvaluator = __commonJS({
|
|
|
69510
69622
|
return type;
|
|
69511
69623
|
}
|
|
69512
69624
|
function findScopedTypeVar(node, type) {
|
|
69513
|
-
var _a;
|
|
69514
69625
|
let curNode = node;
|
|
69515
69626
|
let nestedClassCount = 0;
|
|
69516
69627
|
(0, debug_1.assert)(types_1.TypeBase.isInstantiable(type));
|
|
@@ -69533,9 +69644,6 @@ var require_typeEvaluator = __commonJS({
|
|
|
69533
69644
|
if (functionType) {
|
|
69534
69645
|
const functionDetails = functionType.details;
|
|
69535
69646
|
typeParametersForScope = functionDetails.typeParameters;
|
|
69536
|
-
if ((_a = functionDetails.rescopedTypeParameters) === null || _a === void 0 ? void 0 : _a.some((tp) => tp.details.name === type.details.name)) {
|
|
69537
|
-
return { type, isRescoped: true, foundInterveningClass: false };
|
|
69538
|
-
}
|
|
69539
69647
|
}
|
|
69540
69648
|
scopeUsesTypeParameterSyntax = !!curNode.typeParameters;
|
|
69541
69649
|
} else if (curNode.nodeType === 77) {
|
|
@@ -69547,7 +69655,6 @@ var require_typeEvaluator = __commonJS({
|
|
|
69547
69655
|
type = types_1.TypeVarType.cloneForScopeId(type, match.scopeId, match.scopeName, match.scopeType);
|
|
69548
69656
|
return {
|
|
69549
69657
|
type,
|
|
69550
|
-
isRescoped: false,
|
|
69551
69658
|
foundInterveningClass: nestedClassCount > 1 && !scopeUsesTypeParameterSyntax
|
|
69552
69659
|
};
|
|
69553
69660
|
}
|
|
@@ -69583,7 +69690,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
69583
69690
|
const allowedTypeParams = leftType.details.recursiveTypeParameters;
|
|
69584
69691
|
if (allowedTypeParams) {
|
|
69585
69692
|
if (!allowedTypeParams.some((param) => param.details.name === type.details.name)) {
|
|
69586
|
-
return { type,
|
|
69693
|
+
return { type, foundInterveningClass: false };
|
|
69587
69694
|
}
|
|
69588
69695
|
}
|
|
69589
69696
|
}
|
|
@@ -69595,14 +69702,13 @@ var require_typeEvaluator = __commonJS({
|
|
|
69595
69702
|
2
|
|
69596
69703
|
/* TypeVarScopeType.TypeAlias */
|
|
69597
69704
|
),
|
|
69598
|
-
isRescoped: false,
|
|
69599
69705
|
foundInterveningClass: false
|
|
69600
69706
|
};
|
|
69601
69707
|
}
|
|
69602
69708
|
}
|
|
69603
69709
|
curNode = curNode.parent;
|
|
69604
69710
|
}
|
|
69605
|
-
return { type,
|
|
69711
|
+
return { type, foundInterveningClass: false };
|
|
69606
69712
|
}
|
|
69607
69713
|
function getTypeOfMemberAccess(node, flags) {
|
|
69608
69714
|
var _a;
|
|
@@ -69706,7 +69812,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
69706
69812
|
return typeResult;
|
|
69707
69813
|
}
|
|
69708
69814
|
function getTypeOfMemberAccessWithBaseType(node, baseTypeResult, usage, flags) {
|
|
69709
|
-
var _a;
|
|
69815
|
+
var _a, _b;
|
|
69710
69816
|
let baseType = (0, typeUtils_1.transformPossibleRecursiveTypeAlias)(baseTypeResult.type);
|
|
69711
69817
|
const memberName = node.memberName.value;
|
|
69712
69818
|
let diag = new diagnostic_1.DiagnosticAddendum();
|
|
@@ -69797,8 +69903,16 @@ var require_typeEvaluator = __commonJS({
|
|
|
69797
69903
|
}
|
|
69798
69904
|
case 6: {
|
|
69799
69905
|
let typeResult;
|
|
69800
|
-
|
|
69801
|
-
|
|
69906
|
+
const enumMemberResult = (0, enums_1.getTypeOfEnumMember)(evaluatorInterface, node, baseType, memberName, isIncomplete);
|
|
69907
|
+
if (enumMemberResult) {
|
|
69908
|
+
if (usage.method === "get") {
|
|
69909
|
+
typeResult = enumMemberResult;
|
|
69910
|
+
} else {
|
|
69911
|
+
if ((0, types_1.isClassInstance)(enumMemberResult.type) && types_1.ClassType.isSameGenericClass(enumMemberResult.type, baseType) && enumMemberResult.type.literalValue !== void 0) {
|
|
69912
|
+
const diagMessage = usage.method === "set" ? localize_1.LocMessage.enumMemberSet() : localize_1.LocMessage.enumMemberDelete();
|
|
69913
|
+
addDiagnostic(diagnosticRules_1.DiagnosticRule.reportAttributeAccessIssue, diagMessage.format({ name: memberName }) + diag.getString(), node.memberName, (_a = diag.getEffectiveTextRange()) !== null && _a !== void 0 ? _a : node.memberName);
|
|
69914
|
+
}
|
|
69915
|
+
}
|
|
69802
69916
|
}
|
|
69803
69917
|
if (!typeResult) {
|
|
69804
69918
|
typeResult = getTypeOfBoundMember(
|
|
@@ -69985,7 +70099,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
69985
70099
|
}
|
|
69986
70100
|
}
|
|
69987
70101
|
const rule = isFunctionRule ? diagnosticRules_1.DiagnosticRule.reportFunctionMemberAccess : diagnosticRules_1.DiagnosticRule.reportAttributeAccessIssue;
|
|
69988
|
-
addDiagnostic(rule, diagMessage.format({ name: memberName, type: printType(baseType) }) + diag.getString(), node.memberName, (
|
|
70102
|
+
addDiagnostic(rule, diagMessage.format({ name: memberName, type: printType(baseType) }) + diag.getString(), node.memberName, (_b = diag.getEffectiveTextRange()) !== null && _b !== void 0 ? _b : node.memberName);
|
|
69989
70103
|
}
|
|
69990
70104
|
type = isFunctionRule ? types_1.AnyType.create() : types_1.UnknownType.create();
|
|
69991
70105
|
}
|
|
@@ -70325,7 +70439,11 @@ var require_typeEvaluator = __commonJS({
|
|
|
70325
70439
|
/* typeVarContext */
|
|
70326
70440
|
void 0,
|
|
70327
70441
|
/* skipUnknownArgCheck */
|
|
70328
|
-
true
|
|
70442
|
+
true,
|
|
70443
|
+
/* inferenceContext */
|
|
70444
|
+
void 0,
|
|
70445
|
+
/* signatureTracker */
|
|
70446
|
+
void 0
|
|
70329
70447
|
);
|
|
70330
70448
|
});
|
|
70331
70449
|
let deprecationInfo;
|
|
@@ -70520,7 +70638,11 @@ var require_typeEvaluator = __commonJS({
|
|
|
70520
70638
|
{ type: accessMemberType },
|
|
70521
70639
|
typeVarContext,
|
|
70522
70640
|
/* skipUnknownArgCheck */
|
|
70523
|
-
true
|
|
70641
|
+
true,
|
|
70642
|
+
/* inferenceContext */
|
|
70643
|
+
void 0,
|
|
70644
|
+
/* signatureTracker */
|
|
70645
|
+
void 0
|
|
70524
70646
|
);
|
|
70525
70647
|
let isAsymmetricAccessor = false;
|
|
70526
70648
|
if (usage.method === "set") {
|
|
@@ -71300,7 +71422,11 @@ var require_typeEvaluator = __commonJS({
|
|
|
71300
71422
|
/* typeVarContext */
|
|
71301
71423
|
void 0,
|
|
71302
71424
|
/* skipUnknownArgCheck */
|
|
71303
|
-
true
|
|
71425
|
+
true,
|
|
71426
|
+
/* inferenceContext */
|
|
71427
|
+
void 0,
|
|
71428
|
+
/* signatureTracker */
|
|
71429
|
+
void 0
|
|
71304
71430
|
);
|
|
71305
71431
|
if (callResult.argumentErrors) {
|
|
71306
71432
|
if ((0, types_1.isClassInstance)(positionalIndexType)) {
|
|
@@ -71313,7 +71439,19 @@ var require_typeEvaluator = __commonJS({
|
|
|
71313
71439
|
altArgList[0].typeResult = { type: intType };
|
|
71314
71440
|
}
|
|
71315
71441
|
}
|
|
71316
|
-
callResult = validateCallArguments(
|
|
71442
|
+
callResult = validateCallArguments(
|
|
71443
|
+
node,
|
|
71444
|
+
altArgList,
|
|
71445
|
+
{ type: itemMethodType },
|
|
71446
|
+
/* typeVarContext */
|
|
71447
|
+
void 0,
|
|
71448
|
+
/* skipUnknownArgCheck */
|
|
71449
|
+
true,
|
|
71450
|
+
/* inferenceContext */
|
|
71451
|
+
void 0,
|
|
71452
|
+
/* signatureTracker */
|
|
71453
|
+
void 0
|
|
71454
|
+
);
|
|
71317
71455
|
if (!callResult.argumentErrors) {
|
|
71318
71456
|
argList = altArgList;
|
|
71319
71457
|
}
|
|
@@ -71328,7 +71466,11 @@ var require_typeEvaluator = __commonJS({
|
|
|
71328
71466
|
/* typeVarContext */
|
|
71329
71467
|
void 0,
|
|
71330
71468
|
/* skipUnknownArgCheck */
|
|
71331
|
-
true
|
|
71469
|
+
true,
|
|
71470
|
+
/* inferenceContext */
|
|
71471
|
+
void 0,
|
|
71472
|
+
/* signatureTracker */
|
|
71473
|
+
void 0
|
|
71332
71474
|
);
|
|
71333
71475
|
return {
|
|
71334
71476
|
type: (_d = callResult.returnType) !== null && _d !== void 0 ? _d : types_1.UnknownType.create(),
|
|
@@ -71359,16 +71501,16 @@ var require_typeEvaluator = __commonJS({
|
|
|
71359
71501
|
const unboundedIndex = tupleTypeArgs.findIndex((typeArg) => typeArg.isUnbounded || (0, types_1.isVariadicTypeVar)(typeArg.type));
|
|
71360
71502
|
if (value < 0) {
|
|
71361
71503
|
value = tupleTypeArgs.length + value;
|
|
71362
|
-
if (value
|
|
71363
|
-
return void 0;
|
|
71364
|
-
} else if (unboundedIndex >= 0 && value <= unboundedIndex) {
|
|
71504
|
+
if (unboundedIndex >= 0 && value <= unboundedIndex) {
|
|
71365
71505
|
return void 0;
|
|
71506
|
+
} else if (value < 0) {
|
|
71507
|
+
return 0;
|
|
71366
71508
|
}
|
|
71367
71509
|
} else {
|
|
71368
|
-
if (value >
|
|
71369
|
-
return void 0;
|
|
71370
|
-
} else if (unboundedIndex >= 0 && value > unboundedIndex) {
|
|
71510
|
+
if (unboundedIndex >= 0 && value > unboundedIndex) {
|
|
71371
71511
|
return void 0;
|
|
71512
|
+
} else if (value > tupleTypeArgs.length) {
|
|
71513
|
+
return tupleTypeArgs.length;
|
|
71372
71514
|
}
|
|
71373
71515
|
}
|
|
71374
71516
|
}
|
|
@@ -71377,8 +71519,25 @@ var require_typeEvaluator = __commonJS({
|
|
|
71377
71519
|
function getTypeArgs(node, flags, options) {
|
|
71378
71520
|
const typeArgs = [];
|
|
71379
71521
|
let adjFlags = flags;
|
|
71380
|
-
if (
|
|
71522
|
+
if (options === null || options === void 0 ? void 0 : options.isFinalAnnotation) {
|
|
71381
71523
|
adjFlags |= 131072 | 16;
|
|
71524
|
+
} else if (options === null || options === void 0 ? void 0 : options.isClassVarAnnotation) {
|
|
71525
|
+
adjFlags |= 131072;
|
|
71526
|
+
let disallowFinal = true;
|
|
71527
|
+
const enclosingClassNode = ParseTreeUtils.getEnclosingClass(
|
|
71528
|
+
node,
|
|
71529
|
+
/* stopeAtFunction */
|
|
71530
|
+
true
|
|
71531
|
+
);
|
|
71532
|
+
if (enclosingClassNode) {
|
|
71533
|
+
const classTypeInfo = getTypeOfClass(enclosingClassNode);
|
|
71534
|
+
if (classTypeInfo && types_1.ClassType.isDataClass(classTypeInfo.classType)) {
|
|
71535
|
+
disallowFinal = false;
|
|
71536
|
+
}
|
|
71537
|
+
}
|
|
71538
|
+
if (disallowFinal) {
|
|
71539
|
+
adjFlags |= 16;
|
|
71540
|
+
}
|
|
71382
71541
|
} else {
|
|
71383
71542
|
adjFlags &= ~(2 | 32 | 64 | 1048576 | 16384);
|
|
71384
71543
|
if (!(options === null || options === void 0 ? void 0 : options.isAnnotatedClass)) {
|
|
@@ -71474,7 +71633,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
71474
71633
|
}
|
|
71475
71634
|
return typeResult;
|
|
71476
71635
|
}
|
|
71477
|
-
function getTypeOfTuple(node, flags, inferenceContext) {
|
|
71636
|
+
function getTypeOfTuple(node, flags, inferenceContext, signatureTracker) {
|
|
71478
71637
|
var _a;
|
|
71479
71638
|
if ((flags & 256) !== 0 && ((_a = node.parent) === null || _a === void 0 ? void 0 : _a.nodeType) !== 1) {
|
|
71480
71639
|
const diag = new diagnostic_1.DiagnosticAddendum();
|
|
@@ -71485,6 +71644,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
71485
71644
|
if ((flags & 128) !== 0 && node.expressions.length === 0 && !inferenceContext) {
|
|
71486
71645
|
return { type: makeTupleObject([]), isEmptyTupleShorthand: true };
|
|
71487
71646
|
}
|
|
71647
|
+
flags &= ~(256 | 8 | 128);
|
|
71488
71648
|
let effectiveExpectedType = inferenceContext === null || inferenceContext === void 0 ? void 0 : inferenceContext.expectedType;
|
|
71489
71649
|
let expectedTypeContainsAny = inferenceContext && (0, types_1.isAny)(inferenceContext.expectedType);
|
|
71490
71650
|
if (inferenceContext && (0, types_1.isUnion)(inferenceContext.expectedType)) {
|
|
@@ -71497,7 +71657,13 @@ var require_typeEvaluator = __commonJS({
|
|
|
71497
71657
|
}
|
|
71498
71658
|
if (!matchingSubtype) {
|
|
71499
71659
|
const subtypeResult = useSpeculativeMode(node, () => {
|
|
71500
|
-
return getTypeOfTupleWithContext(
|
|
71660
|
+
return getTypeOfTupleWithContext(
|
|
71661
|
+
node,
|
|
71662
|
+
flags,
|
|
71663
|
+
(0, typeUtils_1.makeInferenceContext)(subtype),
|
|
71664
|
+
/* signatureTracker */
|
|
71665
|
+
void 0
|
|
71666
|
+
);
|
|
71501
71667
|
});
|
|
71502
71668
|
if (subtypeResult && assignType(subtype, subtypeResult.type)) {
|
|
71503
71669
|
matchingSubtype = subtype;
|
|
@@ -71511,24 +71677,19 @@ var require_typeEvaluator = __commonJS({
|
|
|
71511
71677
|
}
|
|
71512
71678
|
let expectedTypeDiagAddendum;
|
|
71513
71679
|
if (effectiveExpectedType) {
|
|
71514
|
-
const result = getTypeOfTupleWithContext(node, (0, typeUtils_1.makeInferenceContext)(
|
|
71515
|
-
effectiveExpectedType,
|
|
71516
|
-
/* isTypeIncomplete */
|
|
71517
|
-
false,
|
|
71518
|
-
inferenceContext === null || inferenceContext === void 0 ? void 0 : inferenceContext.signatureTracker
|
|
71519
|
-
));
|
|
71680
|
+
const result = getTypeOfTupleWithContext(node, flags, (0, typeUtils_1.makeInferenceContext)(effectiveExpectedType), signatureTracker);
|
|
71520
71681
|
if (result && !result.typeErrors) {
|
|
71521
71682
|
return result;
|
|
71522
71683
|
}
|
|
71523
71684
|
expectedTypeDiagAddendum = result === null || result === void 0 ? void 0 : result.expectedTypeDiagAddendum;
|
|
71524
71685
|
}
|
|
71525
|
-
const typeResult = getTypeOfTupleInferred(node);
|
|
71686
|
+
const typeResult = getTypeOfTupleInferred(node, flags);
|
|
71526
71687
|
if (expectedTypeContainsAny) {
|
|
71527
71688
|
typeResult.type = types_1.AnyType.create();
|
|
71528
71689
|
}
|
|
71529
71690
|
return { ...typeResult, expectedTypeDiagAddendum };
|
|
71530
71691
|
}
|
|
71531
|
-
function getTypeOfTupleWithContext(node, inferenceContext) {
|
|
71692
|
+
function getTypeOfTupleWithContext(node, flags, inferenceContext, signatureTracker) {
|
|
71532
71693
|
inferenceContext.expectedType = (0, typeUtils_1.transformPossibleRecursiveTypeAlias)(inferenceContext.expectedType);
|
|
71533
71694
|
if (!(0, types_1.isClassInstance)(inferenceContext.expectedType)) {
|
|
71534
71695
|
return void 0;
|
|
@@ -71563,14 +71724,13 @@ var require_typeEvaluator = __commonJS({
|
|
|
71563
71724
|
expectedTypes.push(homogenousType);
|
|
71564
71725
|
}
|
|
71565
71726
|
}
|
|
71566
|
-
const entryTypeResults = node.expressions.map((expr, index) => getTypeOfExpression(
|
|
71567
|
-
expr,
|
|
71568
|
-
/* flags */
|
|
71569
|
-
void 0,
|
|
71570
|
-
(0, typeUtils_1.makeInferenceContext)(index < expectedTypes.length ? expectedTypes[index] : void 0, inferenceContext.isTypeIncomplete, inferenceContext.signatureTracker)
|
|
71571
|
-
));
|
|
71727
|
+
const entryTypeResults = node.expressions.map((expr, index) => getTypeOfExpression(expr, flags | 268435456, (0, typeUtils_1.makeInferenceContext)(index < expectedTypes.length ? expectedTypes[index] : void 0, inferenceContext.isTypeIncomplete), signatureTracker));
|
|
71572
71728
|
const isIncomplete = entryTypeResults.some((result) => result.isIncomplete);
|
|
71573
|
-
const type = makeTupleObject(buildTupleTypesList(
|
|
71729
|
+
const type = makeTupleObject(buildTupleTypesList(
|
|
71730
|
+
entryTypeResults,
|
|
71731
|
+
/* stripLiterals */
|
|
71732
|
+
false
|
|
71733
|
+
));
|
|
71574
71734
|
let expectedTypeDiagAddendum;
|
|
71575
71735
|
if (entryTypeResults.some((result) => result.expectedTypeDiagAddendum)) {
|
|
71576
71736
|
expectedTypeDiagAddendum = new diagnostic_1.DiagnosticAddendum();
|
|
@@ -71582,10 +71742,14 @@ var require_typeEvaluator = __commonJS({
|
|
|
71582
71742
|
}
|
|
71583
71743
|
return { type, expectedTypeDiagAddendum, isIncomplete };
|
|
71584
71744
|
}
|
|
71585
|
-
function getTypeOfTupleInferred(node) {
|
|
71586
|
-
const entryTypeResults = node.expressions.map((expr) => getTypeOfExpression(
|
|
71745
|
+
function getTypeOfTupleInferred(node, flags) {
|
|
71746
|
+
const entryTypeResults = node.expressions.map((expr) => getTypeOfExpression(
|
|
71747
|
+
expr,
|
|
71748
|
+
flags | 268435456
|
|
71749
|
+
/* EvaluatorFlags.StripLiteralTypeForTuple */
|
|
71750
|
+
));
|
|
71587
71751
|
const isIncomplete = entryTypeResults.some((result) => result.isIncomplete);
|
|
71588
|
-
const type = makeTupleObject(buildTupleTypesList(entryTypeResults));
|
|
71752
|
+
const type = makeTupleObject(buildTupleTypesList(entryTypeResults, (flags & 268435456) !== 0));
|
|
71589
71753
|
if (isIncomplete) {
|
|
71590
71754
|
if ((0, typeUtils_1.getContainerDepth)(type) > maxInferredContainerDepth) {
|
|
71591
71755
|
return { type: types_1.UnknownType.create() };
|
|
@@ -71593,7 +71757,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
71593
71757
|
}
|
|
71594
71758
|
return { type, isIncomplete };
|
|
71595
71759
|
}
|
|
71596
|
-
function buildTupleTypesList(entryTypeResults) {
|
|
71760
|
+
function buildTupleTypesList(entryTypeResults, stripLiterals) {
|
|
71597
71761
|
const entryTypes = [];
|
|
71598
71762
|
for (const typeResult of entryTypeResults) {
|
|
71599
71763
|
let possibleUnpackedTuple;
|
|
@@ -71615,7 +71779,8 @@ var require_typeEvaluator = __commonJS({
|
|
|
71615
71779
|
true
|
|
71616
71780
|
), isUnbounded: false });
|
|
71617
71781
|
} else {
|
|
71618
|
-
|
|
71782
|
+
const entryType = stripLiterals ? stripLiteralValue(typeResult.type) : typeResult.type;
|
|
71783
|
+
entryTypes.push({ type: entryType, isUnbounded: !!typeResult.unpackedType });
|
|
71619
71784
|
}
|
|
71620
71785
|
}
|
|
71621
71786
|
if (entryTypes.filter((t) => t.isUnbounded).length > 1) {
|
|
@@ -71625,7 +71790,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
71625
71790
|
}
|
|
71626
71791
|
return entryTypes;
|
|
71627
71792
|
}
|
|
71628
|
-
function getTypeOfCall(node, flags, inferenceContext) {
|
|
71793
|
+
function getTypeOfCall(node, flags, inferenceContext, signatureTracker) {
|
|
71629
71794
|
var _a;
|
|
71630
71795
|
let baseTypeResult;
|
|
71631
71796
|
if ((flags & 256) !== 0 && node.leftExpression.nodeType === 38 && node.leftExpression.value === "type") {
|
|
@@ -71648,18 +71813,18 @@ var require_typeEvaluator = __commonJS({
|
|
|
71648
71813
|
return functionArg;
|
|
71649
71814
|
});
|
|
71650
71815
|
let typeResult = { type: types_1.UnknownType.create() };
|
|
71651
|
-
if (
|
|
71652
|
-
baseTypeResult.type = (0, typeUtils_1.ensureFunctionSignaturesAreUnique)(baseTypeResult.type,
|
|
71816
|
+
if (signatureTracker) {
|
|
71817
|
+
baseTypeResult.type = (0, typeUtils_1.ensureFunctionSignaturesAreUnique)(baseTypeResult.type, signatureTracker, node.leftExpression.start);
|
|
71653
71818
|
}
|
|
71654
71819
|
if (!(0, typeUtils_1.isTypeAliasPlaceholder)(baseTypeResult.type)) {
|
|
71655
71820
|
if (node.leftExpression.nodeType === 38 && node.leftExpression.value === "super") {
|
|
71656
71821
|
typeResult = getTypeOfSuperCall(node);
|
|
71657
71822
|
} else if ((0, types_1.isAnyOrUnknown)(baseTypeResult.type) && node.leftExpression.nodeType === 38 && node.leftExpression.value === "reveal_type") {
|
|
71658
|
-
typeResult = getTypeOfRevealType(node, inferenceContext);
|
|
71823
|
+
typeResult = getTypeOfRevealType(node, inferenceContext, signatureTracker);
|
|
71659
71824
|
} else if ((0, types_1.isFunction)(baseTypeResult.type) && baseTypeResult.type.details.builtInName === "reveal_type") {
|
|
71660
|
-
typeResult = getTypeOfRevealType(node, inferenceContext);
|
|
71825
|
+
typeResult = getTypeOfRevealType(node, inferenceContext, signatureTracker);
|
|
71661
71826
|
} else if ((0, types_1.isFunction)(baseTypeResult.type) && baseTypeResult.type.details.builtInName === "assert_type") {
|
|
71662
|
-
typeResult = getTypeOfAssertType(node, inferenceContext);
|
|
71827
|
+
typeResult = getTypeOfAssertType(node, inferenceContext, signatureTracker);
|
|
71663
71828
|
} else if ((0, types_1.isAnyOrUnknown)(baseTypeResult.type) && node.leftExpression.nodeType === 38 && node.leftExpression.value === "reveal_locals") {
|
|
71664
71829
|
if (node.arguments.length === 0) {
|
|
71665
71830
|
typeResult.type = getTypeOfRevealLocals(node);
|
|
@@ -71675,7 +71840,8 @@ var require_typeEvaluator = __commonJS({
|
|
|
71675
71840
|
void 0,
|
|
71676
71841
|
/* skipUnknownArgCheck */
|
|
71677
71842
|
false,
|
|
71678
|
-
inferenceContext
|
|
71843
|
+
inferenceContext,
|
|
71844
|
+
signatureTracker
|
|
71679
71845
|
);
|
|
71680
71846
|
typeResult.type = (_a = callResult.returnType) !== null && _a !== void 0 ? _a : types_1.UnknownType.create();
|
|
71681
71847
|
if (callResult.argumentErrors) {
|
|
@@ -71749,7 +71915,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
71749
71915
|
}
|
|
71750
71916
|
return typeResult;
|
|
71751
71917
|
}
|
|
71752
|
-
function getTypeOfAssertType(node, inferenceContext) {
|
|
71918
|
+
function getTypeOfAssertType(node, inferenceContext, signatureTracker) {
|
|
71753
71919
|
if (node.arguments.length !== 2 || node.arguments[0].argumentCategory !== 0 || node.arguments[0].name !== void 0 || node.arguments[0].argumentCategory !== 0 || node.arguments[1].name !== void 0) {
|
|
71754
71920
|
addError(localize_1.LocMessage.assertTypeArgs(), node);
|
|
71755
71921
|
return { type: types_1.UnknownType.create() };
|
|
@@ -71758,7 +71924,8 @@ var require_typeEvaluator = __commonJS({
|
|
|
71758
71924
|
node.arguments[0].valueExpression,
|
|
71759
71925
|
/* flags */
|
|
71760
71926
|
void 0,
|
|
71761
|
-
inferenceContext
|
|
71927
|
+
inferenceContext,
|
|
71928
|
+
signatureTracker
|
|
71762
71929
|
);
|
|
71763
71930
|
if (arg0TypeResult.isIncomplete) {
|
|
71764
71931
|
return { type: types_1.UnknownType.create(
|
|
@@ -71776,7 +71943,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
71776
71943
|
}
|
|
71777
71944
|
return { type: arg0TypeResult.type };
|
|
71778
71945
|
}
|
|
71779
|
-
function getTypeOfRevealType(node, inferenceContext) {
|
|
71946
|
+
function getTypeOfRevealType(node, inferenceContext, signatureTracker) {
|
|
71780
71947
|
let arg0Value;
|
|
71781
71948
|
let expectedRevealTypeNode;
|
|
71782
71949
|
let expectedRevealType;
|
|
@@ -71810,7 +71977,8 @@ var require_typeEvaluator = __commonJS({
|
|
|
71810
71977
|
arg0Value,
|
|
71811
71978
|
/* flags */
|
|
71812
71979
|
void 0,
|
|
71813
|
-
inferenceContext
|
|
71980
|
+
inferenceContext,
|
|
71981
|
+
signatureTracker
|
|
71814
71982
|
);
|
|
71815
71983
|
const type = typeResult.type;
|
|
71816
71984
|
const exprString = ParseTreeUtils.printExpression(arg0Value);
|
|
@@ -71876,7 +72044,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
71876
72044
|
if (node.arguments.length > 0) {
|
|
71877
72045
|
targetClassType = getTypeOfExpression(node.arguments[0].valueExpression).type;
|
|
71878
72046
|
const concreteTargetClassType = makeTopLevelTypeVarsConcrete(targetClassType);
|
|
71879
|
-
if (!(0, types_1.isAnyOrUnknown)(concreteTargetClassType) && !(0, types_1.isInstantiableClass)(concreteTargetClassType)) {
|
|
72047
|
+
if (!(0, types_1.isAnyOrUnknown)(concreteTargetClassType) && !(0, types_1.isInstantiableClass)(concreteTargetClassType) && !(0, typeUtils_1.isMetaclassInstance)(concreteTargetClassType)) {
|
|
71880
72048
|
addDiagnostic(diagnosticRules_1.DiagnosticRule.reportArgumentType, localize_1.LocMessage.superCallFirstArg().format({ type: printType(targetClassType) }), node.arguments[0].valueExpression);
|
|
71881
72049
|
}
|
|
71882
72050
|
} else {
|
|
@@ -72050,7 +72218,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
72050
72218
|
}
|
|
72051
72219
|
return { type: types_1.UnknownType.create() };
|
|
72052
72220
|
}
|
|
72053
|
-
function validateOverloadsWithExpandedTypes(errorNode, expandedArgTypes, argParamMatches, typeVarContext, skipUnknownArgCheck, inferenceContext) {
|
|
72221
|
+
function validateOverloadsWithExpandedTypes(errorNode, expandedArgTypes, argParamMatches, typeVarContext, skipUnknownArgCheck, inferenceContext, signatureTracker) {
|
|
72054
72222
|
var _a, _b;
|
|
72055
72223
|
const returnTypes = [];
|
|
72056
72224
|
const matchedOverloads = [];
|
|
@@ -72088,7 +72256,8 @@ var require_typeEvaluator = __commonJS({
|
|
|
72088
72256
|
effectiveTypeVarContext,
|
|
72089
72257
|
/* skipUnknownArgCheck */
|
|
72090
72258
|
true,
|
|
72091
|
-
inferenceContext
|
|
72259
|
+
inferenceContext,
|
|
72260
|
+
signatureTracker
|
|
72092
72261
|
);
|
|
72093
72262
|
});
|
|
72094
72263
|
if (callResult.isTypeIncomplete) {
|
|
@@ -72181,7 +72350,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
72181
72350
|
const finalTypeVarContext = typeVarContext !== null && typeVarContext !== void 0 ? typeVarContext : matchedOverloads[0].typeVarContext;
|
|
72182
72351
|
finalTypeVarContext.unlock();
|
|
72183
72352
|
finalTypeVarContext.addSolveForScope((0, typeUtils_1.getTypeVarScopeId)(matchedOverloads[0].overload));
|
|
72184
|
-
const finalCallResult = validateFunctionArgumentTypesWithContext(errorNode, matchedOverloads[0].matchResults, finalTypeVarContext, skipUnknownArgCheck, inferenceContext);
|
|
72353
|
+
const finalCallResult = validateFunctionArgumentTypesWithContext(errorNode, matchedOverloads[0].matchResults, finalTypeVarContext, skipUnknownArgCheck, inferenceContext, signatureTracker);
|
|
72185
72354
|
if (finalCallResult.isTypeIncomplete) {
|
|
72186
72355
|
isTypeIncomplete = true;
|
|
72187
72356
|
}
|
|
@@ -72231,7 +72400,14 @@ var require_typeEvaluator = __commonJS({
|
|
|
72231
72400
|
const signatureTracker = new typeUtils_1.UniqueSignatureTracker();
|
|
72232
72401
|
types_1.OverloadedFunctionType.getOverloads(typeResult.type).forEach((overload) => {
|
|
72233
72402
|
useSpeculativeMode(errorNode, () => {
|
|
72234
|
-
const matchResults = matchFunctionArgumentsToParameters(
|
|
72403
|
+
const matchResults = matchFunctionArgumentsToParameters(
|
|
72404
|
+
errorNode,
|
|
72405
|
+
argList,
|
|
72406
|
+
{ type: overload, isIncomplete: typeResult.isIncomplete },
|
|
72407
|
+
overloadIndex,
|
|
72408
|
+
/* signatureTracker */
|
|
72409
|
+
void 0
|
|
72410
|
+
);
|
|
72235
72411
|
if (!matchResults.argumentErrors) {
|
|
72236
72412
|
matches.push(matchResults);
|
|
72237
72413
|
}
|
|
@@ -72267,14 +72443,14 @@ var require_typeEvaluator = __commonJS({
|
|
|
72267
72443
|
return a.overloadIndex - b.overloadIndex;
|
|
72268
72444
|
});
|
|
72269
72445
|
}
|
|
72270
|
-
function validateOverloadedFunctionArguments(errorNode, argList, typeResult, typeVarContext, skipUnknownArgCheck, inferenceContext) {
|
|
72446
|
+
function validateOverloadedFunctionArguments(errorNode, argList, typeResult, typeVarContext, skipUnknownArgCheck, inferenceContext, signatureTracker) {
|
|
72271
72447
|
let filteredMatchResults = [];
|
|
72272
72448
|
let contextFreeArgTypes;
|
|
72273
72449
|
let isTypeIncomplete = !!typeResult.isIncomplete;
|
|
72274
72450
|
useSpeculativeMode(errorNode, () => {
|
|
72275
72451
|
let overloadIndex = 0;
|
|
72276
72452
|
types_1.OverloadedFunctionType.getOverloads(typeResult.type).forEach((overload) => {
|
|
72277
|
-
const matchResults = matchFunctionArgumentsToParameters(errorNode, argList, { type: overload, isIncomplete: typeResult.isIncomplete }, overloadIndex);
|
|
72453
|
+
const matchResults = matchFunctionArgumentsToParameters(errorNode, argList, { type: overload, isIncomplete: typeResult.isIncomplete }, overloadIndex, signatureTracker);
|
|
72278
72454
|
if (!matchResults.argumentErrors) {
|
|
72279
72455
|
filteredMatchResults.push(matchResults);
|
|
72280
72456
|
}
|
|
@@ -72287,7 +72463,12 @@ var require_typeEvaluator = __commonJS({
|
|
|
72287
72463
|
const functionName = typeResult.type.overloads[0].details.name || "<anonymous function>";
|
|
72288
72464
|
const diagAddendum = new diagnostic_1.DiagnosticAddendum();
|
|
72289
72465
|
const argTypes = argList.map((t) => {
|
|
72290
|
-
const typeString = printType(getTypeOfArgument(
|
|
72466
|
+
const typeString = printType(getTypeOfArgument(
|
|
72467
|
+
t,
|
|
72468
|
+
/* inferenceContext */
|
|
72469
|
+
void 0,
|
|
72470
|
+
signatureTracker
|
|
72471
|
+
).type);
|
|
72291
72472
|
if (t.argumentCategory === 1) {
|
|
72292
72473
|
return `*${typeString}`;
|
|
72293
72474
|
}
|
|
@@ -72319,7 +72500,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
72319
72500
|
const effectiveTypeVarContext = typeVarContext !== null && typeVarContext !== void 0 ? typeVarContext : new typeVarContext_1.TypeVarContext();
|
|
72320
72501
|
effectiveTypeVarContext.addSolveForScope((0, typeUtils_1.getTypeVarScopeIds)(bestMatch.overload));
|
|
72321
72502
|
effectiveTypeVarContext.unlock();
|
|
72322
|
-
return validateFunctionArgumentTypesWithContext(errorNode, bestMatch, effectiveTypeVarContext, skipUnknownArgCheck2, inferenceContext);
|
|
72503
|
+
return validateFunctionArgumentTypesWithContext(errorNode, bestMatch, effectiveTypeVarContext, skipUnknownArgCheck2, inferenceContext, signatureTracker);
|
|
72323
72504
|
}
|
|
72324
72505
|
if (filteredMatchResults.length === 1) {
|
|
72325
72506
|
return evaluateUsingBestMatchingOverload(
|
|
@@ -72331,7 +72512,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
72331
72512
|
}
|
|
72332
72513
|
let expandedArgTypes = [argList.map((arg) => void 0)];
|
|
72333
72514
|
while (true) {
|
|
72334
|
-
const callResult = validateOverloadsWithExpandedTypes(errorNode, expandedArgTypes, filteredMatchResults, typeVarContext, skipUnknownArgCheck, inferenceContext);
|
|
72515
|
+
const callResult = validateOverloadsWithExpandedTypes(errorNode, expandedArgTypes, filteredMatchResults, typeVarContext, skipUnknownArgCheck, inferenceContext, signatureTracker);
|
|
72335
72516
|
if (callResult.isTypeIncomplete) {
|
|
72336
72517
|
isTypeIncomplete = true;
|
|
72337
72518
|
}
|
|
@@ -72405,7 +72586,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
72405
72586
|
});
|
|
72406
72587
|
return newExpandedArgTypes;
|
|
72407
72588
|
}
|
|
72408
|
-
function validateCallArguments(errorNode, argList, callTypeResult, typeVarContext, skipUnknownArgCheck
|
|
72589
|
+
function validateCallArguments(errorNode, argList, callTypeResult, typeVarContext, skipUnknownArgCheck, inferenceContext, signatureTracker, recursionCount = 0) {
|
|
72409
72590
|
let argumentErrors = false;
|
|
72410
72591
|
let isTypeIncomplete = false;
|
|
72411
72592
|
let specializedInitSelfType;
|
|
@@ -72423,7 +72604,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
72423
72604
|
}
|
|
72424
72605
|
let returnType = mapSubtypesExpandTypeVars(callTypeResult.type, { sortSubtypes: true }, (expandedSubtype, unexpandedSubtype, isLastIteration) => {
|
|
72425
72606
|
return useSpeculativeMode(isLastIteration ? void 0 : errorNode, () => {
|
|
72426
|
-
const callResult = validateCallArgumentsForSubtype(errorNode, argList, expandedSubtype, unexpandedSubtype, !!callTypeResult.isIncomplete, typeVarContext, skipUnknownArgCheck, inferenceContext, recursionCount);
|
|
72607
|
+
const callResult = validateCallArgumentsForSubtype(errorNode, argList, expandedSubtype, unexpandedSubtype, !!callTypeResult.isIncomplete, typeVarContext, skipUnknownArgCheck, inferenceContext, signatureTracker, recursionCount);
|
|
72427
72608
|
if (callResult.argumentErrors) {
|
|
72428
72609
|
argumentErrors = true;
|
|
72429
72610
|
}
|
|
@@ -72450,7 +72631,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
72450
72631
|
overloadsUsedForCall
|
|
72451
72632
|
};
|
|
72452
72633
|
}
|
|
72453
|
-
function validateCallArgumentsForSubtype(errorNode, argList, expandedCallType, unexpandedCallType, isCallTypeIncomplete, typeVarContext, skipUnknownArgCheck, inferenceContext, recursionCount) {
|
|
72634
|
+
function validateCallArgumentsForSubtype(errorNode, argList, expandedCallType, unexpandedCallType, isCallTypeIncomplete, typeVarContext, skipUnknownArgCheck, inferenceContext, signatureTracker, recursionCount) {
|
|
72454
72635
|
switch (expandedCallType.category) {
|
|
72455
72636
|
case 3:
|
|
72456
72637
|
case 1:
|
|
@@ -72458,17 +72639,22 @@ var require_typeEvaluator = __commonJS({
|
|
|
72458
72639
|
if (!isCallTypeIncomplete) {
|
|
72459
72640
|
argList.forEach((arg) => {
|
|
72460
72641
|
if (arg.valueExpression && !isSpeculativeModeInUse(arg.valueExpression)) {
|
|
72461
|
-
getTypeOfArgument(
|
|
72642
|
+
getTypeOfArgument(
|
|
72643
|
+
arg,
|
|
72644
|
+
/* inferenceContext */
|
|
72645
|
+
void 0,
|
|
72646
|
+
signatureTracker
|
|
72647
|
+
);
|
|
72462
72648
|
}
|
|
72463
72649
|
});
|
|
72464
72650
|
}
|
|
72465
72651
|
return { returnType: expandedCallType };
|
|
72466
72652
|
}
|
|
72467
72653
|
case 4: {
|
|
72468
|
-
return validateCallForFunction(errorNode, argList, expandedCallType, isCallTypeIncomplete, typeVarContext, skipUnknownArgCheck, inferenceContext);
|
|
72654
|
+
return validateCallForFunction(errorNode, argList, expandedCallType, isCallTypeIncomplete, typeVarContext, skipUnknownArgCheck, inferenceContext, signatureTracker);
|
|
72469
72655
|
}
|
|
72470
72656
|
case 5: {
|
|
72471
|
-
return validateCallForOverloadedFunction(errorNode, argList, expandedCallType, isCallTypeIncomplete, typeVarContext, skipUnknownArgCheck, inferenceContext);
|
|
72657
|
+
return validateCallForOverloadedFunction(errorNode, argList, expandedCallType, isCallTypeIncomplete, typeVarContext, skipUnknownArgCheck, inferenceContext, signatureTracker);
|
|
72472
72658
|
}
|
|
72473
72659
|
case 6: {
|
|
72474
72660
|
if ((0, typeUtils_1.isNoneInstance)(expandedCallType)) {
|
|
@@ -72476,12 +72662,12 @@ var require_typeEvaluator = __commonJS({
|
|
|
72476
72662
|
return { argumentErrors: true };
|
|
72477
72663
|
}
|
|
72478
72664
|
if (types_1.TypeBase.isInstantiable(expandedCallType)) {
|
|
72479
|
-
return validateCallForInstantiableClass(errorNode, argList, expandedCallType, unexpandedCallType, skipUnknownArgCheck, inferenceContext);
|
|
72665
|
+
return validateCallForInstantiableClass(errorNode, argList, expandedCallType, unexpandedCallType, skipUnknownArgCheck, inferenceContext, signatureTracker);
|
|
72480
72666
|
}
|
|
72481
|
-
return validateCallForClassInstance(errorNode, argList, expandedCallType, unexpandedCallType, typeVarContext, skipUnknownArgCheck, inferenceContext, recursionCount);
|
|
72667
|
+
return validateCallForClassInstance(errorNode, argList, expandedCallType, unexpandedCallType, typeVarContext, skipUnknownArgCheck, inferenceContext, signatureTracker, recursionCount);
|
|
72482
72668
|
}
|
|
72483
72669
|
case 9: {
|
|
72484
|
-
return validateCallArguments(errorNode, argList, { type: (0, typeUtils_1.transformPossibleRecursiveTypeAlias)(expandedCallType), isIncomplete: isCallTypeIncomplete }, typeVarContext, skipUnknownArgCheck, inferenceContext, recursionCount);
|
|
72670
|
+
return validateCallArguments(errorNode, argList, { type: (0, typeUtils_1.transformPossibleRecursiveTypeAlias)(expandedCallType), isIncomplete: isCallTypeIncomplete }, typeVarContext, skipUnknownArgCheck, inferenceContext, signatureTracker, recursionCount);
|
|
72485
72671
|
}
|
|
72486
72672
|
case 7: {
|
|
72487
72673
|
addDiagnostic(diagnosticRules_1.DiagnosticRule.reportCallIssue, localize_1.LocMessage.moduleNotCallable(), errorNode);
|
|
@@ -72490,7 +72676,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
72490
72676
|
}
|
|
72491
72677
|
return { argumentErrors: true };
|
|
72492
72678
|
}
|
|
72493
|
-
function validateCallForFunction(errorNode, argList, expandedCallType, isCallTypeIncomplete, typeVarContext, skipUnknownArgCheck, inferenceContext) {
|
|
72679
|
+
function validateCallForFunction(errorNode, argList, expandedCallType, isCallTypeIncomplete, typeVarContext, skipUnknownArgCheck, inferenceContext, signatureTracker) {
|
|
72494
72680
|
var _a;
|
|
72495
72681
|
if (types_1.TypeBase.isInstantiable(expandedCallType)) {
|
|
72496
72682
|
addDiagnostic(diagnosticRules_1.DiagnosticRule.reportCallIssue, localize_1.LocMessage.callableNotInstantiable().format({
|
|
@@ -72513,13 +72699,13 @@ var require_typeEvaluator = __commonJS({
|
|
|
72513
72699
|
false
|
|
72514
72700
|
)
|
|
72515
72701
|
};
|
|
72516
|
-
validateFunctionArguments(errorNode, argList, { type: expandedCallType }, effectiveTypeVarContext, skipUnknownArgCheck);
|
|
72702
|
+
validateFunctionArguments(errorNode, argList, { type: expandedCallType }, effectiveTypeVarContext, skipUnknownArgCheck, inferenceContext, signatureTracker);
|
|
72517
72703
|
return result;
|
|
72518
72704
|
}
|
|
72519
72705
|
if (expandedCallType.details.builtInName === "NewType") {
|
|
72520
72706
|
return { returnType: createNewType(errorNode, argList) };
|
|
72521
72707
|
}
|
|
72522
|
-
const functionResult = validateFunctionArguments(errorNode, argList, { type: expandedCallType, isIncomplete: isCallTypeIncomplete }, effectiveTypeVarContext, skipUnknownArgCheck, inferenceContext);
|
|
72708
|
+
const functionResult = validateFunctionArguments(errorNode, argList, { type: expandedCallType, isIncomplete: isCallTypeIncomplete }, effectiveTypeVarContext, skipUnknownArgCheck, inferenceContext, signatureTracker);
|
|
72523
72709
|
let isTypeIncomplete = !!functionResult.isTypeIncomplete;
|
|
72524
72710
|
let returnType = functionResult.returnType;
|
|
72525
72711
|
let argumentErrors = !!functionResult.argumentErrors;
|
|
@@ -72611,12 +72797,12 @@ var require_typeEvaluator = __commonJS({
|
|
|
72611
72797
|
}
|
|
72612
72798
|
return { symbol, symbolName, classType, hasImplementation };
|
|
72613
72799
|
}
|
|
72614
|
-
function validateCallForOverloadedFunction(errorNode, argList, expandedCallType, isCallTypeIncomplete, typeVarContext, skipUnknownArgCheck, inferenceContext) {
|
|
72800
|
+
function validateCallForOverloadedFunction(errorNode, argList, expandedCallType, isCallTypeIncomplete, typeVarContext, skipUnknownArgCheck, inferenceContext, signatureTracker) {
|
|
72615
72801
|
var _a, _b;
|
|
72616
72802
|
if (expandedCallType.overloads[0].details.builtInName === "cast" && argList.length === 2) {
|
|
72617
72803
|
return { returnType: evaluateCastCall(argList, errorNode) };
|
|
72618
72804
|
}
|
|
72619
|
-
const callResult = validateOverloadedFunctionArguments(errorNode, argList, { type: expandedCallType, isIncomplete: isCallTypeIncomplete }, typeVarContext, skipUnknownArgCheck, inferenceContext);
|
|
72805
|
+
const callResult = validateOverloadedFunctionArguments(errorNode, argList, { type: expandedCallType, isIncomplete: isCallTypeIncomplete }, typeVarContext, skipUnknownArgCheck, inferenceContext, signatureTracker);
|
|
72620
72806
|
let returnType = (_a = callResult.returnType) !== null && _a !== void 0 ? _a : types_1.UnknownType.create();
|
|
72621
72807
|
let isTypeIncomplete = !!callResult.isTypeIncomplete;
|
|
72622
72808
|
let argumentErrors = !!callResult.argumentErrors;
|
|
@@ -72642,7 +72828,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
72642
72828
|
specializedInitSelfType: callResult.specializedInitSelfType
|
|
72643
72829
|
};
|
|
72644
72830
|
}
|
|
72645
|
-
function validateCallForInstantiableClass(errorNode, argList, expandedCallType, unexpandedCallType, skipUnknownArgCheck, inferenceContext) {
|
|
72831
|
+
function validateCallForInstantiableClass(errorNode, argList, expandedCallType, unexpandedCallType, skipUnknownArgCheck, inferenceContext, signatureTracker) {
|
|
72646
72832
|
var _a, _b;
|
|
72647
72833
|
if (expandedCallType.literalValue !== void 0) {
|
|
72648
72834
|
addDiagnostic(diagnosticRules_1.DiagnosticRule.reportCallIssue, localize_1.LocMessage.literalNotCallable(), errorNode);
|
|
@@ -72657,21 +72843,35 @@ var require_typeEvaluator = __commonJS({
|
|
|
72657
72843
|
}), errorNode);
|
|
72658
72844
|
return { returnType: types_1.UnknownType.create(), argumentErrors: true };
|
|
72659
72845
|
}
|
|
72660
|
-
(0, constructors_1.validateConstructorArguments)(evaluatorInterface, errorNode, argList, expandedCallType, skipUnknownArgCheck, inferenceContext);
|
|
72846
|
+
(0, constructors_1.validateConstructorArguments)(evaluatorInterface, errorNode, argList, expandedCallType, skipUnknownArgCheck, inferenceContext, signatureTracker);
|
|
72661
72847
|
if (expandedCallType.details.name === "type" && argList.length === 1) {
|
|
72662
|
-
const argType = getTypeOfArgument(
|
|
72848
|
+
const argType = getTypeOfArgument(
|
|
72849
|
+
argList[0],
|
|
72850
|
+
/* inferenceContext */
|
|
72851
|
+
void 0,
|
|
72852
|
+
signatureTracker
|
|
72853
|
+
).type;
|
|
72663
72854
|
const returnType2 = (0, typeUtils_1.mapSubtypes)(argType, (subtype) => {
|
|
72664
|
-
|
|
72665
|
-
|
|
72666
|
-
return (_a2 = subtype.details.effectiveMetaclass) !== null && _a2 !== void 0 ? _a2 : types_1.AnyType.create();
|
|
72855
|
+
if ((0, types_1.isInstantiableClass)(subtype) && subtype.details.effectiveMetaclass) {
|
|
72856
|
+
return subtype.details.effectiveMetaclass;
|
|
72667
72857
|
}
|
|
72668
|
-
if ((0, types_1.
|
|
72669
|
-
return
|
|
72858
|
+
if ((0, types_1.isNever)(subtype)) {
|
|
72859
|
+
return subtype;
|
|
72670
72860
|
}
|
|
72671
|
-
if (
|
|
72672
|
-
|
|
72861
|
+
if (types_1.TypeBase.isInstance(subtype)) {
|
|
72862
|
+
if ((0, types_1.isClass)(subtype) || (0, types_1.isTypeVar)(subtype)) {
|
|
72863
|
+
return (0, typeUtils_1.convertToInstantiable)(stripLiteralValue(subtype));
|
|
72864
|
+
}
|
|
72865
|
+
if ((0, types_1.isFunction)(subtype)) {
|
|
72866
|
+
return types_1.FunctionType.cloneAsInstantiable(subtype);
|
|
72867
|
+
}
|
|
72673
72868
|
}
|
|
72674
|
-
return types_1.
|
|
72869
|
+
return types_1.ClassType.cloneForSpecialization(
|
|
72870
|
+
types_1.ClassType.cloneAsInstance(expandedCallType),
|
|
72871
|
+
[types_1.UnknownType.create()],
|
|
72872
|
+
/* isTypeArgumentExplicit */
|
|
72873
|
+
true
|
|
72874
|
+
);
|
|
72675
72875
|
});
|
|
72676
72876
|
return { returnType: returnType2 };
|
|
72677
72877
|
}
|
|
@@ -72731,7 +72931,8 @@ var require_typeEvaluator = __commonJS({
|
|
|
72731
72931
|
void 0,
|
|
72732
72932
|
skipUnknownArgCheck,
|
|
72733
72933
|
/* inferenceContext */
|
|
72734
|
-
void 0
|
|
72934
|
+
void 0,
|
|
72935
|
+
signatureTracker
|
|
72735
72936
|
);
|
|
72736
72937
|
}
|
|
72737
72938
|
return result;
|
|
@@ -72785,7 +72986,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
72785
72986
|
type: expandedCallType.details.name
|
|
72786
72987
|
}), errorNode);
|
|
72787
72988
|
}
|
|
72788
|
-
const constructorResult = (0, constructors_1.validateConstructorArguments)(evaluatorInterface, errorNode, argList, expandedCallType, skipUnknownArgCheck, inferenceContext);
|
|
72989
|
+
const constructorResult = (0, constructors_1.validateConstructorArguments)(evaluatorInterface, errorNode, argList, expandedCallType, skipUnknownArgCheck, inferenceContext, signatureTracker);
|
|
72789
72990
|
const overloadsUsedForCall = constructorResult.overloadsUsedForCall;
|
|
72790
72991
|
const argumentErrors = constructorResult.argumentErrors;
|
|
72791
72992
|
const isTypeIncomplete = constructorResult.isTypeIncomplete;
|
|
@@ -72796,7 +72997,12 @@ var require_typeEvaluator = __commonJS({
|
|
|
72796
72997
|
if (returnType && (0, types_1.isClassInstance)(returnType) && returnType.details.mro.some((baseClass) => (0, types_1.isInstantiableClass)(baseClass) && types_1.ClassType.isBuiltIn(baseClass, "type"))) {
|
|
72797
72998
|
let newClassName = "__class_" + returnType.details.name;
|
|
72798
72999
|
if (argList.length === 3) {
|
|
72799
|
-
const firstArgType = getTypeOfArgument(
|
|
73000
|
+
const firstArgType = getTypeOfArgument(
|
|
73001
|
+
argList[0],
|
|
73002
|
+
/* inferenceContext */
|
|
73003
|
+
void 0,
|
|
73004
|
+
signatureTracker
|
|
73005
|
+
).type;
|
|
72800
73006
|
if ((0, types_1.isClassInstance)(firstArgType) && types_1.ClassType.isBuiltIn(firstArgType, "str") && typeof firstArgType.literalValue === "string") {
|
|
72801
73007
|
newClassName = firstArgType.literalValue;
|
|
72802
73008
|
}
|
|
@@ -72810,7 +73016,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
72810
73016
|
}
|
|
72811
73017
|
return { returnType, overloadsUsedForCall, argumentErrors, isTypeIncomplete };
|
|
72812
73018
|
}
|
|
72813
|
-
function validateCallForClassInstance(errorNode, argList, expandedCallType, unexpandedCallType, typeVarContext, skipUnknownArgCheck, inferenceContext, recursionCount) {
|
|
73019
|
+
function validateCallForClassInstance(errorNode, argList, expandedCallType, unexpandedCallType, typeVarContext, skipUnknownArgCheck, inferenceContext, signatureTracker, recursionCount) {
|
|
72814
73020
|
var _a;
|
|
72815
73021
|
const callDiag = new diagnostic_1.DiagnosticAddendum();
|
|
72816
73022
|
const callMethodResult = getTypeOfBoundMember(
|
|
@@ -72832,7 +73038,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
72832
73038
|
}) + callDiag.getString(), errorNode);
|
|
72833
73039
|
return { returnType: types_1.UnknownType.create(), argumentErrors: true };
|
|
72834
73040
|
}
|
|
72835
|
-
const callResult = validateCallArguments(errorNode, argList, { type: callMethodType }, typeVarContext, skipUnknownArgCheck, inferenceContext, recursionCount);
|
|
73041
|
+
const callResult = validateCallArguments(errorNode, argList, { type: callMethodType }, typeVarContext, skipUnknownArgCheck, inferenceContext, signatureTracker, recursionCount);
|
|
72836
73042
|
let returnType = (_a = callResult.returnType) !== null && _a !== void 0 ? _a : types_1.UnknownType.create();
|
|
72837
73043
|
if ((0, types_1.isTypeVar)(unexpandedCallType) && types_1.TypeBase.isInstantiable(unexpandedCallType) && (0, types_1.isClass)(expandedCallType) && types_1.ClassType.isBuiltIn(expandedCallType, "type")) {
|
|
72838
73044
|
returnType = (0, typeUtils_1.convertToInstance)(unexpandedCallType);
|
|
@@ -72845,7 +73051,13 @@ var require_typeEvaluator = __commonJS({
|
|
|
72845
73051
|
}
|
|
72846
73052
|
function evaluateCastCall(argList, errorNode) {
|
|
72847
73053
|
const castToType = getTypeOfArgumentExpectingType(argList[0], { enforceTypeAnnotationRules: true }).type;
|
|
72848
|
-
let castFromType = getTypeOfArgument(
|
|
73054
|
+
let castFromType = getTypeOfArgument(
|
|
73055
|
+
argList[1],
|
|
73056
|
+
/* inferenceContext */
|
|
73057
|
+
void 0,
|
|
73058
|
+
/* signatureTracker */
|
|
73059
|
+
void 0
|
|
73060
|
+
).type;
|
|
72849
73061
|
if (castFromType.specialForm) {
|
|
72850
73062
|
castFromType = castFromType.specialForm;
|
|
72851
73063
|
}
|
|
@@ -72860,12 +73072,17 @@ var require_typeEvaluator = __commonJS({
|
|
|
72860
73072
|
}
|
|
72861
73073
|
return (0, typeUtils_1.convertToInstance)(castToType);
|
|
72862
73074
|
}
|
|
72863
|
-
function expandArgList(argList) {
|
|
73075
|
+
function expandArgList(argList, signatureTracker) {
|
|
72864
73076
|
var _a;
|
|
72865
73077
|
const expandedArgList = [];
|
|
72866
73078
|
for (const arg of argList) {
|
|
72867
73079
|
if (arg.argumentCategory === 1) {
|
|
72868
|
-
const argType = getTypeOfArgument(
|
|
73080
|
+
const argType = getTypeOfArgument(
|
|
73081
|
+
arg,
|
|
73082
|
+
/* inferenceContext */
|
|
73083
|
+
void 0,
|
|
73084
|
+
signatureTracker
|
|
73085
|
+
).type;
|
|
72869
73086
|
const combinedArgType = (0, typeUtils_1.combineSameSizedTuples)(makeTopLevelTypeVarsConcrete(argType), tupleClassType);
|
|
72870
73087
|
if ((0, types_1.isClassInstance)(combinedArgType) && (0, typeUtils_1.isTupleClass)(combinedArgType)) {
|
|
72871
73088
|
const tupleTypeArgs = (_a = combinedArgType.tupleTypeArguments) !== null && _a !== void 0 ? _a : [];
|
|
@@ -72899,7 +73116,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
72899
73116
|
}
|
|
72900
73117
|
return expandedArgList;
|
|
72901
73118
|
}
|
|
72902
|
-
function matchFunctionArgumentsToParameters(errorNode, argList, typeResult, overloadIndex) {
|
|
73119
|
+
function matchFunctionArgumentsToParameters(errorNode, argList, typeResult, overloadIndex, signatureTracker) {
|
|
72903
73120
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
72904
73121
|
const paramDetails = (0, parameterUtils_1.getParameterListDetails)(typeResult.type);
|
|
72905
73122
|
let argIndex = 0;
|
|
@@ -72907,7 +73124,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
72907
73124
|
let reportedArgError = false;
|
|
72908
73125
|
let isTypeIncomplete = !!typeResult.isIncomplete;
|
|
72909
73126
|
let isVariadicTypeVarFullyMatched = false;
|
|
72910
|
-
argList = expandArgList(argList);
|
|
73127
|
+
argList = expandArgList(argList, signatureTracker);
|
|
72911
73128
|
const paramMap = /* @__PURE__ */ new Map();
|
|
72912
73129
|
paramDetails.params.forEach((paramInfo) => {
|
|
72913
73130
|
(0, debug_1.assert)(paramInfo !== void 0, "paramInfo is undefined for param name map");
|
|
@@ -72916,7 +73133,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
72916
73133
|
paramMap.set(param.name, {
|
|
72917
73134
|
argsNeeded: param.category === 0 && !param.hasDefault ? 1 : 0,
|
|
72918
73135
|
argsReceived: 0,
|
|
72919
|
-
isPositionalOnly: paramInfo.
|
|
73136
|
+
isPositionalOnly: paramInfo.kind === parameterUtils_1.ParameterKind.Positional
|
|
72920
73137
|
});
|
|
72921
73138
|
}
|
|
72922
73139
|
});
|
|
@@ -73014,7 +73231,12 @@ var require_typeEvaluator = __commonJS({
|
|
|
73014
73231
|
} else {
|
|
73015
73232
|
let tooManyPositionals = false;
|
|
73016
73233
|
if (foundUnpackedListArg && argList[argIndex].argumentCategory === 1) {
|
|
73017
|
-
const argType = getTypeOfArgument(
|
|
73234
|
+
const argType = getTypeOfArgument(
|
|
73235
|
+
argList[argIndex],
|
|
73236
|
+
/* inferenceContext */
|
|
73237
|
+
void 0,
|
|
73238
|
+
signatureTracker
|
|
73239
|
+
).type;
|
|
73018
73240
|
if ((0, types_1.isClassInstance)(argType) && (0, typeUtils_1.isTupleClass)(argType) && !(0, typeUtils_1.isUnboundedTupleClass)(argType) && argType.tupleTypeArguments !== void 0 && argType.tupleTypeArguments.length > 0) {
|
|
73019
73241
|
tooManyPositionals = true;
|
|
73020
73242
|
}
|
|
@@ -73041,7 +73263,12 @@ var require_typeEvaluator = __commonJS({
|
|
|
73041
73263
|
const isParamVariadic = paramDetails.params[paramIndex].param.category === 1 && (0, types_1.isVariadicTypeVar)(paramType);
|
|
73042
73264
|
if (argList[argIndex].argumentCategory === 1) {
|
|
73043
73265
|
let isArgCompatibleWithVariadic = false;
|
|
73044
|
-
const argTypeResult = getTypeOfArgument(
|
|
73266
|
+
const argTypeResult = getTypeOfArgument(
|
|
73267
|
+
argList[argIndex],
|
|
73268
|
+
/* inferenceContext */
|
|
73269
|
+
void 0,
|
|
73270
|
+
signatureTracker
|
|
73271
|
+
);
|
|
73045
73272
|
let listElementType;
|
|
73046
73273
|
let advanceToNextArg = false;
|
|
73047
73274
|
if (paramIndex < positionParamLimitIndex) {
|
|
@@ -73211,7 +73438,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
73211
73438
|
let unpackedDictionaryArgType;
|
|
73212
73439
|
while (argIndex < argList.length) {
|
|
73213
73440
|
if (argList[argIndex].argumentCategory === 2) {
|
|
73214
|
-
const argType = getTypeOfArgument(argList[argIndex], (0, typeUtils_1.makeInferenceContext)(paramDetails.unpackedKwargsTypedDictType)).type;
|
|
73441
|
+
const argType = getTypeOfArgument(argList[argIndex], (0, typeUtils_1.makeInferenceContext)(paramDetails.unpackedKwargsTypedDictType), signatureTracker).type;
|
|
73215
73442
|
if ((0, types_1.isAnyOrUnknown)(argType)) {
|
|
73216
73443
|
unpackedDictionaryArgType = argType;
|
|
73217
73444
|
} else if ((0, types_1.isClassInstance)(argType) && types_1.ClassType.isTypedDictClass(argType)) {
|
|
@@ -73394,7 +73621,12 @@ var require_typeEvaluator = __commonJS({
|
|
|
73394
73621
|
}
|
|
73395
73622
|
} else if (argList[argIndex].argumentCategory === 1) {
|
|
73396
73623
|
if (typeResult.type.details.paramSpec) {
|
|
73397
|
-
const argTypeResult = getTypeOfArgument(
|
|
73624
|
+
const argTypeResult = getTypeOfArgument(
|
|
73625
|
+
argList[argIndex],
|
|
73626
|
+
/* inferenceContext */
|
|
73627
|
+
void 0,
|
|
73628
|
+
signatureTracker
|
|
73629
|
+
);
|
|
73398
73630
|
const argType = argTypeResult.type;
|
|
73399
73631
|
if (argTypeResult.isIncomplete) {
|
|
73400
73632
|
isTypeIncomplete = true;
|
|
@@ -73488,7 +73720,12 @@ var require_typeEvaluator = __commonJS({
|
|
|
73488
73720
|
if ((0, types_1.isVariadicTypeVar)(paramType) && !paramType.isVariadicInUnion) {
|
|
73489
73721
|
const tupleTypeArgs = variadicArgs.map((argParam) => {
|
|
73490
73722
|
var _a2;
|
|
73491
|
-
const argType = getTypeOfArgument(
|
|
73723
|
+
const argType = getTypeOfArgument(
|
|
73724
|
+
argParam.argument,
|
|
73725
|
+
/* inferenceContext */
|
|
73726
|
+
void 0,
|
|
73727
|
+
signatureTracker
|
|
73728
|
+
).type;
|
|
73492
73729
|
const containsVariadicTypeVar = (0, types_1.isUnpackedVariadicTypeVar)(argType) || (0, types_1.isClassInstance)(argType) && (0, typeUtils_1.isTupleClass)(argType) && argType.tupleTypeArguments && argType.tupleTypeArguments.length === 1 && (0, types_1.isUnpackedVariadicTypeVar)(argType.tupleTypeArguments[0].type);
|
|
73493
73730
|
if (containsVariadicTypeVar && argParam.argument.argumentCategory !== 1 && !argParam.mapsToVarArgList) {
|
|
73494
73731
|
if (!isDiagnosticSuppressedForNode(errorNode) && !isTypeIncomplete) {
|
|
@@ -73551,12 +73788,14 @@ var require_typeEvaluator = __commonJS({
|
|
|
73551
73788
|
argumentMatchScore: 0
|
|
73552
73789
|
};
|
|
73553
73790
|
}
|
|
73554
|
-
function validateFunctionArgumentTypesWithContext(errorNode, matchResults, typeVarContext, skipUnknownArgCheck = false, inferenceContext) {
|
|
73555
|
-
var _a
|
|
73791
|
+
function validateFunctionArgumentTypesWithContext(errorNode, matchResults, typeVarContext, skipUnknownArgCheck = false, inferenceContext, signatureTracker) {
|
|
73792
|
+
var _a;
|
|
73556
73793
|
const type = matchResults.overload;
|
|
73557
|
-
|
|
73794
|
+
if (!signatureTracker) {
|
|
73795
|
+
signatureTracker = new typeUtils_1.UniqueSignatureTracker();
|
|
73796
|
+
}
|
|
73558
73797
|
matchResults.overload = (0, typeUtils_1.ensureFunctionSignaturesAreUnique)(matchResults.overload, signatureTracker, errorNode.start);
|
|
73559
|
-
if (!inferenceContext || (0, types_1.isAnyOrUnknown)(inferenceContext.expectedType) || (0, types_1.isNever)(inferenceContext.expectedType) || !type.details.declaredReturnType || !(0, typeUtils_1.requiresSpecialization)((
|
|
73798
|
+
if (!inferenceContext || (0, types_1.isAnyOrUnknown)(inferenceContext.expectedType) || (0, types_1.isNever)(inferenceContext.expectedType) || !type.details.declaredReturnType || !(0, typeUtils_1.requiresSpecialization)((_a = types_1.FunctionType.getSpecializedReturnType(type)) !== null && _a !== void 0 ? _a : types_1.UnknownType.create())) {
|
|
73560
73799
|
return validateFunctionArgumentTypes(errorNode, matchResults, typeVarContext, signatureTracker, skipUnknownArgCheck);
|
|
73561
73800
|
}
|
|
73562
73801
|
const effectiveReturnType = getFunctionEffectiveReturnType(type);
|
|
@@ -73649,7 +73888,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
73649
73888
|
}
|
|
73650
73889
|
return validateFunctionArgumentTypes(errorNode, matchResults, typeVarContext, signatureTracker, skipUnknownArgCheck);
|
|
73651
73890
|
}
|
|
73652
|
-
function validateFunctionArgumentTypes(errorNode, matchResults, typeVarContext, signatureTracker, skipUnknownArgCheck
|
|
73891
|
+
function validateFunctionArgumentTypes(errorNode, matchResults, typeVarContext, signatureTracker, skipUnknownArgCheck) {
|
|
73653
73892
|
const type = matchResults.overload;
|
|
73654
73893
|
let isTypeIncomplete = matchResults.isTypeIncomplete;
|
|
73655
73894
|
let argumentErrors = false;
|
|
@@ -73788,7 +74027,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
73788
74027
|
if ((0, types_1.isFunction)(returnType) || (0, types_1.isOverloadedFunction)(returnType)) {
|
|
73789
74028
|
eliminateUnsolvedInUnions = false;
|
|
73790
74029
|
}
|
|
73791
|
-
const unknownIfNotFound = !ParseTreeUtils.getTypeVarScopesForNode(errorNode).some((typeVarScope) => typeVarContext.hasSolveForScope(typeVarScope))
|
|
74030
|
+
const unknownIfNotFound = !ParseTreeUtils.getTypeVarScopesForNode(errorNode).some((typeVarScope) => typeVarContext.hasSolveForScope(typeVarScope));
|
|
73792
74031
|
let specializedReturnType = (0, typeUtils_1.applySolvedTypeVars)(returnType, typeVarContext, {
|
|
73793
74032
|
unknownIfNotFound,
|
|
73794
74033
|
unknownExemptTypeVars: getUnknownExemptTypeVarsForReturnType(type, returnType),
|
|
@@ -73867,11 +74106,12 @@ var require_typeEvaluator = __commonJS({
|
|
|
73867
74106
|
}
|
|
73868
74107
|
return returnType;
|
|
73869
74108
|
}
|
|
73870
|
-
function validateFunctionArguments(errorNode, argList, typeResult, typeVarContext, skipUnknownArgCheck = false, inferenceContext) {
|
|
73871
|
-
|
|
73872
|
-
|
|
74109
|
+
function validateFunctionArguments(errorNode, argList, typeResult, typeVarContext, skipUnknownArgCheck = false, inferenceContext, signatureTracker) {
|
|
74110
|
+
if (!signatureTracker) {
|
|
74111
|
+
signatureTracker = new typeUtils_1.UniqueSignatureTracker();
|
|
74112
|
+
}
|
|
73873
74113
|
typeResult.type = (0, typeUtils_1.ensureFunctionSignaturesAreUnique)(typeResult.type, signatureTracker, errorNode.start);
|
|
73874
|
-
const matchResults = matchFunctionArgumentsToParameters(errorNode, argList, typeResult, 0);
|
|
74114
|
+
const matchResults = matchFunctionArgumentsToParameters(errorNode, argList, typeResult, 0, signatureTracker);
|
|
73875
74115
|
if (matchResults.argumentErrors) {
|
|
73876
74116
|
argList.forEach((arg) => {
|
|
73877
74117
|
if (arg.valueExpression && !isSpeculativeModeInUse(arg.valueExpression)) {
|
|
@@ -73884,7 +74124,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
73884
74124
|
overloadsUsedForCall: []
|
|
73885
74125
|
};
|
|
73886
74126
|
}
|
|
73887
|
-
return validateFunctionArgumentTypesWithContext(errorNode, matchResults, typeVarContext, skipUnknownArgCheck, (0, typeUtils_1.makeInferenceContext)(inferenceContext === null || inferenceContext === void 0 ? void 0 : inferenceContext.expectedType, inferenceContext === null || inferenceContext === void 0 ? void 0 : inferenceContext.isTypeIncomplete, signatureTracker)
|
|
74127
|
+
return validateFunctionArgumentTypesWithContext(errorNode, matchResults, typeVarContext, skipUnknownArgCheck, (0, typeUtils_1.makeInferenceContext)(inferenceContext === null || inferenceContext === void 0 ? void 0 : inferenceContext.expectedType, inferenceContext === null || inferenceContext === void 0 ? void 0 : inferenceContext.isTypeIncomplete), signatureTracker);
|
|
73888
74128
|
}
|
|
73889
74129
|
function validateFunctionArgumentsForParamSpec(errorNode, argList, paramSpec, destTypeVarContext, signatureTracker) {
|
|
73890
74130
|
const signatureContexts = destTypeVarContext.getSignatureContexts();
|
|
@@ -73914,7 +74154,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
73914
74154
|
if (!paramSpecType) {
|
|
73915
74155
|
paramSpecType = (0, typeUtils_1.convertTypeToParamSpecValue)(paramSpec);
|
|
73916
74156
|
}
|
|
73917
|
-
const matchResults = matchFunctionArgumentsToParameters(errorNode, argList, { type: paramSpecType }, 0);
|
|
74157
|
+
const matchResults = matchFunctionArgumentsToParameters(errorNode, argList, { type: paramSpecType }, 0, signatureTracker);
|
|
73918
74158
|
const functionType = matchResults.overload;
|
|
73919
74159
|
const srcTypeVarContext = new typeVarContext_1.TypeVarContext((0, typeUtils_1.getTypeVarScopeIds)(paramSpecType));
|
|
73920
74160
|
if (matchResults.argumentErrors) {
|
|
@@ -73931,7 +74171,12 @@ var require_typeEvaluator = __commonJS({
|
|
|
73931
74171
|
let argumentErrors = false;
|
|
73932
74172
|
let argErrorNode;
|
|
73933
74173
|
for (const arg of argList) {
|
|
73934
|
-
const argType = (_a = getTypeOfArgument(
|
|
74174
|
+
const argType = (_a = getTypeOfArgument(
|
|
74175
|
+
arg,
|
|
74176
|
+
/* inferenceContext */
|
|
74177
|
+
void 0,
|
|
74178
|
+
signatureTracker
|
|
74179
|
+
)) === null || _a === void 0 ? void 0 : _a.type;
|
|
73935
74180
|
const isArgTypeCompatible = argType && ((0, types_1.isTypeSame)(argType, paramSpec, { ignoreTypeFlags: true }) || (0, types_1.isAnyOrUnknown)(argType));
|
|
73936
74181
|
if (arg.argumentCategory === 1 && !sawArgs && isArgTypeCompatible) {
|
|
73937
74182
|
sawArgs = true;
|
|
@@ -73952,7 +74197,14 @@ var require_typeEvaluator = __commonJS({
|
|
|
73952
74197
|
}
|
|
73953
74198
|
return { argumentErrors, typeVarContexts: [srcTypeVarContext] };
|
|
73954
74199
|
}
|
|
73955
|
-
const result = validateFunctionArgumentTypes(
|
|
74200
|
+
const result = validateFunctionArgumentTypes(
|
|
74201
|
+
errorNode,
|
|
74202
|
+
matchResults,
|
|
74203
|
+
srcTypeVarContext,
|
|
74204
|
+
signatureTracker,
|
|
74205
|
+
/* skipUnknownArgCheck */
|
|
74206
|
+
void 0
|
|
74207
|
+
);
|
|
73956
74208
|
return { argumentErrors: !!result.argumentErrors, typeVarContexts: [srcTypeVarContext] };
|
|
73957
74209
|
}
|
|
73958
74210
|
function validateArgType(argParam, typeVarContext, signatureTracker, typeResult, options) {
|
|
@@ -73992,8 +74244,8 @@ var require_typeEvaluator = __commonJS({
|
|
|
73992
74244
|
if (argParam.argType) {
|
|
73993
74245
|
argType = argParam.argType;
|
|
73994
74246
|
} else {
|
|
73995
|
-
const flags = argParam.isinstanceParam ? 512 | 8 | 32 | 64 | 16 : 2 | 16;
|
|
73996
|
-
const exprTypeResult = getTypeOfExpression(argParam.argument.valueExpression, flags, (0, typeUtils_1.makeInferenceContext)(expectedType, !!(typeResult === null || typeResult === void 0 ? void 0 : typeResult.isIncomplete), signatureTracker)
|
|
74247
|
+
const flags = argParam.isinstanceParam ? 512 | 8 | 32 | 64 | 16 | 2 : 2 | 16;
|
|
74248
|
+
const exprTypeResult = getTypeOfExpression(argParam.argument.valueExpression, flags, (0, typeUtils_1.makeInferenceContext)(expectedType, !!(typeResult === null || typeResult === void 0 ? void 0 : typeResult.isIncomplete)), signatureTracker);
|
|
73997
74249
|
argType = exprTypeResult.type;
|
|
73998
74250
|
argType = (0, typeUtils_1.ensureFunctionSignaturesAreUnique)(argType, signatureTracker, argParam.argument.valueExpression.start);
|
|
73999
74251
|
if (exprTypeResult.isIncomplete) {
|
|
@@ -74029,7 +74281,12 @@ var require_typeEvaluator = __commonJS({
|
|
|
74029
74281
|
if (argParam.argType) {
|
|
74030
74282
|
argType = argParam.argType;
|
|
74031
74283
|
} else {
|
|
74032
|
-
const argTypeResult = getTypeOfArgument(
|
|
74284
|
+
const argTypeResult = getTypeOfArgument(
|
|
74285
|
+
argParam.argument,
|
|
74286
|
+
/* inferenceContext */
|
|
74287
|
+
void 0,
|
|
74288
|
+
signatureTracker
|
|
74289
|
+
);
|
|
74033
74290
|
argType = argTypeResult.type;
|
|
74034
74291
|
if (argTypeResult.isIncomplete) {
|
|
74035
74292
|
isTypeIncomplete = true;
|
|
@@ -74434,11 +74691,12 @@ var require_typeEvaluator = __commonJS({
|
|
|
74434
74691
|
function getParamSpecDefaultType(node, isPep695Syntax) {
|
|
74435
74692
|
const functionType = types_1.FunctionType.createSynthesizedInstance(
|
|
74436
74693
|
"",
|
|
74437
|
-
|
|
74694
|
+
65536
|
|
74438
74695
|
/* FunctionTypeFlags.ParamSpecValue */
|
|
74439
74696
|
);
|
|
74440
74697
|
if (node.nodeType === 18) {
|
|
74441
74698
|
types_1.FunctionType.addDefaultParameters(functionType);
|
|
74699
|
+
functionType.details.flags |= 32768;
|
|
74442
74700
|
return functionType;
|
|
74443
74701
|
}
|
|
74444
74702
|
if (node.nodeType === 31) {
|
|
@@ -74689,12 +74947,24 @@ var require_typeEvaluator = __commonJS({
|
|
|
74689
74947
|
}
|
|
74690
74948
|
function createClassFromMetaclass(errorNode, argList, metaclass) {
|
|
74691
74949
|
const fileInfo = AnalyzerNodeInfo.getFileInfo(errorNode);
|
|
74692
|
-
const arg0Type = getTypeOfArgument(
|
|
74950
|
+
const arg0Type = getTypeOfArgument(
|
|
74951
|
+
argList[0],
|
|
74952
|
+
/* inferenceContext */
|
|
74953
|
+
void 0,
|
|
74954
|
+
/* signatureTracker */
|
|
74955
|
+
void 0
|
|
74956
|
+
).type;
|
|
74693
74957
|
if (!(0, types_1.isClassInstance)(arg0Type) || !types_1.ClassType.isBuiltIn(arg0Type, "str")) {
|
|
74694
74958
|
return void 0;
|
|
74695
74959
|
}
|
|
74696
74960
|
const className = arg0Type.literalValue || "_";
|
|
74697
|
-
const arg1Type = getTypeOfArgument(
|
|
74961
|
+
const arg1Type = getTypeOfArgument(
|
|
74962
|
+
argList[1],
|
|
74963
|
+
/* inferenceContext */
|
|
74964
|
+
void 0,
|
|
74965
|
+
/* signatureTracker */
|
|
74966
|
+
void 0
|
|
74967
|
+
).type;
|
|
74698
74968
|
if (!(0, types_1.isClassInstance)(arg1Type) || !(0, typeUtils_1.isTupleClass)(arg1Type) || arg1Type.tupleTypeArguments === void 0) {
|
|
74699
74969
|
return void 0;
|
|
74700
74970
|
}
|
|
@@ -74762,7 +75032,9 @@ var require_typeEvaluator = __commonJS({
|
|
|
74762
75032
|
void 0,
|
|
74763
75033
|
/* skipUnknownArgCheck */
|
|
74764
75034
|
true,
|
|
74765
|
-
inferenceContext
|
|
75035
|
+
inferenceContext,
|
|
75036
|
+
/* signatureTracker */
|
|
75037
|
+
void 0
|
|
74766
75038
|
);
|
|
74767
75039
|
});
|
|
74768
75040
|
if (callResult.argumentErrors && inferenceContext) {
|
|
@@ -74775,7 +75047,11 @@ var require_typeEvaluator = __commonJS({
|
|
|
74775
75047
|
/* typeVarContext */
|
|
74776
75048
|
void 0,
|
|
74777
75049
|
/* skipUnknownArgCheck */
|
|
74778
|
-
true
|
|
75050
|
+
true,
|
|
75051
|
+
/* inferenceContext */
|
|
75052
|
+
void 0,
|
|
75053
|
+
/* signatureTracker */
|
|
75054
|
+
void 0
|
|
74779
75055
|
);
|
|
74780
75056
|
});
|
|
74781
75057
|
}
|
|
@@ -74830,7 +75106,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
74830
75106
|
return;
|
|
74831
75107
|
}
|
|
74832
75108
|
const subtypeResult = useSpeculativeMode(node, () => {
|
|
74833
|
-
return getTypeOfDictionaryWithContext(node, (0, typeUtils_1.makeInferenceContext)(subtype));
|
|
75109
|
+
return getTypeOfDictionaryWithContext(node, flags, (0, typeUtils_1.makeInferenceContext)(subtype));
|
|
74834
75110
|
});
|
|
74835
75111
|
if (subtypeResult && assignType(subtype, subtypeResult.type)) {
|
|
74836
75112
|
if (!matchingSubtypeResult || matchingSubtypeResult.typeErrors && !subtypeResult.typeErrors) {
|
|
@@ -74847,19 +75123,20 @@ var require_typeEvaluator = __commonJS({
|
|
|
74847
75123
|
let expectedTypeDiagAddendum = void 0;
|
|
74848
75124
|
if (effectiveExpectedType) {
|
|
74849
75125
|
expectedTypeDiagAddendum = new diagnostic_1.DiagnosticAddendum();
|
|
74850
|
-
const result2 = getTypeOfDictionaryWithContext(node, (0, typeUtils_1.makeInferenceContext)(effectiveExpectedType), expectedTypeDiagAddendum);
|
|
75126
|
+
const result2 = getTypeOfDictionaryWithContext(node, flags, (0, typeUtils_1.makeInferenceContext)(effectiveExpectedType), expectedTypeDiagAddendum);
|
|
74851
75127
|
if (result2) {
|
|
74852
75128
|
return result2;
|
|
74853
75129
|
}
|
|
74854
75130
|
}
|
|
74855
75131
|
const result = getTypeOfDictionaryInferred(
|
|
74856
75132
|
node,
|
|
75133
|
+
flags,
|
|
74857
75134
|
/* hasExpectedType */
|
|
74858
75135
|
!!inferenceContext
|
|
74859
75136
|
);
|
|
74860
75137
|
return { ...result, expectedTypeDiagAddendum };
|
|
74861
75138
|
}
|
|
74862
|
-
function getTypeOfDictionaryWithContext(node, inferenceContext, expectedDiagAddendum) {
|
|
75139
|
+
function getTypeOfDictionaryWithContext(node, flags, inferenceContext, expectedDiagAddendum) {
|
|
74863
75140
|
inferenceContext.expectedType = (0, typeUtils_1.transformPossibleRecursiveTypeAlias)(inferenceContext.expectedType);
|
|
74864
75141
|
let concreteExpectedType = makeTopLevelTypeVarsConcrete(inferenceContext.expectedType);
|
|
74865
75142
|
if (!(0, types_1.isClassInstance)(concreteExpectedType)) {
|
|
@@ -74874,6 +75151,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
74874
75151
|
const expectedTypedDictEntries = (0, typedDicts_1.getTypedDictMembersForClass)(evaluatorInterface, concreteExpectedType);
|
|
74875
75152
|
const keyValueTypeResult = getKeyAndValueTypesFromDictionary(
|
|
74876
75153
|
node,
|
|
75154
|
+
flags,
|
|
74877
75155
|
keyTypes,
|
|
74878
75156
|
valueTypes,
|
|
74879
75157
|
/* forceStrictInference */
|
|
@@ -74942,6 +75220,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
74942
75220
|
}
|
|
74943
75221
|
const keyValueResult = getKeyAndValueTypesFromDictionary(
|
|
74944
75222
|
node,
|
|
75223
|
+
flags,
|
|
74945
75224
|
keyTypes,
|
|
74946
75225
|
valueTypes,
|
|
74947
75226
|
/* forceStrictInference */
|
|
@@ -74971,7 +75250,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
74971
75250
|
const type = getBuiltInObject(node, "dict", [specializedKeyType, specializedValueType]);
|
|
74972
75251
|
return { type, isIncomplete, typeErrors };
|
|
74973
75252
|
}
|
|
74974
|
-
function getTypeOfDictionaryInferred(node, hasExpectedType) {
|
|
75253
|
+
function getTypeOfDictionaryInferred(node, flags, hasExpectedType) {
|
|
74975
75254
|
const fallbackType = hasExpectedType ? types_1.AnyType.create() : types_1.UnknownType.create();
|
|
74976
75255
|
let keyType = fallbackType;
|
|
74977
75256
|
let valueType = fallbackType;
|
|
@@ -74982,6 +75261,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
74982
75261
|
let typeErrors = false;
|
|
74983
75262
|
const keyValueResult = getKeyAndValueTypesFromDictionary(
|
|
74984
75263
|
node,
|
|
75264
|
+
flags,
|
|
74985
75265
|
keyTypeResults,
|
|
74986
75266
|
valueTypeResults,
|
|
74987
75267
|
/* forceStrictInference */
|
|
@@ -75027,19 +75307,15 @@ var require_typeEvaluator = __commonJS({
|
|
|
75027
75307
|
}
|
|
75028
75308
|
return { type, isIncomplete, typeErrors };
|
|
75029
75309
|
}
|
|
75030
|
-
function getKeyAndValueTypesFromDictionary(node, keyTypes, valueTypes, forceStrictInference, isValueTypeInvariant, expectedKeyType, expectedValueType, expectedTypedDictEntries, expectedDiagAddendum) {
|
|
75310
|
+
function getKeyAndValueTypesFromDictionary(node, flags, keyTypes, valueTypes, forceStrictInference, isValueTypeInvariant, expectedKeyType, expectedValueType, expectedTypedDictEntries, expectedDiagAddendum) {
|
|
75031
75311
|
let isIncomplete = false;
|
|
75032
75312
|
let typeErrors = false;
|
|
75313
|
+
const keyFlags = flags & ~(256 | 8 | 128);
|
|
75033
75314
|
node.entries.forEach((entryNode, index) => {
|
|
75034
75315
|
var _a, _b, _c, _d;
|
|
75035
75316
|
let addUnknown = true;
|
|
75036
75317
|
if (entryNode.nodeType === 17) {
|
|
75037
|
-
const keyTypeResult = getTypeOfExpression(
|
|
75038
|
-
entryNode.keyExpression,
|
|
75039
|
-
/* flags */
|
|
75040
|
-
void 0,
|
|
75041
|
-
(0, typeUtils_1.makeInferenceContext)(expectedKeyType !== null && expectedKeyType !== void 0 ? expectedKeyType : forceStrictInference ? types_1.NeverType.createNever() : void 0)
|
|
75042
|
-
);
|
|
75318
|
+
const keyTypeResult = getTypeOfExpression(entryNode.keyExpression, keyFlags | 268435456, (0, typeUtils_1.makeInferenceContext)(expectedKeyType !== null && expectedKeyType !== void 0 ? expectedKeyType : forceStrictInference ? types_1.NeverType.createNever() : void 0));
|
|
75043
75319
|
if (keyTypeResult.isIncomplete) {
|
|
75044
75320
|
isIncomplete = true;
|
|
75045
75321
|
}
|
|
@@ -75063,21 +75339,11 @@ var require_typeEvaluator = __commonJS({
|
|
|
75063
75339
|
if (expectedTypedDictEntries && (0, types_1.isClassInstance)(keyType) && types_1.ClassType.isBuiltIn(keyType, "str") && (0, typeUtils_1.isLiteralType)(keyType) && expectedTypedDictEntries.knownItems.has(keyType.literalValue)) {
|
|
75064
75340
|
const effectiveValueType = expectedTypedDictEntries.knownItems.get(keyType.literalValue).valueType;
|
|
75065
75341
|
entryInferenceContext = (0, typeUtils_1.makeInferenceContext)(effectiveValueType);
|
|
75066
|
-
valueTypeResult = getTypeOfExpression(
|
|
75067
|
-
entryNode.valueExpression,
|
|
75068
|
-
/* flags */
|
|
75069
|
-
void 0,
|
|
75070
|
-
entryInferenceContext
|
|
75071
|
-
);
|
|
75342
|
+
valueTypeResult = getTypeOfExpression(entryNode.valueExpression, flags | 268435456, entryInferenceContext);
|
|
75072
75343
|
} else {
|
|
75073
75344
|
const effectiveValueType = expectedValueType !== null && expectedValueType !== void 0 ? expectedValueType : forceStrictInference ? types_1.NeverType.createNever() : void 0;
|
|
75074
75345
|
entryInferenceContext = (0, typeUtils_1.makeInferenceContext)(effectiveValueType);
|
|
75075
|
-
valueTypeResult = getTypeOfExpression(
|
|
75076
|
-
entryNode.valueExpression,
|
|
75077
|
-
/* flags */
|
|
75078
|
-
void 0,
|
|
75079
|
-
entryInferenceContext
|
|
75080
|
-
);
|
|
75346
|
+
valueTypeResult = getTypeOfExpression(entryNode.valueExpression, flags | 268435456, entryInferenceContext);
|
|
75081
75347
|
}
|
|
75082
75348
|
if (entryInferenceContext && !valueTypeResult.typeErrors) {
|
|
75083
75349
|
const fromExpectedType = inferTypeArgFromExpectedEntryType(entryInferenceContext, [valueTypeResult.type], !isValueTypeInvariant);
|
|
@@ -75120,12 +75386,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
75120
75386
|
}
|
|
75121
75387
|
}
|
|
75122
75388
|
const entryInferenceContext = (0, typeUtils_1.makeInferenceContext)(expectedType);
|
|
75123
|
-
let unexpandedTypeResult = getTypeOfExpression(
|
|
75124
|
-
entryNode.expandExpression,
|
|
75125
|
-
/* flags */
|
|
75126
|
-
void 0,
|
|
75127
|
-
entryInferenceContext
|
|
75128
|
-
);
|
|
75389
|
+
let unexpandedTypeResult = getTypeOfExpression(entryNode.expandExpression, flags | 268435456, entryInferenceContext);
|
|
75129
75390
|
if (entryInferenceContext && !unexpandedTypeResult.typeErrors) {
|
|
75130
75391
|
const fromExpectedType = inferTypeArgFromExpectedEntryType(entryInferenceContext, [unexpandedTypeResult.type], !isValueTypeInvariant);
|
|
75131
75392
|
if (fromExpectedType) {
|
|
@@ -75196,7 +75457,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
75196
75457
|
}
|
|
75197
75458
|
}
|
|
75198
75459
|
} else if (entryNode.nodeType === 32) {
|
|
75199
|
-
const dictEntryTypeResult = getElementTypeFromListComprehension(entryNode, expectedValueType, expectedKeyType);
|
|
75460
|
+
const dictEntryTypeResult = getElementTypeFromListComprehension(entryNode, flags, expectedValueType, expectedKeyType);
|
|
75200
75461
|
const dictEntryType = dictEntryTypeResult.type;
|
|
75201
75462
|
if (dictEntryTypeResult.isIncomplete) {
|
|
75202
75463
|
isIncomplete = true;
|
|
@@ -75231,6 +75492,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
75231
75492
|
diag.addMessage(localize_1.LocAddendum.useListInstead());
|
|
75232
75493
|
addDiagnostic(diagnosticRules_1.DiagnosticRule.reportInvalidTypeForm, localize_1.LocMessage.listInAnnotation() + diag.getString(), node);
|
|
75233
75494
|
}
|
|
75495
|
+
flags &= ~(256 | 8 | 128);
|
|
75234
75496
|
let effectiveExpectedType = inferenceContext === null || inferenceContext === void 0 ? void 0 : inferenceContext.expectedType;
|
|
75235
75497
|
if (inferenceContext && (0, types_1.isUnion)(inferenceContext.expectedType)) {
|
|
75236
75498
|
let matchingSubtype;
|
|
@@ -75242,7 +75504,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
75242
75504
|
return;
|
|
75243
75505
|
}
|
|
75244
75506
|
const subtypeResult = useSpeculativeMode(node, () => {
|
|
75245
|
-
return getTypeOfListOrSetWithContext(node, (0, typeUtils_1.makeInferenceContext)(subtype));
|
|
75507
|
+
return getTypeOfListOrSetWithContext(node, flags, (0, typeUtils_1.makeInferenceContext)(subtype));
|
|
75246
75508
|
});
|
|
75247
75509
|
if (subtypeResult && assignType(subtype, subtypeResult.type)) {
|
|
75248
75510
|
if (!matchingSubtypeResult || matchingSubtypeResult.typeErrors && !subtypeResult.typeErrors) {
|
|
@@ -75258,7 +75520,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
75258
75520
|
}
|
|
75259
75521
|
let expectedTypeDiagAddendum;
|
|
75260
75522
|
if (effectiveExpectedType) {
|
|
75261
|
-
const result = getTypeOfListOrSetWithContext(node, (0, typeUtils_1.makeInferenceContext)(effectiveExpectedType));
|
|
75523
|
+
const result = getTypeOfListOrSetWithContext(node, flags, (0, typeUtils_1.makeInferenceContext)(effectiveExpectedType));
|
|
75262
75524
|
if (result && !result.typeErrors) {
|
|
75263
75525
|
return result;
|
|
75264
75526
|
}
|
|
@@ -75266,12 +75528,13 @@ var require_typeEvaluator = __commonJS({
|
|
|
75266
75528
|
}
|
|
75267
75529
|
const typeResult = getTypeOfListOrSetInferred(
|
|
75268
75530
|
node,
|
|
75531
|
+
flags,
|
|
75269
75532
|
/* hasExpectedType */
|
|
75270
75533
|
inferenceContext !== void 0
|
|
75271
75534
|
);
|
|
75272
75535
|
return { ...typeResult, expectedTypeDiagAddendum };
|
|
75273
75536
|
}
|
|
75274
|
-
function getTypeOfListOrSetWithContext(node, inferenceContext) {
|
|
75537
|
+
function getTypeOfListOrSetWithContext(node, flags, inferenceContext) {
|
|
75275
75538
|
const builtInClassName = node.nodeType === 31 ? "list" : "set";
|
|
75276
75539
|
inferenceContext.expectedType = (0, typeUtils_1.transformPossibleRecursiveTypeAlias)(inferenceContext.expectedType);
|
|
75277
75540
|
let isIncomplete = false;
|
|
@@ -75286,14 +75549,9 @@ var require_typeEvaluator = __commonJS({
|
|
|
75286
75549
|
node.entries.forEach((entry) => {
|
|
75287
75550
|
let entryTypeResult;
|
|
75288
75551
|
if (entry.nodeType === 32) {
|
|
75289
|
-
entryTypeResult = getElementTypeFromListComprehension(entry, expectedEntryType);
|
|
75552
|
+
entryTypeResult = getElementTypeFromListComprehension(entry, flags, expectedEntryType);
|
|
75290
75553
|
} else {
|
|
75291
|
-
entryTypeResult = getTypeOfExpression(
|
|
75292
|
-
entry,
|
|
75293
|
-
/* flags */
|
|
75294
|
-
void 0,
|
|
75295
|
-
(0, typeUtils_1.makeInferenceContext)(expectedEntryType)
|
|
75296
|
-
);
|
|
75554
|
+
entryTypeResult = getTypeOfExpression(entry, flags | 268435456, (0, typeUtils_1.makeInferenceContext)(expectedEntryType));
|
|
75297
75555
|
}
|
|
75298
75556
|
entryTypes.push(entryTypeResult.type);
|
|
75299
75557
|
if (entryTypeResult.isIncomplete) {
|
|
@@ -75354,7 +75612,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
75354
75612
|
}
|
|
75355
75613
|
return specializedListOrSet.typeArguments[0];
|
|
75356
75614
|
}
|
|
75357
|
-
function getTypeOfListOrSetInferred(node, hasExpectedType) {
|
|
75615
|
+
function getTypeOfListOrSetInferred(node, flags, hasExpectedType) {
|
|
75358
75616
|
const builtInClassName = node.nodeType === 31 ? "list" : "set";
|
|
75359
75617
|
const verifyHashable = node.nodeType === 45;
|
|
75360
75618
|
let isEmptyContainer = false;
|
|
@@ -75364,9 +75622,13 @@ var require_typeEvaluator = __commonJS({
|
|
|
75364
75622
|
node.entries.forEach((entry, index) => {
|
|
75365
75623
|
let entryTypeResult;
|
|
75366
75624
|
if (entry.nodeType === 32 && !entry.isGenerator) {
|
|
75367
|
-
entryTypeResult = getElementTypeFromListComprehension(entry);
|
|
75625
|
+
entryTypeResult = getElementTypeFromListComprehension(entry, flags);
|
|
75368
75626
|
} else {
|
|
75369
|
-
entryTypeResult = getTypeOfExpression(
|
|
75627
|
+
entryTypeResult = getTypeOfExpression(
|
|
75628
|
+
entry,
|
|
75629
|
+
flags | 268435456
|
|
75630
|
+
/* EvaluatorFlags.StripLiteralTypeForTuple */
|
|
75631
|
+
);
|
|
75370
75632
|
}
|
|
75371
75633
|
if (entryTypeResult.isIncomplete) {
|
|
75372
75634
|
isIncomplete = true;
|
|
@@ -75685,7 +75947,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
75685
75947
|
}
|
|
75686
75948
|
return { type: functionType, isIncomplete, typeErrors };
|
|
75687
75949
|
}
|
|
75688
|
-
function getTypeOfListComprehension(node, inferenceContext) {
|
|
75950
|
+
function getTypeOfListComprehension(node, flags, inferenceContext) {
|
|
75689
75951
|
let isIncomplete = false;
|
|
75690
75952
|
let typeErrors = false;
|
|
75691
75953
|
let isAsync = node.forIfNodes.some((comp, index) => {
|
|
@@ -75700,7 +75962,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
75700
75962
|
}
|
|
75701
75963
|
const builtInIteratorType = getTypingType(node, isAsync ? "AsyncGenerator" : "Generator");
|
|
75702
75964
|
const expectedEntryType = getExpectedEntryTypeForIterable(node, builtInIteratorType, inferenceContext);
|
|
75703
|
-
const elementTypeResult = getElementTypeFromListComprehension(node, expectedEntryType);
|
|
75965
|
+
const elementTypeResult = getElementTypeFromListComprehension(node, flags, expectedEntryType);
|
|
75704
75966
|
if (elementTypeResult.isIncomplete) {
|
|
75705
75967
|
isIncomplete = true;
|
|
75706
75968
|
}
|
|
@@ -75763,7 +76025,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
75763
76025
|
}
|
|
75764
76026
|
return isIncomplete;
|
|
75765
76027
|
}
|
|
75766
|
-
function getElementTypeFromListComprehension(node, expectedValueOrElementType, expectedKeyType) {
|
|
76028
|
+
function getElementTypeFromListComprehension(node, flags, expectedValueOrElementType, expectedKeyType) {
|
|
75767
76029
|
let isIncomplete = false;
|
|
75768
76030
|
let typeErrors = false;
|
|
75769
76031
|
for (const forIfNode of node.forIfNodes) {
|
|
@@ -75773,12 +76035,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
75773
76035
|
}
|
|
75774
76036
|
let type = types_1.UnknownType.create();
|
|
75775
76037
|
if (node.expression.nodeType === 17) {
|
|
75776
|
-
const keyTypeResult = getTypeOfExpression(
|
|
75777
|
-
node.expression.keyExpression,
|
|
75778
|
-
/* flags */
|
|
75779
|
-
void 0,
|
|
75780
|
-
(0, typeUtils_1.makeInferenceContext)(expectedKeyType)
|
|
75781
|
-
);
|
|
76038
|
+
const keyTypeResult = getTypeOfExpression(node.expression.keyExpression, flags | 268435456, (0, typeUtils_1.makeInferenceContext)(expectedKeyType));
|
|
75782
76039
|
if (keyTypeResult.isIncomplete) {
|
|
75783
76040
|
isIncomplete = true;
|
|
75784
76041
|
}
|
|
@@ -75789,12 +76046,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
75789
76046
|
if (!expectedKeyType || !(0, typeUtils_1.containsLiteralType)(expectedKeyType)) {
|
|
75790
76047
|
keyType = stripLiteralValue(keyType);
|
|
75791
76048
|
}
|
|
75792
|
-
const valueTypeResult = getTypeOfExpression(
|
|
75793
|
-
node.expression.valueExpression,
|
|
75794
|
-
/* flags */
|
|
75795
|
-
void 0,
|
|
75796
|
-
(0, typeUtils_1.makeInferenceContext)(expectedValueOrElementType)
|
|
75797
|
-
);
|
|
76049
|
+
const valueTypeResult = getTypeOfExpression(node.expression.valueExpression, flags | 268435456, (0, typeUtils_1.makeInferenceContext)(expectedValueOrElementType));
|
|
75798
76050
|
if (valueTypeResult.isIncomplete) {
|
|
75799
76051
|
isIncomplete = true;
|
|
75800
76052
|
}
|
|
@@ -75810,19 +76062,9 @@ var require_typeEvaluator = __commonJS({
|
|
|
75810
76062
|
{ type: valueType, isUnbounded: false }
|
|
75811
76063
|
]);
|
|
75812
76064
|
} else if (node.expression.nodeType === 16) {
|
|
75813
|
-
getTypeOfExpression(
|
|
75814
|
-
node.expression.expandExpression,
|
|
75815
|
-
/* flags */
|
|
75816
|
-
void 0,
|
|
75817
|
-
(0, typeUtils_1.makeInferenceContext)(expectedValueOrElementType)
|
|
75818
|
-
);
|
|
76065
|
+
getTypeOfExpression(node.expression.expandExpression, flags | 268435456, (0, typeUtils_1.makeInferenceContext)(expectedValueOrElementType));
|
|
75819
76066
|
} else if ((0, parseNodes_1.isExpressionNode)(node)) {
|
|
75820
|
-
const exprTypeResult = getTypeOfExpression(
|
|
75821
|
-
node.expression,
|
|
75822
|
-
/* flags */
|
|
75823
|
-
void 0,
|
|
75824
|
-
(0, typeUtils_1.makeInferenceContext)(expectedValueOrElementType)
|
|
75825
|
-
);
|
|
76067
|
+
const exprTypeResult = getTypeOfExpression(node.expression, flags | 268435456, (0, typeUtils_1.makeInferenceContext)(expectedValueOrElementType));
|
|
75826
76068
|
if (exprTypeResult.isIncomplete) {
|
|
75827
76069
|
isIncomplete = true;
|
|
75828
76070
|
}
|
|
@@ -76121,7 +76363,11 @@ var require_typeEvaluator = __commonJS({
|
|
|
76121
76363
|
}
|
|
76122
76364
|
literalTypes.push(type);
|
|
76123
76365
|
}
|
|
76124
|
-
|
|
76366
|
+
let result = (0, types_1.combineTypes)(literalTypes);
|
|
76367
|
+
if ((0, types_1.isUnion)(result) && unionClassType && (0, types_1.isInstantiableClass)(unionClassType)) {
|
|
76368
|
+
result = types_1.TypeBase.cloneAsSpecialForm(result, types_1.ClassType.cloneAsInstance(unionClassType));
|
|
76369
|
+
}
|
|
76370
|
+
return result;
|
|
76125
76371
|
}
|
|
76126
76372
|
function createClassVarType(classType, errorNode, typeArgs, flags) {
|
|
76127
76373
|
var _a;
|
|
@@ -76793,7 +77039,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
76793
77039
|
return void 0;
|
|
76794
77040
|
}
|
|
76795
77041
|
function evaluateTypesForAssignmentStatement(node) {
|
|
76796
|
-
var _a
|
|
77042
|
+
var _a;
|
|
76797
77043
|
const fileInfo = AnalyzerNodeInfo.getFileInfo(node);
|
|
76798
77044
|
if (isTypeCached(node)) {
|
|
76799
77045
|
return;
|
|
@@ -76894,17 +77140,6 @@ var require_typeEvaluator = __commonJS({
|
|
|
76894
77140
|
}
|
|
76895
77141
|
}
|
|
76896
77142
|
rightHandType = srcType;
|
|
76897
|
-
let targetName;
|
|
76898
|
-
if (node.leftExpression.nodeType === 38) {
|
|
76899
|
-
targetName = node.leftExpression;
|
|
76900
|
-
} else if (node.leftExpression.nodeType === 54 && node.leftExpression.valueExpression.nodeType === 38) {
|
|
76901
|
-
targetName = node.leftExpression.valueExpression;
|
|
76902
|
-
}
|
|
76903
|
-
if (targetName) {
|
|
76904
|
-
rightHandType = (_a = (0, enums_1.transformTypeForPossibleEnumClass)(evaluatorInterface, node, targetName, () => {
|
|
76905
|
-
return { assignedType: rightHandType };
|
|
76906
|
-
})) !== null && _a !== void 0 ? _a : rightHandType;
|
|
76907
|
-
}
|
|
76908
77143
|
if (typeAliasNameNode) {
|
|
76909
77144
|
if (!isSpeculativeTypeAlias || isLegalImplicitTypeAliasType(rightHandType)) {
|
|
76910
77145
|
rightHandType = transformTypeForTypeAlias(
|
|
@@ -76924,7 +77159,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
76924
77159
|
rightHandType = types_1.UnknownType.create();
|
|
76925
77160
|
}
|
|
76926
77161
|
typeAliasTypeVar.details.boundType = rightHandType;
|
|
76927
|
-
typeAliasTypeVar.details.recursiveTypeParameters = (
|
|
77162
|
+
typeAliasTypeVar.details.recursiveTypeParameters = (_a = rightHandType.typeAliasInfo) === null || _a === void 0 ? void 0 : _a.typeParameters;
|
|
76928
77163
|
}
|
|
76929
77164
|
}
|
|
76930
77165
|
}
|
|
@@ -77783,12 +78018,15 @@ var require_typeEvaluator = __commonJS({
|
|
|
77783
78018
|
const errorNode = argList.length > 0 ? (_b = (_a = argList[0].node) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : node.name : node.name;
|
|
77784
78019
|
let newMethodMember;
|
|
77785
78020
|
if (classType.details.effectiveMetaclass && (0, types_1.isClass)(classType.details.effectiveMetaclass)) {
|
|
77786
|
-
|
|
77787
|
-
|
|
77788
|
-
|
|
77789
|
-
|
|
77790
|
-
|
|
77791
|
-
|
|
78021
|
+
const metaclassCallsInitSubclass = types_1.ClassType.isBuiltIn(classType.details.effectiveMetaclass, ["ABCMeta", "type"]) && !types_1.ClassType.isTypedDictClass(classType);
|
|
78022
|
+
if (!metaclassCallsInitSubclass) {
|
|
78023
|
+
newMethodMember = (0, typeUtils_1.lookUpClassMember)(
|
|
78024
|
+
classType.details.effectiveMetaclass,
|
|
78025
|
+
"__new__",
|
|
78026
|
+
8
|
|
78027
|
+
/* MemberAccessFlags.SkipTypeBaseClass */
|
|
78028
|
+
);
|
|
78029
|
+
}
|
|
77792
78030
|
}
|
|
77793
78031
|
if (newMethodMember) {
|
|
77794
78032
|
const newMethodType = getTypeOfMember(newMethodMember);
|
|
@@ -77859,7 +78097,9 @@ var require_typeEvaluator = __commonJS({
|
|
|
77859
78097
|
void 0,
|
|
77860
78098
|
/* skipUnknownArgCheck */
|
|
77861
78099
|
false,
|
|
77862
|
-
(0, typeUtils_1.makeInferenceContext)(getNoneType())
|
|
78100
|
+
(0, typeUtils_1.makeInferenceContext)(getNoneType()),
|
|
78101
|
+
/* signatureTracker */
|
|
78102
|
+
void 0
|
|
77863
78103
|
);
|
|
77864
78104
|
if (callResult.argumentErrors) {
|
|
77865
78105
|
const diag = addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.initSubclassCallFailed(), node.name);
|
|
@@ -77881,7 +78121,6 @@ var require_typeEvaluator = __commonJS({
|
|
|
77881
78121
|
});
|
|
77882
78122
|
}
|
|
77883
78123
|
function getTypeOfFunction(node) {
|
|
77884
|
-
var _a;
|
|
77885
78124
|
initializedBasicTypes(node);
|
|
77886
78125
|
let functionType = readTypeCache(
|
|
77887
78126
|
node.name,
|
|
@@ -77934,9 +78173,6 @@ var require_typeEvaluator = __commonJS({
|
|
|
77934
78173
|
decoratedType = newDecoratedType;
|
|
77935
78174
|
}
|
|
77936
78175
|
}
|
|
77937
|
-
decoratedType = (_a = (0, enums_1.transformTypeForPossibleEnumClass)(evaluatorInterface, node, node.name, () => {
|
|
77938
|
-
return { assignedType: decoratedType };
|
|
77939
|
-
})) !== null && _a !== void 0 ? _a : decoratedType;
|
|
77940
78176
|
if ((0, types_1.isFunction)(decoratedType)) {
|
|
77941
78177
|
decoratedType.details.deprecatedMessage = functionType.details.deprecatedMessage;
|
|
77942
78178
|
if (types_1.FunctionType.isOverloaded(decoratedType)) {
|
|
@@ -78200,6 +78436,10 @@ var require_typeEvaluator = __commonJS({
|
|
|
78200
78436
|
functionType.details.flags |= 32768;
|
|
78201
78437
|
}
|
|
78202
78438
|
}
|
|
78439
|
+
const variadicsWithAnyType = functionType.details.parameters.filter((param) => param.category !== 0 && param.name && (0, types_1.isAnyOrUnknown)(param.type));
|
|
78440
|
+
if (variadicsWithAnyType.length >= 2) {
|
|
78441
|
+
functionType.details.flags |= 32768;
|
|
78442
|
+
}
|
|
78203
78443
|
const returnTypeAnnotationNode = (_b = node.returnTypeAnnotation) !== null && _b !== void 0 ? _b : (_c = node.functionAnnotationComment) === null || _c === void 0 ? void 0 : _c.returnTypeAnnotation;
|
|
78204
78444
|
if (returnTypeAnnotationNode) {
|
|
78205
78445
|
functionType.details.declaredReturnType = types_1.UnknownType.create();
|
|
@@ -78217,7 +78457,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
78217
78457
|
}
|
|
78218
78458
|
}
|
|
78219
78459
|
if (functionType.details.declaredReturnType && returnTypeAnnotationNode) {
|
|
78220
|
-
|
|
78460
|
+
(0, typeUtils_1.addTypeVarsToListIfUnique)(typeParametersSeen, (0, typeUtils_1.getTypeVarArgumentsRecursive)(functionType.details.declaredReturnType), functionType.details.typeVarScopeId);
|
|
78221
78461
|
}
|
|
78222
78462
|
if (fileInfo.isStubFile || ParseTreeUtils.isSuiteEmpty(node.suite)) {
|
|
78223
78463
|
if (functionType.details.declaredReturnType && (0, types_1.isClassInstance)(functionType.details.declaredReturnType) && types_1.ClassType.isBuiltIn(functionType.details.declaredReturnType, [
|
|
@@ -78259,25 +78499,6 @@ var require_typeEvaluator = __commonJS({
|
|
|
78259
78499
|
}
|
|
78260
78500
|
}
|
|
78261
78501
|
}
|
|
78262
|
-
function rescopeTypeVarsForCallableReturnType(returnType, functionType, typeParametersSeen) {
|
|
78263
|
-
const typeVarsInReturnType = (0, typeUtils_1.getTypeVarArgumentsRecursive)(returnType).filter((t) => t.scopeId === functionType.details.typeVarScopeId);
|
|
78264
|
-
const rescopedTypeVars = [];
|
|
78265
|
-
typeVarsInReturnType.forEach((typeVar) => {
|
|
78266
|
-
if (types_1.TypeBase.isInstantiable(typeVar)) {
|
|
78267
|
-
typeVar = types_1.TypeVarType.cloneAsInstance(typeVar);
|
|
78268
|
-
}
|
|
78269
|
-
if (typeParametersSeen.some((tp) => (0, types_1.isTypeSame)((0, typeUtils_1.convertToInstance)(tp), typeVar))) {
|
|
78270
|
-
return;
|
|
78271
|
-
}
|
|
78272
|
-
if ((0, typeUtils_1.isTypeVarLimitedToCallable)(returnType, typeVar)) {
|
|
78273
|
-
rescopedTypeVars.push(typeVar);
|
|
78274
|
-
}
|
|
78275
|
-
});
|
|
78276
|
-
(0, typeUtils_1.addTypeVarsToListIfUnique)(typeParametersSeen, typeVarsInReturnType);
|
|
78277
|
-
if (rescopedTypeVars.length > 0) {
|
|
78278
|
-
functionType.details.rescopedTypeParameters = rescopedTypeVars;
|
|
78279
|
-
}
|
|
78280
|
-
}
|
|
78281
78502
|
function adjustParameterAnnotatedType(param, type) {
|
|
78282
78503
|
var _a;
|
|
78283
78504
|
if (((_a = param.defaultValue) === null || _a === void 0 ? void 0 : _a.nodeType) === 11 && param.defaultValue.constType === 26 && !(0, typeUtils_1.isOptionalType)(type) && !AnalyzerNodeInfo.getFileInfo(param).diagnosticRuleSet.strictParameterNoneValue) {
|
|
@@ -79906,19 +80127,26 @@ var require_typeEvaluator = __commonJS({
|
|
|
79906
80127
|
const specializedClass = types_1.ClassType.cloneForSpecialization(classType, typeArgTypes, typeArgs !== void 0);
|
|
79907
80128
|
return { type: specializedClass };
|
|
79908
80129
|
}
|
|
79909
|
-
function getTypeOfArgument(arg, inferenceContext) {
|
|
80130
|
+
function getTypeOfArgument(arg, inferenceContext, signatureTracker) {
|
|
80131
|
+
var _a, _b;
|
|
79910
80132
|
if (arg.typeResult) {
|
|
79911
|
-
|
|
80133
|
+
const type = (_b = (_a = arg.typeResult.type) === null || _a === void 0 ? void 0 : _a.specialForm) !== null && _b !== void 0 ? _b : arg.typeResult.type;
|
|
80134
|
+
return { type, isIncomplete: arg.typeResult.isIncomplete };
|
|
79912
80135
|
}
|
|
79913
80136
|
if (!arg.valueExpression) {
|
|
79914
80137
|
return { type: types_1.UnknownType.create() };
|
|
79915
80138
|
}
|
|
79916
|
-
|
|
80139
|
+
const typeResult = getTypeOfExpression(
|
|
79917
80140
|
arg.valueExpression,
|
|
79918
80141
|
/* flags */
|
|
79919
80142
|
void 0,
|
|
79920
|
-
inferenceContext
|
|
80143
|
+
inferenceContext,
|
|
80144
|
+
signatureTracker
|
|
79921
80145
|
);
|
|
80146
|
+
if (signatureTracker) {
|
|
80147
|
+
typeResult.type = (0, typeUtils_1.ensureFunctionSignaturesAreUnique)(typeResult.type, signatureTracker, arg.valueExpression.start);
|
|
80148
|
+
}
|
|
80149
|
+
return typeResult;
|
|
79922
80150
|
}
|
|
79923
80151
|
function getTypeOfArgumentExpectingType(arg, options) {
|
|
79924
80152
|
if (arg.typeResult) {
|
|
@@ -80292,7 +80520,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
80292
80520
|
return declarations;
|
|
80293
80521
|
}
|
|
80294
80522
|
function getTypeForDeclaration(declaration) {
|
|
80295
|
-
var _a, _b
|
|
80523
|
+
var _a, _b;
|
|
80296
80524
|
switch (declaration.type) {
|
|
80297
80525
|
case 0: {
|
|
80298
80526
|
if (declaration.intrinsicType === "Any") {
|
|
@@ -80399,22 +80627,6 @@ var require_typeEvaluator = __commonJS({
|
|
|
80399
80627
|
});
|
|
80400
80628
|
}
|
|
80401
80629
|
if (declaredType) {
|
|
80402
|
-
if (declaration.node.nodeType === 38) {
|
|
80403
|
-
const variableNode = (_c = ParseTreeUtils.getParentNodeOfType(
|
|
80404
|
-
declaration.node,
|
|
80405
|
-
3
|
|
80406
|
-
/* ParseNodeType.Assignment */
|
|
80407
|
-
)) !== null && _c !== void 0 ? _c : ParseTreeUtils.getParentNodeOfType(
|
|
80408
|
-
declaration.node,
|
|
80409
|
-
54
|
|
80410
|
-
/* ParseNodeType.TypeAnnotation */
|
|
80411
|
-
);
|
|
80412
|
-
if (variableNode) {
|
|
80413
|
-
declaredType = (_d = (0, enums_1.transformTypeForPossibleEnumClass)(evaluatorInterface, variableNode, declaration.node, () => {
|
|
80414
|
-
return { declaredType };
|
|
80415
|
-
})) !== null && _d !== void 0 ? _d : declaredType;
|
|
80416
|
-
}
|
|
80417
|
-
}
|
|
80418
80630
|
if ((0, types_1.isClassInstance)(declaredType) && types_1.ClassType.isBuiltIn(declaredType, "TypeAlias")) {
|
|
80419
80631
|
return { type: void 0, isTypeAlias: true };
|
|
80420
80632
|
}
|
|
@@ -80566,7 +80778,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
80566
80778
|
return typeVar;
|
|
80567
80779
|
}
|
|
80568
80780
|
function getInferredTypeOfDeclaration(symbol, decl) {
|
|
80569
|
-
var _a, _b, _c
|
|
80781
|
+
var _a, _b, _c;
|
|
80570
80782
|
const resolvedDecl = resolveAliasDeclaration(
|
|
80571
80783
|
decl,
|
|
80572
80784
|
/* resolveLocalNames */
|
|
@@ -80669,32 +80881,6 @@ var require_typeEvaluator = __commonJS({
|
|
|
80669
80881
|
let inferredType = (_c = evaluateTypeForSubnode(resolvedDecl.node, () => {
|
|
80670
80882
|
evaluateTypesForStatement(typeSource);
|
|
80671
80883
|
})) === null || _c === void 0 ? void 0 : _c.type;
|
|
80672
|
-
if (inferredType && resolvedDecl.node.nodeType === 38) {
|
|
80673
|
-
const variableNode = (_d = ParseTreeUtils.getParentNodeOfType(
|
|
80674
|
-
resolvedDecl.node,
|
|
80675
|
-
3
|
|
80676
|
-
/* ParseNodeType.Assignment */
|
|
80677
|
-
)) !== null && _d !== void 0 ? _d : ParseTreeUtils.getParentNodeOfType(
|
|
80678
|
-
resolvedDecl.node,
|
|
80679
|
-
54
|
|
80680
|
-
/* ParseNodeType.TypeAnnotation */
|
|
80681
|
-
);
|
|
80682
|
-
if (variableNode) {
|
|
80683
|
-
const enumMemberType = (0, enums_1.transformTypeForPossibleEnumClass)(evaluatorInterface, variableNode, resolvedDecl.node, () => {
|
|
80684
|
-
var _a2, _b2;
|
|
80685
|
-
(0, debug_1.assert)(resolvedDecl.inferredTypeSource !== void 0);
|
|
80686
|
-
const inferredTypeSource = resolvedDecl.inferredTypeSource;
|
|
80687
|
-
return {
|
|
80688
|
-
assignedType: (_b2 = (_a2 = evaluateTypeForSubnode(inferredTypeSource, () => {
|
|
80689
|
-
evaluateTypesForStatement(inferredTypeSource);
|
|
80690
|
-
})) === null || _a2 === void 0 ? void 0 : _a2.type) !== null && _b2 !== void 0 ? _b2 : types_1.UnknownType.create()
|
|
80691
|
-
};
|
|
80692
|
-
});
|
|
80693
|
-
if (enumMemberType) {
|
|
80694
|
-
inferredType = enumMemberType;
|
|
80695
|
-
}
|
|
80696
|
-
}
|
|
80697
|
-
}
|
|
80698
80884
|
if (inferredType && isTypeAlias && resolvedDecl.typeAliasName) {
|
|
80699
80885
|
if (isLegalImplicitTypeAliasType(inferredType)) {
|
|
80700
80886
|
inferredType = transformTypeForTypeAlias(
|
|
@@ -81056,12 +81242,8 @@ var require_typeEvaluator = __commonJS({
|
|
|
81056
81242
|
false
|
|
81057
81243
|
);
|
|
81058
81244
|
if (specializedReturnType && !(0, types_1.isUnknown)(specializedReturnType)) {
|
|
81059
|
-
|
|
81060
|
-
|
|
81061
|
-
specializedReturnType,
|
|
81062
|
-
/* liveTypeVarScopes */
|
|
81063
|
-
[]
|
|
81064
|
-
);
|
|
81245
|
+
const liveTypeVarScopes = (callSiteInfo === null || callSiteInfo === void 0 ? void 0 : callSiteInfo.errorNode) ? ParseTreeUtils.getTypeVarScopesForNode(callSiteInfo === null || callSiteInfo === void 0 ? void 0 : callSiteInfo.errorNode) : [];
|
|
81246
|
+
return adjustCallableReturnType(type, specializedReturnType, liveTypeVarScopes);
|
|
81065
81247
|
}
|
|
81066
81248
|
if (inferTypeIfNeeded) {
|
|
81067
81249
|
return getFunctionInferredReturnType(type, callSiteInfo);
|
|
@@ -81390,22 +81572,24 @@ var require_typeEvaluator = __commonJS({
|
|
|
81390
81572
|
return true;
|
|
81391
81573
|
}
|
|
81392
81574
|
}
|
|
81393
|
-
|
|
81394
|
-
|
|
81395
|
-
|
|
81396
|
-
|
|
81397
|
-
|
|
81398
|
-
destErrorTypeText
|
|
81399
|
-
|
|
81400
|
-
|
|
81401
|
-
|
|
81402
|
-
|
|
81403
|
-
|
|
81404
|
-
|
|
81405
|
-
|
|
81406
|
-
|
|
81407
|
-
|
|
81408
|
-
|
|
81575
|
+
if (diag) {
|
|
81576
|
+
const destErrorType = reportErrorsUsingObjType ? types_1.ClassType.cloneAsInstance(destType) : destType;
|
|
81577
|
+
const srcErrorType = reportErrorsUsingObjType ? types_1.ClassType.cloneAsInstance(srcType) : srcType;
|
|
81578
|
+
let destErrorTypeText = printType(destErrorType);
|
|
81579
|
+
let srcErrorTypeText = printType(srcErrorType);
|
|
81580
|
+
if (destErrorTypeText === srcErrorTypeText && destType.details.fullName && srcType.details.fullName) {
|
|
81581
|
+
destErrorTypeText = destType.details.fullName;
|
|
81582
|
+
srcErrorTypeText = srcType.details.fullName;
|
|
81583
|
+
}
|
|
81584
|
+
diag === null || diag === void 0 ? void 0 : diag.addMessage(localize_1.LocAddendum.typeIncompatible().format({
|
|
81585
|
+
sourceType: srcErrorTypeText,
|
|
81586
|
+
destType: destErrorTypeText
|
|
81587
|
+
}));
|
|
81588
|
+
if (types_1.ClassType.isBuiltIn(destType, "bytes")) {
|
|
81589
|
+
const promotions = typePromotions.get(destType.details.fullName);
|
|
81590
|
+
if (promotions && promotions.some((name) => name === srcType.details.fullName)) {
|
|
81591
|
+
diag === null || diag === void 0 ? void 0 : diag.addMessage(localize_1.LocAddendum.bytesTypePromotions());
|
|
81592
|
+
}
|
|
81409
81593
|
}
|
|
81410
81594
|
}
|
|
81411
81595
|
return false;
|
|
@@ -81813,7 +81997,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
81813
81997
|
return isCompatible;
|
|
81814
81998
|
}
|
|
81815
81999
|
function assignType(destType, srcType, diag, destTypeVarContext, srcTypeVarContext, flags = 0, recursionCount = 0) {
|
|
81816
|
-
var _a, _b;
|
|
82000
|
+
var _a, _b, _c;
|
|
81817
82001
|
if (destType === srcType && !(0, typeUtils_1.requiresSpecialization)(destType)) {
|
|
81818
82002
|
return true;
|
|
81819
82003
|
}
|
|
@@ -82076,7 +82260,14 @@ var require_typeEvaluator = __commonJS({
|
|
|
82076
82260
|
return false;
|
|
82077
82261
|
}
|
|
82078
82262
|
}
|
|
82079
|
-
if (
|
|
82263
|
+
if (types_1.ClassType.isBuiltIn(destType, "type") && ((_c = srcType.instantiableNestingLevel) !== null && _c !== void 0 ? _c : 0) > 0) {
|
|
82264
|
+
return true;
|
|
82265
|
+
}
|
|
82266
|
+
if (isSpecialFormClass(expandedSrcType, flags)) {
|
|
82267
|
+
if (destType.specialForm) {
|
|
82268
|
+
return assignType(destType.specialForm, expandedSrcType, diag, destTypeVarContext, srcTypeVarContext, flags, recursionCount);
|
|
82269
|
+
}
|
|
82270
|
+
} else if (assignClass(
|
|
82080
82271
|
destType,
|
|
82081
82272
|
expandedSrcType,
|
|
82082
82273
|
diag,
|
|
@@ -82830,16 +83021,14 @@ var require_typeEvaluator = __commonJS({
|
|
|
82830
83021
|
}
|
|
82831
83022
|
}
|
|
82832
83023
|
if (!assignType(specializedSrcType, specializedDestType, diag === null || diag === void 0 ? void 0 : diag.createAddendum(), srcTypeVarContext, destTypeVarContext, flags, recursionCount)) {
|
|
82833
|
-
if (
|
|
82834
|
-
|
|
82835
|
-
|
|
82836
|
-
|
|
82837
|
-
|
|
82838
|
-
|
|
82839
|
-
}));
|
|
82840
|
-
}
|
|
82841
|
-
return false;
|
|
83024
|
+
if (diag && paramIndex !== void 0) {
|
|
83025
|
+
diag.addMessage(localize_1.LocAddendum.paramAssignment().format({
|
|
83026
|
+
index: paramIndex + 1,
|
|
83027
|
+
sourceType: printType(destType),
|
|
83028
|
+
destType: printType(srcType)
|
|
83029
|
+
}));
|
|
82842
83030
|
}
|
|
83031
|
+
return false;
|
|
82843
83032
|
}
|
|
82844
83033
|
return true;
|
|
82845
83034
|
}
|
|
@@ -82856,11 +83045,14 @@ var require_typeEvaluator = __commonJS({
|
|
|
82856
83045
|
}
|
|
82857
83046
|
let srcLastToPackIndex = srcDetails.params.findIndex((p, i) => {
|
|
82858
83047
|
(0, debug_1.assert)(destDetails.argsIndex !== void 0);
|
|
82859
|
-
return i >= destDetails.argsIndex && p.
|
|
83048
|
+
return i >= destDetails.argsIndex && p.kind === parameterUtils_1.ParameterKind.Keyword;
|
|
82860
83049
|
});
|
|
82861
83050
|
if (srcLastToPackIndex < 0) {
|
|
82862
83051
|
srcLastToPackIndex = srcDetails.params.length;
|
|
82863
83052
|
}
|
|
83053
|
+
if (srcDetails.argsIndex !== void 0 && destDetails.argsIndex > srcDetails.argsIndex) {
|
|
83054
|
+
return;
|
|
83055
|
+
}
|
|
82864
83056
|
const destFirstNonPositional = (_a = destDetails.firstKeywordOnlyIndex) !== null && _a !== void 0 ? _a : destDetails.params.length;
|
|
82865
83057
|
const suffixLength = destFirstNonPositional - destDetails.argsIndex - 1;
|
|
82866
83058
|
const srcPositionalsToPack = srcDetails.params.slice(destDetails.argsIndex, srcLastToPackIndex - suffixLength);
|
|
@@ -82896,7 +83088,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
82896
83088
|
},
|
|
82897
83089
|
type: srcPositionalsType,
|
|
82898
83090
|
index: -1,
|
|
82899
|
-
|
|
83091
|
+
kind: parameterUtils_1.ParameterKind.Positional
|
|
82900
83092
|
},
|
|
82901
83093
|
...srcDetails.params.slice(destDetails.argsIndex + srcPositionalsToPack.length, srcDetails.params.length)
|
|
82902
83094
|
];
|
|
@@ -82910,13 +83102,13 @@ var require_typeEvaluator = __commonJS({
|
|
|
82910
83102
|
/* ParameterCategory.KwargsDict */
|
|
82911
83103
|
);
|
|
82912
83104
|
srcDetails.kwargsIndex = kwargsIndex >= 0 ? kwargsIndex : void 0;
|
|
82913
|
-
const firstKeywordOnlyIndex = srcDetails.params.findIndex((param) => param.
|
|
83105
|
+
const firstKeywordOnlyIndex = srcDetails.params.findIndex((param) => param.kind === parameterUtils_1.ParameterKind.Keyword);
|
|
82914
83106
|
srcDetails.firstKeywordOnlyIndex = firstKeywordOnlyIndex >= 0 ? firstKeywordOnlyIndex : void 0;
|
|
82915
|
-
srcDetails.positionOnlyParamCount = Math.max(0, srcDetails.params.findIndex((p) => p.
|
|
83107
|
+
srcDetails.positionOnlyParamCount = Math.max(0, srcDetails.params.findIndex((p) => p.kind !== parameterUtils_1.ParameterKind.Positional || p.param.category !== 0 || p.param.hasDefault));
|
|
82916
83108
|
}
|
|
82917
83109
|
}
|
|
82918
83110
|
function assignFunction(destType, srcType, diag, destTypeVarContext, srcTypeVarContext, flags, recursionCount) {
|
|
82919
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
83111
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
82920
83112
|
let canAssign = true;
|
|
82921
83113
|
const checkReturnType = (flags & 64) === 0;
|
|
82922
83114
|
const reverseMatching = (flags & 2) !== 0;
|
|
@@ -82946,9 +83138,9 @@ var require_typeEvaluator = __commonJS({
|
|
|
82946
83138
|
const destParamName = (_c = destParam.param.name) !== null && _c !== void 0 ? _c : "";
|
|
82947
83139
|
const srcParamName = (_d = srcParam.param.name) !== null && _d !== void 0 ? _d : "";
|
|
82948
83140
|
if (destParamName) {
|
|
82949
|
-
const isDestPositionalOnly = destParam.
|
|
83141
|
+
const isDestPositionalOnly = destParam.kind === parameterUtils_1.ParameterKind.Positional;
|
|
82950
83142
|
if (!isDestPositionalOnly && destParam.param.category !== 1 && srcParam.param.category !== 1) {
|
|
82951
|
-
if (srcParam.
|
|
83143
|
+
if (srcParam.kind === parameterUtils_1.ParameterKind.Positional) {
|
|
82952
83144
|
diag === null || diag === void 0 ? void 0 : diag.createAddendum().addMessage(localize_1.LocAddendum.functionParamPositionOnly().format({
|
|
82953
83145
|
name: destParamName
|
|
82954
83146
|
}));
|
|
@@ -82971,10 +83163,17 @@ var require_typeEvaluator = __commonJS({
|
|
|
82971
83163
|
if (paramIndex === 0 && srcType.details.name === "__init__" && types_1.FunctionType.isInstanceMethod(srcType) && destType.details.name === "__init__" && types_1.FunctionType.isInstanceMethod(destType) && types_1.FunctionType.isOverloaded(destType) && destParam.param.hasDeclaredType) {
|
|
82972
83164
|
continue;
|
|
82973
83165
|
}
|
|
82974
|
-
if (
|
|
83166
|
+
if ((0, types_1.isUnpacked)(srcParamType)) {
|
|
83167
|
+
canAssign = false;
|
|
83168
|
+
} else if (!assignFunctionParameter(destParamType, srcParamType, paramIndex, diag === null || diag === void 0 ? void 0 : diag.createAddendum(), destTypeVarContext, srcTypeVarContext, flags, recursionCount)) {
|
|
82975
83169
|
if ((flags & 512) === 0 || !(0, types_1.isTypeVar)(srcParamType) || !srcParamType.details.isSynthesized) {
|
|
82976
83170
|
canAssign = false;
|
|
82977
83171
|
}
|
|
83172
|
+
} else if (destParam.kind !== parameterUtils_1.ParameterKind.Positional && srcParam.kind === parameterUtils_1.ParameterKind.Positional && srcParamDetails.kwargsIndex === void 0 && !srcParamDetails.params.some((p) => p.kind === parameterUtils_1.ParameterKind.Keyword && p.param.category === 0 && p.param.name === destParam.param.name)) {
|
|
83173
|
+
diag === null || diag === void 0 ? void 0 : diag.addMessage(localize_1.LocAddendum.namedParamMissingInSource().format({
|
|
83174
|
+
name: (_e = destParam.param.name) !== null && _e !== void 0 ? _e : ""
|
|
83175
|
+
}));
|
|
83176
|
+
canAssign = false;
|
|
82978
83177
|
}
|
|
82979
83178
|
}
|
|
82980
83179
|
if (!types_1.FunctionType.shouldSkipArgsKwargsCompatibilityCheck(destType) && destParamDetails.firstPositionOrKeywordIndex < srcParamDetails.positionOnlyParamCount && !targetIncludesParamSpec) {
|
|
@@ -82984,33 +83183,50 @@ var require_typeEvaluator = __commonJS({
|
|
|
82984
83183
|
}));
|
|
82985
83184
|
canAssign = false;
|
|
82986
83185
|
}
|
|
82987
|
-
if (destPositionalCount < srcPositionalCount) {
|
|
82988
|
-
|
|
83186
|
+
if (destPositionalCount < srcPositionalCount && !targetIncludesParamSpec) {
|
|
83187
|
+
for (let i = destPositionalCount; i < srcPositionalCount; i++) {
|
|
83188
|
+
if (destParamDetails.argsIndex !== void 0) {
|
|
83189
|
+
const destArgsType = destParamDetails.params[destParamDetails.argsIndex].type;
|
|
83190
|
+
const srcParamType = srcParamDetails.params[i].type;
|
|
83191
|
+
if (!assignFunctionParameter(destArgsType, srcParamType, i, diag === null || diag === void 0 ? void 0 : diag.createAddendum(), destTypeVarContext, srcTypeVarContext, flags, recursionCount)) {
|
|
83192
|
+
canAssign = false;
|
|
83193
|
+
}
|
|
83194
|
+
continue;
|
|
83195
|
+
}
|
|
83196
|
+
const srcParam = srcParamDetails.params[i];
|
|
83197
|
+
if (srcParam.param.hasDefault) {
|
|
83198
|
+
const paramInfo = srcParamDetails.params[i];
|
|
83199
|
+
const defaultArgType = (_f = paramInfo.defaultArgType) !== null && _f !== void 0 ? _f : paramInfo.param.defaultType;
|
|
83200
|
+
if (defaultArgType && !assignType(
|
|
83201
|
+
paramInfo.type,
|
|
83202
|
+
defaultArgType,
|
|
83203
|
+
diag === null || diag === void 0 ? void 0 : diag.createAddendum(),
|
|
83204
|
+
srcTypeVarContext,
|
|
83205
|
+
/* destTypeVarContext */
|
|
83206
|
+
void 0,
|
|
83207
|
+
flags,
|
|
83208
|
+
recursionCount
|
|
83209
|
+
)) {
|
|
83210
|
+
canAssign = false;
|
|
83211
|
+
}
|
|
83212
|
+
continue;
|
|
83213
|
+
}
|
|
83214
|
+
if (srcParam.kind === parameterUtils_1.ParameterKind.Standard) {
|
|
83215
|
+
continue;
|
|
83216
|
+
}
|
|
83217
|
+
if (srcParam.param.category === 1) {
|
|
83218
|
+
continue;
|
|
83219
|
+
}
|
|
82989
83220
|
const nonDefaultSrcParamCount = srcParamDetails.params.filter(
|
|
82990
83221
|
(p) => !!p.param.name && !p.param.hasDefault && p.param.category === 0
|
|
82991
83222
|
/* ParameterCategory.Simple */
|
|
82992
83223
|
).length;
|
|
82993
|
-
|
|
82994
|
-
|
|
82995
|
-
|
|
82996
|
-
|
|
82997
|
-
|
|
82998
|
-
|
|
82999
|
-
}));
|
|
83000
|
-
canAssign = false;
|
|
83001
|
-
}
|
|
83002
|
-
}
|
|
83003
|
-
} else {
|
|
83004
|
-
const destArgsType = destParamDetails.params[destParamDetails.argsIndex].type;
|
|
83005
|
-
if (!(0, types_1.isAnyOrUnknown)(destArgsType)) {
|
|
83006
|
-
for (let paramIndex = destPositionalCount; paramIndex < srcPositionalCount; paramIndex++) {
|
|
83007
|
-
const srcParamType = srcParamDetails.params[paramIndex].type;
|
|
83008
|
-
if (!assignFunctionParameter(destArgsType, srcParamType, paramIndex, diag === null || diag === void 0 ? void 0 : diag.createAddendum(), destTypeVarContext, srcTypeVarContext, flags, recursionCount)) {
|
|
83009
|
-
canAssign = false;
|
|
83010
|
-
}
|
|
83011
|
-
}
|
|
83012
|
-
}
|
|
83013
|
-
}
|
|
83224
|
+
diag === null || diag === void 0 ? void 0 : diag.createAddendum().addMessage(localize_1.LocAddendum.functionTooFewParams().format({
|
|
83225
|
+
expected: nonDefaultSrcParamCount,
|
|
83226
|
+
received: destPositionalCount
|
|
83227
|
+
}));
|
|
83228
|
+
canAssign = false;
|
|
83229
|
+
break;
|
|
83014
83230
|
}
|
|
83015
83231
|
} else if (srcPositionalCount < destPositionalCount) {
|
|
83016
83232
|
if (srcParamDetails.argsIndex !== void 0) {
|
|
@@ -83027,9 +83243,9 @@ var require_typeEvaluator = __commonJS({
|
|
|
83027
83243
|
if (!assignFunctionParameter(destParamType, srcArgsType, paramIndex, diag === null || diag === void 0 ? void 0 : diag.createAddendum(), destTypeVarContext, srcTypeVarContext, flags, recursionCount)) {
|
|
83028
83244
|
canAssign = false;
|
|
83029
83245
|
}
|
|
83030
|
-
if (destParamDetails.params[paramIndex].
|
|
83246
|
+
if (destParamDetails.params[paramIndex].kind !== parameterUtils_1.ParameterKind.Positional && srcParamDetails.kwargsIndex === void 0) {
|
|
83031
83247
|
diag === null || diag === void 0 ? void 0 : diag.addMessage(localize_1.LocAddendum.namedParamMissingInSource().format({
|
|
83032
|
-
name: (
|
|
83248
|
+
name: (_g = destParamDetails.params[paramIndex].param.name) !== null && _g !== void 0 ? _g : ""
|
|
83033
83249
|
}));
|
|
83034
83250
|
canAssign = false;
|
|
83035
83251
|
}
|
|
@@ -83072,7 +83288,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
83072
83288
|
}
|
|
83073
83289
|
if (!types_1.FunctionType.shouldSkipArgsKwargsCompatibilityCheck(destType) && srcParamDetails.argsIndex === void 0 && srcType.details.paramSpec === void 0 && destParamDetails.argsIndex !== void 0 && !destParamDetails.hasUnpackedVariadicTypeVar) {
|
|
83074
83290
|
diag === null || diag === void 0 ? void 0 : diag.createAddendum().addMessage(localize_1.LocAddendum.argsParamMissing().format({
|
|
83075
|
-
paramName: (
|
|
83291
|
+
paramName: (_h = destParamDetails.params[destParamDetails.argsIndex].param.name) !== null && _h !== void 0 ? _h : ""
|
|
83076
83292
|
}));
|
|
83077
83293
|
canAssign = false;
|
|
83078
83294
|
}
|
|
@@ -83093,14 +83309,15 @@ var require_typeEvaluator = __commonJS({
|
|
|
83093
83309
|
}
|
|
83094
83310
|
if (srcStartOfNamed >= 0) {
|
|
83095
83311
|
srcParamDetails.params.forEach((srcParamInfo, index) => {
|
|
83312
|
+
var _a2;
|
|
83096
83313
|
if (index >= srcStartOfNamed) {
|
|
83097
|
-
if (srcParamInfo.param.name && srcParamInfo.param.category === 0 && srcParamInfo.
|
|
83314
|
+
if (srcParamInfo.param.name && srcParamInfo.param.category === 0 && srcParamInfo.kind !== parameterUtils_1.ParameterKind.Positional) {
|
|
83098
83315
|
const destParamInfo = destParamMap.get(srcParamInfo.param.name);
|
|
83099
83316
|
const paramDiag = diag === null || diag === void 0 ? void 0 : diag.createAddendum();
|
|
83100
83317
|
const srcParamType = srcParamInfo.type;
|
|
83101
83318
|
if (!destParamInfo) {
|
|
83102
83319
|
if (destParamDetails.kwargsIndex === void 0 && !srcParamInfo.param.hasDefault) {
|
|
83103
|
-
if (paramDiag
|
|
83320
|
+
if (paramDiag) {
|
|
83104
83321
|
paramDiag.addMessage(localize_1.LocAddendum.namedParamMissingInDest().format({
|
|
83105
83322
|
name: srcParamInfo.param.name
|
|
83106
83323
|
}));
|
|
@@ -83110,6 +83327,20 @@ var require_typeEvaluator = __commonJS({
|
|
|
83110
83327
|
if (!assignFunctionParameter(destParamDetails.params[destParamDetails.kwargsIndex].type, srcParamType, destParamDetails.params[destParamDetails.kwargsIndex].index, diag === null || diag === void 0 ? void 0 : diag.createAddendum(), destTypeVarContext, srcTypeVarContext, flags, recursionCount)) {
|
|
83111
83328
|
canAssign = false;
|
|
83112
83329
|
}
|
|
83330
|
+
} else if (srcParamInfo.param.hasDefault) {
|
|
83331
|
+
const defaultArgType = (_a2 = srcParamInfo.defaultArgType) !== null && _a2 !== void 0 ? _a2 : srcParamInfo.param.defaultType;
|
|
83332
|
+
if (defaultArgType && !assignType(
|
|
83333
|
+
srcParamInfo.type,
|
|
83334
|
+
defaultArgType,
|
|
83335
|
+
diag === null || diag === void 0 ? void 0 : diag.createAddendum(),
|
|
83336
|
+
srcTypeVarContext,
|
|
83337
|
+
/* destTypeVarContext */
|
|
83338
|
+
void 0,
|
|
83339
|
+
flags,
|
|
83340
|
+
recursionCount
|
|
83341
|
+
)) {
|
|
83342
|
+
canAssign = false;
|
|
83343
|
+
}
|
|
83113
83344
|
}
|
|
83114
83345
|
} else {
|
|
83115
83346
|
const destParamType = destParamInfo.type;
|
|
@@ -83169,7 +83400,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
83169
83400
|
canAssign = false;
|
|
83170
83401
|
}
|
|
83171
83402
|
}
|
|
83172
|
-
if (targetIncludesParamSpec && ((
|
|
83403
|
+
if (targetIncludesParamSpec && ((_j = srcType.details.paramSpec) === null || _j === void 0 ? void 0 : _j.nameWithScope) === ((_k = destType.details.paramSpec) === null || _k === void 0 ? void 0 : _k.nameWithScope)) {
|
|
83173
83404
|
if (srcParamDetails.params.length !== destParamDetails.params.length) {
|
|
83174
83405
|
canAssign = false;
|
|
83175
83406
|
}
|
|
@@ -83569,10 +83800,10 @@ var require_typeEvaluator = __commonJS({
|
|
|
83569
83800
|
}
|
|
83570
83801
|
const baseParam = baseParamDetails.params[i].param;
|
|
83571
83802
|
const overrideParam = overrideParamDetails.params[i].param;
|
|
83572
|
-
if (i >= baseParamDetails.positionOnlyParamCount && !(0, symbolNameUtils_1.isPrivateOrProtectedName)(baseParam.name || "") && baseParamDetails.params[i].
|
|
83803
|
+
if (i >= baseParamDetails.positionOnlyParamCount && !(0, symbolNameUtils_1.isPrivateOrProtectedName)(baseParam.name || "") && baseParamDetails.params[i].kind !== parameterUtils_1.ParameterKind.Positional && baseParam.category === 0 && enforceParamNames && baseParam.name !== overrideParam.name) {
|
|
83573
83804
|
if (overrideParam.category === 0) {
|
|
83574
83805
|
if (!baseParam.isNameSynthesized) {
|
|
83575
|
-
if (overrideParamDetails.params[i].
|
|
83806
|
+
if (overrideParamDetails.params[i].kind === parameterUtils_1.ParameterKind.Positional) {
|
|
83576
83807
|
diag === null || diag === void 0 ? void 0 : diag.addMessage(localize_1.LocAddendum.overrideParamNamePositionOnly().format({
|
|
83577
83808
|
index: i + 1,
|
|
83578
83809
|
baseName: baseParam.name || "*"
|
|
@@ -83588,7 +83819,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
83588
83819
|
}
|
|
83589
83820
|
}
|
|
83590
83821
|
} else if (i < overrideParamDetails.positionOnlyParamCount && i >= baseParamDetails.positionOnlyParamCount) {
|
|
83591
|
-
if (!baseParam.isNameSynthesized && baseParamDetails.params[i].
|
|
83822
|
+
if (!baseParam.isNameSynthesized && baseParamDetails.params[i].kind !== parameterUtils_1.ParameterKind.Positional) {
|
|
83592
83823
|
diag === null || diag === void 0 ? void 0 : diag.addMessage(localize_1.LocAddendum.overrideParamNamePositionOnly().format({
|
|
83593
83824
|
index: i + 1,
|
|
83594
83825
|
baseName: baseParam.name || "*"
|
|
@@ -83629,7 +83860,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
83629
83860
|
if (enforceParamNames && overrideParamDetails.kwargsIndex === void 0) {
|
|
83630
83861
|
for (let i = positionalParamCount; i < baseParamDetails.positionParamCount; i++) {
|
|
83631
83862
|
const baseParam = baseParamDetails.params[i];
|
|
83632
|
-
if (baseParam.
|
|
83863
|
+
if (baseParam.kind === parameterUtils_1.ParameterKind.Standard && baseParam.param.category === 0) {
|
|
83633
83864
|
diag === null || diag === void 0 ? void 0 : diag.addMessage(localize_1.LocAddendum.overrideParamNamePositionOnly().format({
|
|
83634
83865
|
index: i + 1,
|
|
83635
83866
|
baseName: baseParam.param.name || "*"
|
|
@@ -83667,11 +83898,11 @@ var require_typeEvaluator = __commonJS({
|
|
|
83667
83898
|
}
|
|
83668
83899
|
}
|
|
83669
83900
|
const baseKwOnlyParams = baseParamDetails.params.filter(
|
|
83670
|
-
(paramInfo) => paramInfo.
|
|
83901
|
+
(paramInfo) => paramInfo.kind === parameterUtils_1.ParameterKind.Keyword && paramInfo.param.category === 0
|
|
83671
83902
|
/* ParameterCategory.Simple */
|
|
83672
83903
|
);
|
|
83673
83904
|
const overrideKwOnlyParams = overrideParamDetails.params.filter(
|
|
83674
|
-
(paramInfo) => paramInfo.
|
|
83905
|
+
(paramInfo) => paramInfo.kind === parameterUtils_1.ParameterKind.Keyword && paramInfo.param.category === 0
|
|
83675
83906
|
/* ParameterCategory.Simple */
|
|
83676
83907
|
);
|
|
83677
83908
|
baseKwOnlyParams.forEach((paramInfo) => {
|
|
@@ -85363,14 +85594,14 @@ var require_checker = __commonJS({
|
|
|
85363
85594
|
}
|
|
85364
85595
|
const exprTypeResult = this._evaluator.getTypeOfExpression(expression);
|
|
85365
85596
|
let isExprFunction = true;
|
|
85366
|
-
let isCoroutine =
|
|
85597
|
+
let isCoroutine = true;
|
|
85367
85598
|
(0, typeUtils_1.doForEachSubtype)(exprTypeResult.type, (subtype) => {
|
|
85368
85599
|
subtype = this._evaluator.makeTopLevelTypeVarsConcrete(subtype);
|
|
85369
85600
|
if (!(0, types_1.isFunction)(subtype) && !(0, types_1.isOverloadedFunction)(subtype)) {
|
|
85370
85601
|
isExprFunction = false;
|
|
85371
85602
|
}
|
|
85372
|
-
if ((0, types_1.isClassInstance)(subtype)
|
|
85373
|
-
isCoroutine =
|
|
85603
|
+
if (!(0, types_1.isClassInstance)(subtype) || !types_1.ClassType.isBuiltIn(subtype, "Coroutine")) {
|
|
85604
|
+
isCoroutine = false;
|
|
85374
85605
|
}
|
|
85375
85606
|
});
|
|
85376
85607
|
if (isExprFunction) {
|
|
@@ -85805,6 +86036,15 @@ var require_checker = __commonJS({
|
|
|
85805
86036
|
exemptBoundTypeVar = false;
|
|
85806
86037
|
nameWalker.walk(node.returnTypeAnnotation);
|
|
85807
86038
|
}
|
|
86039
|
+
if (node.functionAnnotationComment) {
|
|
86040
|
+
node.functionAnnotationComment.paramTypeAnnotations.forEach((expr) => {
|
|
86041
|
+
nameWalker.walk(expr);
|
|
86042
|
+
});
|
|
86043
|
+
if (node.functionAnnotationComment.returnTypeAnnotation) {
|
|
86044
|
+
exemptBoundTypeVar = false;
|
|
86045
|
+
nameWalker.walk(node.functionAnnotationComment.returnTypeAnnotation);
|
|
86046
|
+
}
|
|
86047
|
+
}
|
|
85808
86048
|
localTypeVarUsage.forEach((usage) => {
|
|
85809
86049
|
var _a;
|
|
85810
86050
|
if (usage.nodes.length === 1 && !usage.isExempt) {
|
|
@@ -87121,7 +87361,7 @@ var require_checker = __commonJS({
|
|
|
87121
87361
|
}
|
|
87122
87362
|
}
|
|
87123
87363
|
_conditionallyReportPrivateUsage(node) {
|
|
87124
|
-
var _a;
|
|
87364
|
+
var _a, _b;
|
|
87125
87365
|
if (this._fileInfo.diagnosticRuleSet.reportPrivateUsage === "none") {
|
|
87126
87366
|
return;
|
|
87127
87367
|
}
|
|
@@ -87137,7 +87377,7 @@ var require_checker = __commonJS({
|
|
|
87137
87377
|
if (!isPrivateName && !isProtectedName) {
|
|
87138
87378
|
return;
|
|
87139
87379
|
}
|
|
87140
|
-
const declarations = this._evaluator.getDeclarationsForNameNode(node);
|
|
87380
|
+
const declarations = (_b = this._evaluator.getDeclarationsForNameNode(node)) === null || _b === void 0 ? void 0 : _b.filter((decl) => decl.type !== 1 || !decl.isExplicitBinding);
|
|
87141
87381
|
let primaryDeclaration = declarations && declarations.length > 0 ? declarations[declarations.length - 1] : void 0;
|
|
87142
87382
|
if (!primaryDeclaration || primaryDeclaration.node === node) {
|
|
87143
87383
|
return;
|
|
@@ -87425,8 +87665,8 @@ var require_checker = __commonJS({
|
|
|
87425
87665
|
if (symbol.getTypedDeclarations().length > 0) {
|
|
87426
87666
|
return;
|
|
87427
87667
|
}
|
|
87428
|
-
const symbolType = this._evaluator
|
|
87429
|
-
if (!(0, types_1.isClassInstance)(symbolType) || !types_1.ClassType.isSameGenericClass(symbolType, classType) || !(symbolType.literalValue instanceof types_1.EnumLiteral)) {
|
|
87668
|
+
const symbolType = (0, enums_1.transformTypeForEnumMember)(this._evaluator, classType, name);
|
|
87669
|
+
if (!symbolType || !(0, types_1.isClassInstance)(symbolType) || !types_1.ClassType.isSameGenericClass(symbolType, classType) || !(symbolType.literalValue instanceof types_1.EnumLiteral)) {
|
|
87430
87670
|
return;
|
|
87431
87671
|
}
|
|
87432
87672
|
const decls = symbol.getDeclarations();
|
|
@@ -87454,10 +87694,34 @@ var require_checker = __commonJS({
|
|
|
87454
87694
|
}
|
|
87455
87695
|
];
|
|
87456
87696
|
if (newMemberTypeResult) {
|
|
87457
|
-
this._evaluator.validateCallArguments(
|
|
87697
|
+
this._evaluator.validateCallArguments(
|
|
87698
|
+
errorNode,
|
|
87699
|
+
argList,
|
|
87700
|
+
newMemberTypeResult,
|
|
87701
|
+
/* typeVarContext */
|
|
87702
|
+
void 0,
|
|
87703
|
+
/* skipUnknownArgCheck */
|
|
87704
|
+
void 0,
|
|
87705
|
+
/* inferenceContext */
|
|
87706
|
+
void 0,
|
|
87707
|
+
/* signatureTracker */
|
|
87708
|
+
void 0
|
|
87709
|
+
);
|
|
87458
87710
|
}
|
|
87459
87711
|
if (initMemberTypeResult) {
|
|
87460
|
-
this._evaluator.validateCallArguments(
|
|
87712
|
+
this._evaluator.validateCallArguments(
|
|
87713
|
+
errorNode,
|
|
87714
|
+
argList,
|
|
87715
|
+
initMemberTypeResult,
|
|
87716
|
+
/* typeVarContext */
|
|
87717
|
+
void 0,
|
|
87718
|
+
/* skipUnknownArgCheck */
|
|
87719
|
+
void 0,
|
|
87720
|
+
/* inferenceContext */
|
|
87721
|
+
void 0,
|
|
87722
|
+
/* signatureTracker */
|
|
87723
|
+
void 0
|
|
87724
|
+
);
|
|
87461
87725
|
}
|
|
87462
87726
|
}
|
|
87463
87727
|
} else if (declaredValueType) {
|
|
@@ -89375,7 +89639,7 @@ var require_sourceFile = __commonJS({
|
|
|
89375
89639
|
IPythonMode2[IPythonMode2["CellDocs"] = 1] = "CellDocs";
|
|
89376
89640
|
})(IPythonMode || (exports2.IPythonMode = IPythonMode = {}));
|
|
89377
89641
|
var WriteableData = class {
|
|
89378
|
-
constructor() {
|
|
89642
|
+
constructor(console2) {
|
|
89379
89643
|
this.diagnosticVersion = 0;
|
|
89380
89644
|
this.fileContentsVersion = 0;
|
|
89381
89645
|
this.lastFileContentLength = void 0;
|
|
@@ -89396,6 +89660,17 @@ var require_sourceFile = __commonJS({
|
|
|
89396
89660
|
this.isBindingNeeded = true;
|
|
89397
89661
|
this.isCheckingNeeded = true;
|
|
89398
89662
|
this.isFileDeleted = false;
|
|
89663
|
+
if (console_1.ConsoleInterface.hasLevel(console2)) {
|
|
89664
|
+
this._consoleWithLevel = console2;
|
|
89665
|
+
}
|
|
89666
|
+
}
|
|
89667
|
+
get parserOutput() {
|
|
89668
|
+
return this._parserOutput;
|
|
89669
|
+
}
|
|
89670
|
+
set parserOutput(value) {
|
|
89671
|
+
var _a;
|
|
89672
|
+
this._lastCallstack = ((_a = this._consoleWithLevel) === null || _a === void 0 ? void 0 : _a.level) === console_1.LogLevel.Log && value === void 0 && this._parserOutput !== void 0 ? new Error().stack : void 0;
|
|
89673
|
+
this._parserOutput = value;
|
|
89399
89674
|
}
|
|
89400
89675
|
debugPrint() {
|
|
89401
89676
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
@@ -89427,17 +89702,18 @@ var require_sourceFile = __commonJS({
|
|
|
89427
89702
|
pyrightIgnoreLines=${(_l = this.pyrightIgnoreLines) === null || _l === void 0 ? void 0 : _l.size},
|
|
89428
89703
|
checkTime=${this.checkTime},
|
|
89429
89704
|
clientDocumentContents=${(_m = this.clientDocumentContents) === null || _m === void 0 ? void 0 : _m.length},
|
|
89430
|
-
parseResults=${(_o = this.parserOutput) === null || _o === void 0 ? void 0 : _o.parseTree.length}
|
|
89705
|
+
parseResults=${(_o = this.parserOutput) === null || _o === void 0 ? void 0 : _o.parseTree.length},
|
|
89706
|
+
parseResultsDropCallstack=${this._lastCallstack}`;
|
|
89431
89707
|
}
|
|
89432
89708
|
};
|
|
89433
89709
|
var SourceFile = class {
|
|
89434
89710
|
constructor(serviceProvider, uri, moduleName, isThirdPartyImport, isThirdPartyPyTypedPresent, editMode, console2, logTracker, ipythonMode) {
|
|
89435
89711
|
this.serviceProvider = serviceProvider;
|
|
89436
|
-
this._writableData = new WriteableData();
|
|
89437
89712
|
this._diagnosticRuleSet = (0, configOptions_1.getBasicDiagnosticRuleSet)();
|
|
89438
89713
|
this._ipythonMode = IPythonMode.None;
|
|
89439
89714
|
this.fileSystem = serviceProvider.get(serviceKeys_1.ServiceKeys.fs);
|
|
89440
89715
|
this._console = console2 || new console_1.StandardConsole();
|
|
89716
|
+
this._writableData = new WriteableData(this._console);
|
|
89441
89717
|
this._editMode = editMode;
|
|
89442
89718
|
this._uri = uri;
|
|
89443
89719
|
this._moduleName = moduleName;
|
|
@@ -89826,7 +90102,7 @@ var require_sourceFile = __commonJS({
|
|
|
89826
90102
|
});
|
|
89827
90103
|
}
|
|
89828
90104
|
check(configOptions, importResolver, evaluator, sourceMapper, dependentFiles) {
|
|
89829
|
-
(0, debug_1.assert)(!this.isParseRequired(),
|
|
90105
|
+
(0, debug_1.assert)(!this.isParseRequired(), `Check called before parsing: state=${this._writableData.debugPrint()}`);
|
|
89830
90106
|
(0, debug_1.assert)(!this.isBindingRequired(), `Check called before binding: state=${this._writableData.debugPrint()}`);
|
|
89831
90107
|
(0, debug_1.assert)(!this._writableData.isBindingInProgress, "Check called while binding in progress");
|
|
89832
90108
|
(0, debug_1.assert)(this.isCheckingRequired(), "Check called unnecessarily");
|
|
@@ -89957,7 +90233,9 @@ var require_sourceFile = __commonJS({
|
|
|
89957
90233
|
const rangeEnd = rangeStart + this._writableData.typeIgnoreAll.range.length;
|
|
89958
90234
|
const range = (0, positionUtils_1.convertOffsetsToRange)(rangeStart, rangeEnd, this._writableData.tokenizerLines);
|
|
89959
90235
|
if (!isUnreachableCodeRange(range) && this._diagnosticRuleSet.enableTypeIgnoreComments) {
|
|
89960
|
-
|
|
90236
|
+
const diag = new diagnostic_1.Diagnostic(diagCategory, localize_1.LocMessage.unnecessaryTypeIgnore(), range);
|
|
90237
|
+
diag.setRule(diagnosticRules_1.DiagnosticRule.reportUnnecessaryTypeIgnoreComment);
|
|
90238
|
+
unnecessaryTypeIgnoreDiags.push(diag);
|
|
89961
90239
|
}
|
|
89962
90240
|
}
|
|
89963
90241
|
typeIgnoreLinesClone.forEach((ignoreComment) => {
|
|
@@ -89966,7 +90244,9 @@ var require_sourceFile = __commonJS({
|
|
|
89966
90244
|
const rangeEnd = rangeStart + ignoreComment.range.length;
|
|
89967
90245
|
const range = (0, positionUtils_1.convertOffsetsToRange)(rangeStart, rangeEnd, this._writableData.tokenizerLines);
|
|
89968
90246
|
if (!isUnreachableCodeRange(range) && this._diagnosticRuleSet.enableTypeIgnoreComments) {
|
|
89969
|
-
|
|
90247
|
+
const diag = new diagnostic_1.Diagnostic(diagCategory, localize_1.LocMessage.unnecessaryTypeIgnore(), range);
|
|
90248
|
+
diag.setRule(diagnosticRules_1.DiagnosticRule.reportUnnecessaryTypeIgnoreComment);
|
|
90249
|
+
unnecessaryTypeIgnoreDiags.push(diag);
|
|
89970
90250
|
}
|
|
89971
90251
|
}
|
|
89972
90252
|
});
|
|
@@ -89977,7 +90257,9 @@ var require_sourceFile = __commonJS({
|
|
|
89977
90257
|
const rangeEnd = rangeStart + ignoreComment.range.length;
|
|
89978
90258
|
const range = (0, positionUtils_1.convertOffsetsToRange)(rangeStart, rangeEnd, this._writableData.tokenizerLines);
|
|
89979
90259
|
if (!isUnreachableCodeRange(range)) {
|
|
89980
|
-
|
|
90260
|
+
const diag = new diagnostic_1.Diagnostic(diagCategory, localize_1.LocMessage.unnecessaryTypeIgnore(), range);
|
|
90261
|
+
diag.setRule(diagnosticRules_1.DiagnosticRule.reportUnnecessaryTypeIgnoreComment);
|
|
90262
|
+
unnecessaryTypeIgnoreDiags.push(diag);
|
|
89981
90263
|
}
|
|
89982
90264
|
} else {
|
|
89983
90265
|
ignoreComment.rulesList.forEach((unusedRule) => {
|
|
@@ -89985,9 +90267,11 @@ var require_sourceFile = __commonJS({
|
|
|
89985
90267
|
const rangeEnd = rangeStart + unusedRule.range.length;
|
|
89986
90268
|
const range = (0, positionUtils_1.convertOffsetsToRange)(rangeStart, rangeEnd, this._writableData.tokenizerLines);
|
|
89987
90269
|
if (!isUnreachableCodeRange(range)) {
|
|
89988
|
-
|
|
90270
|
+
const diag = new diagnostic_1.Diagnostic(diagCategory, localize_1.LocMessage.unnecessaryPyrightIgnoreRule().format({
|
|
89989
90271
|
name: unusedRule.text
|
|
89990
|
-
}), range)
|
|
90272
|
+
}), range);
|
|
90273
|
+
diag.setRule(diagnosticRules_1.DiagnosticRule.reportUnnecessaryTypeIgnoreComment);
|
|
90274
|
+
unnecessaryTypeIgnoreDiags.push(diag);
|
|
89991
90275
|
}
|
|
89992
90276
|
});
|
|
89993
90277
|
}
|
|
@@ -90030,7 +90314,7 @@ var require_sourceFile = __commonJS({
|
|
|
90030
90314
|
return;
|
|
90031
90315
|
}
|
|
90032
90316
|
this._preEditData = this._writableData;
|
|
90033
|
-
this._writableData = new WriteableData();
|
|
90317
|
+
this._writableData = new WriteableData(this._console);
|
|
90034
90318
|
}
|
|
90035
90319
|
// Get all task list diagnostics for the current file and add them
|
|
90036
90320
|
// to the specified diagnostic list.
|
|
@@ -92856,7 +93140,7 @@ var require_parser = __commonJS({
|
|
|
92856
93140
|
const peekToken1 = this._peekToken(1);
|
|
92857
93141
|
const peekToken2 = this._peekToken(2);
|
|
92858
93142
|
let isInvalidTypeToken = true;
|
|
92859
|
-
if (peekToken1.type === 7 || peekToken1.type === 8) {
|
|
93143
|
+
if (peekToken1.type === 7 || peekToken1.type === 8 && tokenizerTypes_1.KeywordToken.isSoftKeyword(peekToken1)) {
|
|
92860
93144
|
if (peekToken2.type === 15) {
|
|
92861
93145
|
isInvalidTypeToken = false;
|
|
92862
93146
|
} else if (peekToken2.type === 9 && peekToken2.operatorType === 2) {
|
|
@@ -94738,8 +95022,8 @@ var require_parser = __commonJS({
|
|
|
94738
95022
|
return tokenizerTypes_1.IdentifierToken.create(nextToken.start, nextToken.length, "", nextToken.comments);
|
|
94739
95023
|
}
|
|
94740
95024
|
if (nextToken.type === 8) {
|
|
94741
|
-
const
|
|
94742
|
-
if (tokenizerTypes_1.
|
|
95025
|
+
const keywordToken = nextToken;
|
|
95026
|
+
if (tokenizerTypes_1.KeywordToken.isSoftKeyword(keywordToken)) {
|
|
94743
95027
|
const keywordText = this._fileContents.substr(nextToken.start, nextToken.length);
|
|
94744
95028
|
this._getNextToken();
|
|
94745
95029
|
return tokenizerTypes_1.IdentifierToken.create(nextToken.start, nextToken.length, keywordText, nextToken.comments);
|