coc-pyright 1.1.395 → 1.1.400
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/README.md +2 -2
- package/lib/index.js +1172 -778
- package/package.json +4 -4
package/lib/index.js
CHANGED
|
@@ -518,6 +518,7 @@ var require_core = __commonJS({
|
|
|
518
518
|
exports2.isDefined = isDefined;
|
|
519
519
|
exports2.getEnumNames = getEnumNames;
|
|
520
520
|
exports2.containsOnlyWhitespace = containsOnlyWhitespace;
|
|
521
|
+
exports2.cloneStr = cloneStr;
|
|
521
522
|
var textRange_1 = require_textRange();
|
|
522
523
|
var Comparison;
|
|
523
524
|
(function(Comparison2) {
|
|
@@ -606,6 +607,9 @@ var require_core = __commonJS({
|
|
|
606
607
|
}
|
|
607
608
|
return /^\s*$/.test(text);
|
|
608
609
|
}
|
|
610
|
+
function cloneStr(str) {
|
|
611
|
+
return Buffer.from(str, "utf8").toString("utf8");
|
|
612
|
+
}
|
|
609
613
|
var Disposable;
|
|
610
614
|
(function(Disposable2) {
|
|
611
615
|
function is(value) {
|
|
@@ -2155,6 +2159,7 @@ var require_serviceKeys = __commonJS({
|
|
|
2155
2159
|
ServiceKeys2.docStringService = new serviceProvider_1.ServiceKey();
|
|
2156
2160
|
ServiceKeys2.windowService = new serviceProvider_1.ServiceKey();
|
|
2157
2161
|
ServiceKeys2.commandService = new serviceProvider_1.ServiceKey();
|
|
2162
|
+
ServiceKeys2.cancellationProvider = new serviceProvider_1.ServiceKey();
|
|
2158
2163
|
})(ServiceKeys || (exports2.ServiceKeys = ServiceKeys = {}));
|
|
2159
2164
|
}
|
|
2160
2165
|
});
|
|
@@ -3201,6 +3206,7 @@ var require_diagnostic = __commonJS({
|
|
|
3201
3206
|
this.range = range;
|
|
3202
3207
|
this.priority = priority;
|
|
3203
3208
|
this._relatedInfo = [];
|
|
3209
|
+
this._data = null;
|
|
3204
3210
|
}
|
|
3205
3211
|
toJsonObj() {
|
|
3206
3212
|
return {
|
|
@@ -3210,6 +3216,7 @@ var require_diagnostic = __commonJS({
|
|
|
3210
3216
|
priority: this.priority,
|
|
3211
3217
|
actions: this._actions,
|
|
3212
3218
|
rule: this._rule,
|
|
3219
|
+
data: this._data,
|
|
3213
3220
|
relatedInfo: this._relatedInfo.map((info) => DiagnosticRelatedInfo.toJsonObj(info))
|
|
3214
3221
|
};
|
|
3215
3222
|
}
|
|
@@ -3218,6 +3225,7 @@ var require_diagnostic = __commonJS({
|
|
|
3218
3225
|
diag._actions = obj.actions;
|
|
3219
3226
|
diag._rule = obj.rule;
|
|
3220
3227
|
diag._relatedInfo = obj.relatedInfo.map((info) => DiagnosticRelatedInfo.fromJsonObj(info));
|
|
3228
|
+
diag._data = obj.data;
|
|
3221
3229
|
return diag;
|
|
3222
3230
|
}
|
|
3223
3231
|
addAction(action) {
|
|
@@ -3227,6 +3235,12 @@ var require_diagnostic = __commonJS({
|
|
|
3227
3235
|
this._actions.push(action);
|
|
3228
3236
|
}
|
|
3229
3237
|
}
|
|
3238
|
+
setData(data) {
|
|
3239
|
+
this._data = data;
|
|
3240
|
+
}
|
|
3241
|
+
getData() {
|
|
3242
|
+
return this._data;
|
|
3243
|
+
}
|
|
3230
3244
|
getActions() {
|
|
3231
3245
|
return this._actions;
|
|
3232
3246
|
}
|
|
@@ -12564,7 +12578,7 @@ var require_cancellationUtils = __commonJS({
|
|
|
12564
12578
|
"node_modules/@zzzen/pyright-internal/dist/common/cancellationUtils.js"(exports2) {
|
|
12565
12579
|
"use strict";
|
|
12566
12580
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
12567
|
-
exports2.CancellationThrottle = exports2.FileBasedToken = exports2.DefaultCancellationProvider = exports2.OperationCanceledException = void 0;
|
|
12581
|
+
exports2.CancellationThrottle = exports2.FileBasedToken = exports2.CancelledTokenId = exports2.DefaultCancellationProvider = exports2.OperationCanceledException = exports2.CancellationProvider = void 0;
|
|
12568
12582
|
exports2.getCancellationFolderName = getCancellationFolderName;
|
|
12569
12583
|
exports2.setCancellationFolderName = setCancellationFolderName;
|
|
12570
12584
|
exports2.invalidateTypeCacheIfCanceled = invalidateTypeCacheIfCanceled;
|
|
@@ -12579,6 +12593,13 @@ var require_cancellationUtils = __commonJS({
|
|
|
12579
12593
|
var vscode_languageserver_1 = require_api3();
|
|
12580
12594
|
var core_1 = require_core();
|
|
12581
12595
|
var uriUtils_1 = require_uriUtils();
|
|
12596
|
+
var CancellationProvider;
|
|
12597
|
+
(function(CancellationProvider2) {
|
|
12598
|
+
function is(value) {
|
|
12599
|
+
return value && !!value.createCancellationTokenSource;
|
|
12600
|
+
}
|
|
12601
|
+
CancellationProvider2.is = is;
|
|
12602
|
+
})(CancellationProvider || (exports2.CancellationProvider = CancellationProvider = {}));
|
|
12582
12603
|
var cancellationFolderName;
|
|
12583
12604
|
function getCancellationFolderName() {
|
|
12584
12605
|
return cancellationFolderName;
|
|
@@ -12654,7 +12675,11 @@ var require_cancellationUtils = __commonJS({
|
|
|
12654
12675
|
}
|
|
12655
12676
|
};
|
|
12656
12677
|
exports2.DefaultCancellationProvider = DefaultCancellationProvider;
|
|
12678
|
+
exports2.CancelledTokenId = "cancelled";
|
|
12657
12679
|
function getCancellationTokenId(token) {
|
|
12680
|
+
if (token === vscode_languageserver_1.CancellationToken.Cancelled) {
|
|
12681
|
+
return exports2.CancelledTokenId;
|
|
12682
|
+
}
|
|
12658
12683
|
return token instanceof FileBasedToken ? token.id : void 0;
|
|
12659
12684
|
}
|
|
12660
12685
|
var FileBasedToken = class {
|
|
@@ -15052,63 +15077,127 @@ var require_programTypes = __commonJS({
|
|
|
15052
15077
|
}
|
|
15053
15078
|
});
|
|
15054
15079
|
|
|
15055
|
-
// node_modules/@zzzen/pyright-internal/dist/
|
|
15056
|
-
var
|
|
15057
|
-
"node_modules/@zzzen/pyright-internal/dist/
|
|
15080
|
+
// node_modules/@zzzen/pyright-internal/dist/analyzer/pyTypedUtils.js
|
|
15081
|
+
var require_pyTypedUtils = __commonJS({
|
|
15082
|
+
"node_modules/@zzzen/pyright-internal/dist/analyzer/pyTypedUtils.js"(exports2) {
|
|
15058
15083
|
"use strict";
|
|
15059
15084
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
15060
|
-
exports2.
|
|
15061
|
-
|
|
15062
|
-
(
|
|
15063
|
-
|
|
15064
|
-
|
|
15065
|
-
|
|
15066
|
-
FileSystem2.is = is;
|
|
15067
|
-
})(FileSystem || (exports2.FileSystem = FileSystem = {}));
|
|
15068
|
-
var TempFile;
|
|
15069
|
-
(function(TempFile2) {
|
|
15070
|
-
function is(value) {
|
|
15071
|
-
return value.tmpdir && value.tmpfile;
|
|
15085
|
+
exports2.getPyTypedInfo = getPyTypedInfo;
|
|
15086
|
+
exports2.getPyTypedInfoForPyTypedFile = getPyTypedInfoForPyTypedFile;
|
|
15087
|
+
var uriUtils_1 = require_uriUtils();
|
|
15088
|
+
function getPyTypedInfo(fileSystem, dirPath) {
|
|
15089
|
+
if (!fileSystem.existsSync(dirPath) || !(0, uriUtils_1.isDirectory)(fileSystem, dirPath)) {
|
|
15090
|
+
return void 0;
|
|
15072
15091
|
}
|
|
15073
|
-
|
|
15074
|
-
|
|
15075
|
-
|
|
15076
|
-
constructor(name, _file, parentPath) {
|
|
15077
|
-
this.name = name;
|
|
15078
|
-
this._file = _file;
|
|
15079
|
-
this.parentPath = parentPath;
|
|
15092
|
+
const pyTypedPath = dirPath.pytypedUri;
|
|
15093
|
+
if (!fileSystem.existsSync(pyTypedPath) || !(0, uriUtils_1.isFile)(fileSystem, pyTypedPath)) {
|
|
15094
|
+
return void 0;
|
|
15080
15095
|
}
|
|
15081
|
-
|
|
15082
|
-
|
|
15083
|
-
|
|
15084
|
-
|
|
15085
|
-
|
|
15086
|
-
|
|
15087
|
-
|
|
15096
|
+
return getPyTypedInfoForPyTypedFile(fileSystem, pyTypedPath);
|
|
15097
|
+
}
|
|
15098
|
+
function getPyTypedInfoForPyTypedFile(fileSystem, pyTypedPath) {
|
|
15099
|
+
let isPartiallyTyped = false;
|
|
15100
|
+
const fileStats = fileSystem.statSync(pyTypedPath);
|
|
15101
|
+
if (fileStats.size > 0 && fileStats.size < 64 * 1024) {
|
|
15102
|
+
const pyTypedContents = fileSystem.readFileSync(pyTypedPath, "utf8");
|
|
15103
|
+
if (pyTypedContents.match(/partial\n/) || pyTypedContents.match(/partial\r\n/)) {
|
|
15104
|
+
isPartiallyTyped = true;
|
|
15105
|
+
}
|
|
15088
15106
|
}
|
|
15089
|
-
|
|
15090
|
-
|
|
15107
|
+
return {
|
|
15108
|
+
pyTypedPath,
|
|
15109
|
+
isPartiallyTyped
|
|
15110
|
+
};
|
|
15111
|
+
}
|
|
15112
|
+
}
|
|
15113
|
+
});
|
|
15114
|
+
|
|
15115
|
+
// node_modules/@zzzen/pyright-internal/dist/partialStubService.js
|
|
15116
|
+
var require_partialStubService = __commonJS({
|
|
15117
|
+
"node_modules/@zzzen/pyright-internal/dist/partialStubService.js"(exports2) {
|
|
15118
|
+
"use strict";
|
|
15119
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
15120
|
+
exports2.PartialStubService = exports2.SupportPartialStubs = void 0;
|
|
15121
|
+
var pyTypedUtils_1 = require_pyTypedUtils();
|
|
15122
|
+
var pathConsts_1 = require_pathConsts();
|
|
15123
|
+
var uriUtils_1 = require_uriUtils();
|
|
15124
|
+
var SupportPartialStubs;
|
|
15125
|
+
(function(SupportPartialStubs2) {
|
|
15126
|
+
function is(value) {
|
|
15127
|
+
return value.isPartialStubPackagesScanned && value.isPathScanned && value.processPartialStubPackages && value.clearPartialStubs;
|
|
15091
15128
|
}
|
|
15092
|
-
|
|
15093
|
-
|
|
15129
|
+
SupportPartialStubs2.is = is;
|
|
15130
|
+
})(SupportPartialStubs || (exports2.SupportPartialStubs = SupportPartialStubs = {}));
|
|
15131
|
+
var PartialStubService = class {
|
|
15132
|
+
constructor(_realFs) {
|
|
15133
|
+
this._realFs = _realFs;
|
|
15134
|
+
this._rootSearched = /* @__PURE__ */ new Set();
|
|
15135
|
+
this._partialStubPackagePaths = /* @__PURE__ */ new Set();
|
|
15136
|
+
this._movedDirectories = [];
|
|
15094
15137
|
}
|
|
15095
|
-
|
|
15096
|
-
return false;
|
|
15138
|
+
isPartialStubPackagesScanned(execEnv) {
|
|
15139
|
+
return execEnv.root ? this.isPathScanned(execEnv.root) : false;
|
|
15097
15140
|
}
|
|
15098
|
-
|
|
15099
|
-
return
|
|
15141
|
+
isPathScanned(uri) {
|
|
15142
|
+
return this._rootSearched.has(uri.key);
|
|
15100
15143
|
}
|
|
15101
|
-
|
|
15102
|
-
|
|
15144
|
+
processPartialStubPackages(paths, roots, bundledStubPath, allowMoving) {
|
|
15145
|
+
var _a;
|
|
15146
|
+
const allowMovingFn = allowMoving ?? this._allowMoving.bind(this);
|
|
15147
|
+
for (const path13 of paths) {
|
|
15148
|
+
this._rootSearched.add(path13.key);
|
|
15149
|
+
if (!this._realFs.existsSync(path13) || !(0, uriUtils_1.isDirectory)(this._realFs, path13)) {
|
|
15150
|
+
continue;
|
|
15151
|
+
}
|
|
15152
|
+
let dirEntries = [];
|
|
15153
|
+
try {
|
|
15154
|
+
dirEntries = this._realFs.readdirEntriesSync(path13);
|
|
15155
|
+
} catch {
|
|
15156
|
+
}
|
|
15157
|
+
const isBundledStub = path13.equals(bundledStubPath);
|
|
15158
|
+
for (const entry of dirEntries) {
|
|
15159
|
+
const partialStubPackagePath = path13.combinePaths(entry.name);
|
|
15160
|
+
const isDirectory = !entry.isSymbolicLink() ? entry.isDirectory() : !!((_a = (0, uriUtils_1.tryStat)(this._realFs, partialStubPackagePath)) == null ? void 0 : _a.isDirectory());
|
|
15161
|
+
if (!isDirectory || !entry.name.endsWith(pathConsts_1.stubsSuffix)) {
|
|
15162
|
+
continue;
|
|
15163
|
+
}
|
|
15164
|
+
const pyTypedInfo = (0, pyTypedUtils_1.getPyTypedInfo)(this._realFs, partialStubPackagePath);
|
|
15165
|
+
if (!pyTypedInfo || !pyTypedInfo.isPartiallyTyped) {
|
|
15166
|
+
continue;
|
|
15167
|
+
}
|
|
15168
|
+
this._partialStubPackagePaths.add(partialStubPackagePath.key);
|
|
15169
|
+
const packageName = entry.name.substr(0, entry.name.length - pathConsts_1.stubsSuffix.length);
|
|
15170
|
+
for (const root of roots) {
|
|
15171
|
+
const packagePath = root.combinePaths(packageName);
|
|
15172
|
+
try {
|
|
15173
|
+
const stat = (0, uriUtils_1.tryStat)(this._realFs, packagePath);
|
|
15174
|
+
if (!(stat == null ? void 0 : stat.isDirectory())) {
|
|
15175
|
+
continue;
|
|
15176
|
+
}
|
|
15177
|
+
if (!allowMovingFn(isBundledStub, (0, pyTypedUtils_1.getPyTypedInfo)(this._realFs, packagePath), pyTypedInfo)) {
|
|
15178
|
+
continue;
|
|
15179
|
+
}
|
|
15180
|
+
this._movedDirectories.push(this._realFs.mapDirectory(packagePath, partialStubPackagePath, (u, fs8) => u.hasExtension(".pyi") || fs8.existsSync(u) && fs8.statSync(u).isDirectory()));
|
|
15181
|
+
} catch {
|
|
15182
|
+
}
|
|
15183
|
+
}
|
|
15184
|
+
}
|
|
15185
|
+
}
|
|
15103
15186
|
}
|
|
15104
|
-
|
|
15105
|
-
|
|
15187
|
+
clearPartialStubs() {
|
|
15188
|
+
this._rootSearched.clear();
|
|
15189
|
+
this._partialStubPackagePaths.clear();
|
|
15190
|
+
this._movedDirectories.forEach((d) => d.dispose());
|
|
15191
|
+
this._movedDirectories = [];
|
|
15106
15192
|
}
|
|
15107
|
-
|
|
15108
|
-
|
|
15193
|
+
_allowMoving(isBundled, packagePyTyped, _stubPyTyped) {
|
|
15194
|
+
if (!isBundled) {
|
|
15195
|
+
return true;
|
|
15196
|
+
}
|
|
15197
|
+
return !packagePyTyped || packagePyTyped.isPartiallyTyped;
|
|
15109
15198
|
}
|
|
15110
15199
|
};
|
|
15111
|
-
exports2.
|
|
15200
|
+
exports2.PartialStubService = PartialStubService;
|
|
15112
15201
|
}
|
|
15113
15202
|
});
|
|
15114
15203
|
|
|
@@ -15831,6 +15920,66 @@ var require_docStringService = __commonJS({
|
|
|
15831
15920
|
}
|
|
15832
15921
|
});
|
|
15833
15922
|
|
|
15923
|
+
// node_modules/@zzzen/pyright-internal/dist/common/fileSystem.js
|
|
15924
|
+
var require_fileSystem = __commonJS({
|
|
15925
|
+
"node_modules/@zzzen/pyright-internal/dist/common/fileSystem.js"(exports2) {
|
|
15926
|
+
"use strict";
|
|
15927
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
15928
|
+
exports2.VirtualDirent = exports2.TempFile = exports2.FileSystem = void 0;
|
|
15929
|
+
var FileSystem;
|
|
15930
|
+
(function(FileSystem2) {
|
|
15931
|
+
function is(value) {
|
|
15932
|
+
return value.createFileSystemWatcher && value.createReadStream && value.createWriteStream && value.copyFileSync;
|
|
15933
|
+
}
|
|
15934
|
+
FileSystem2.is = is;
|
|
15935
|
+
})(FileSystem || (exports2.FileSystem = FileSystem = {}));
|
|
15936
|
+
var TempFile;
|
|
15937
|
+
(function(TempFile2) {
|
|
15938
|
+
function is(value) {
|
|
15939
|
+
return value.tmpdir && value.tmpfile;
|
|
15940
|
+
}
|
|
15941
|
+
TempFile2.is = is;
|
|
15942
|
+
})(TempFile || (exports2.TempFile = TempFile = {}));
|
|
15943
|
+
var VirtualDirent = class {
|
|
15944
|
+
constructor(name, _file, parentPath) {
|
|
15945
|
+
this.name = name;
|
|
15946
|
+
this._file = _file;
|
|
15947
|
+
this.parentPath = parentPath;
|
|
15948
|
+
}
|
|
15949
|
+
/**
|
|
15950
|
+
* Alias for `dirent.parentPath`.
|
|
15951
|
+
* @since v20.1.0
|
|
15952
|
+
* @deprecated Since v20.12.0
|
|
15953
|
+
*/
|
|
15954
|
+
get path() {
|
|
15955
|
+
return this.parentPath;
|
|
15956
|
+
}
|
|
15957
|
+
isFile() {
|
|
15958
|
+
return this._file;
|
|
15959
|
+
}
|
|
15960
|
+
isDirectory() {
|
|
15961
|
+
return !this._file;
|
|
15962
|
+
}
|
|
15963
|
+
isBlockDevice() {
|
|
15964
|
+
return false;
|
|
15965
|
+
}
|
|
15966
|
+
isCharacterDevice() {
|
|
15967
|
+
return false;
|
|
15968
|
+
}
|
|
15969
|
+
isSymbolicLink() {
|
|
15970
|
+
return false;
|
|
15971
|
+
}
|
|
15972
|
+
isFIFO() {
|
|
15973
|
+
return false;
|
|
15974
|
+
}
|
|
15975
|
+
isSocket() {
|
|
15976
|
+
return false;
|
|
15977
|
+
}
|
|
15978
|
+
};
|
|
15979
|
+
exports2.VirtualDirent = VirtualDirent;
|
|
15980
|
+
}
|
|
15981
|
+
});
|
|
15982
|
+
|
|
15834
15983
|
// node_modules/@zzzen/pyright-internal/dist/common/languageServerInterface.js
|
|
15835
15984
|
var require_languageServerInterface = __commonJS({
|
|
15836
15985
|
"node_modules/@zzzen/pyright-internal/dist/common/languageServerInterface.js"(exports2) {
|
|
@@ -15861,158 +16010,6 @@ var require_languageServerInterface = __commonJS({
|
|
|
15861
16010
|
}
|
|
15862
16011
|
});
|
|
15863
16012
|
|
|
15864
|
-
// node_modules/@zzzen/pyright-internal/dist/analyzer/pyTypedUtils.js
|
|
15865
|
-
var require_pyTypedUtils = __commonJS({
|
|
15866
|
-
"node_modules/@zzzen/pyright-internal/dist/analyzer/pyTypedUtils.js"(exports2) {
|
|
15867
|
-
"use strict";
|
|
15868
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
15869
|
-
exports2.getPyTypedInfo = getPyTypedInfo;
|
|
15870
|
-
exports2.getPyTypedInfoForPyTypedFile = getPyTypedInfoForPyTypedFile;
|
|
15871
|
-
var uriUtils_1 = require_uriUtils();
|
|
15872
|
-
function getPyTypedInfo(fileSystem, dirPath) {
|
|
15873
|
-
if (!fileSystem.existsSync(dirPath) || !(0, uriUtils_1.isDirectory)(fileSystem, dirPath)) {
|
|
15874
|
-
return void 0;
|
|
15875
|
-
}
|
|
15876
|
-
const pyTypedPath = dirPath.pytypedUri;
|
|
15877
|
-
if (!fileSystem.existsSync(pyTypedPath) || !(0, uriUtils_1.isFile)(fileSystem, pyTypedPath)) {
|
|
15878
|
-
return void 0;
|
|
15879
|
-
}
|
|
15880
|
-
return getPyTypedInfoForPyTypedFile(fileSystem, pyTypedPath);
|
|
15881
|
-
}
|
|
15882
|
-
function getPyTypedInfoForPyTypedFile(fileSystem, pyTypedPath) {
|
|
15883
|
-
let isPartiallyTyped = false;
|
|
15884
|
-
const fileStats = fileSystem.statSync(pyTypedPath);
|
|
15885
|
-
if (fileStats.size > 0 && fileStats.size < 64 * 1024) {
|
|
15886
|
-
const pyTypedContents = fileSystem.readFileSync(pyTypedPath, "utf8");
|
|
15887
|
-
if (pyTypedContents.match(/partial\n/) || pyTypedContents.match(/partial\r\n/)) {
|
|
15888
|
-
isPartiallyTyped = true;
|
|
15889
|
-
}
|
|
15890
|
-
}
|
|
15891
|
-
return {
|
|
15892
|
-
pyTypedPath,
|
|
15893
|
-
isPartiallyTyped
|
|
15894
|
-
};
|
|
15895
|
-
}
|
|
15896
|
-
}
|
|
15897
|
-
});
|
|
15898
|
-
|
|
15899
|
-
// node_modules/@zzzen/pyright-internal/dist/partialStubService.js
|
|
15900
|
-
var require_partialStubService = __commonJS({
|
|
15901
|
-
"node_modules/@zzzen/pyright-internal/dist/partialStubService.js"(exports2) {
|
|
15902
|
-
"use strict";
|
|
15903
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
15904
|
-
exports2.PartialStubService = exports2.SupportPartialStubs = void 0;
|
|
15905
|
-
var pyTypedUtils_1 = require_pyTypedUtils();
|
|
15906
|
-
var pathConsts_1 = require_pathConsts();
|
|
15907
|
-
var uriUtils_1 = require_uriUtils();
|
|
15908
|
-
var SupportPartialStubs;
|
|
15909
|
-
(function(SupportPartialStubs2) {
|
|
15910
|
-
function is(value) {
|
|
15911
|
-
return value.isPartialStubPackagesScanned && value.isPathScanned && value.processPartialStubPackages && value.clearPartialStubs;
|
|
15912
|
-
}
|
|
15913
|
-
SupportPartialStubs2.is = is;
|
|
15914
|
-
})(SupportPartialStubs || (exports2.SupportPartialStubs = SupportPartialStubs = {}));
|
|
15915
|
-
var PartialStubService = class {
|
|
15916
|
-
constructor(_realFs) {
|
|
15917
|
-
this._realFs = _realFs;
|
|
15918
|
-
this._rootSearched = /* @__PURE__ */ new Set();
|
|
15919
|
-
this._partialStubPackagePaths = /* @__PURE__ */ new Set();
|
|
15920
|
-
this._movedDirectories = [];
|
|
15921
|
-
}
|
|
15922
|
-
isPartialStubPackagesScanned(execEnv) {
|
|
15923
|
-
return execEnv.root ? this.isPathScanned(execEnv.root) : false;
|
|
15924
|
-
}
|
|
15925
|
-
isPathScanned(uri) {
|
|
15926
|
-
return this._rootSearched.has(uri.key);
|
|
15927
|
-
}
|
|
15928
|
-
processPartialStubPackages(paths, roots, bundledStubPath, allowMoving) {
|
|
15929
|
-
var _a;
|
|
15930
|
-
const allowMovingFn = allowMoving ?? this._allowMoving.bind(this);
|
|
15931
|
-
for (const path13 of paths) {
|
|
15932
|
-
this._rootSearched.add(path13.key);
|
|
15933
|
-
if (!this._realFs.existsSync(path13) || !(0, uriUtils_1.isDirectory)(this._realFs, path13)) {
|
|
15934
|
-
continue;
|
|
15935
|
-
}
|
|
15936
|
-
let dirEntries = [];
|
|
15937
|
-
try {
|
|
15938
|
-
dirEntries = this._realFs.readdirEntriesSync(path13);
|
|
15939
|
-
} catch {
|
|
15940
|
-
}
|
|
15941
|
-
const isBundledStub = path13.equals(bundledStubPath);
|
|
15942
|
-
for (const entry of dirEntries) {
|
|
15943
|
-
const partialStubPackagePath = path13.combinePaths(entry.name);
|
|
15944
|
-
const isDirectory = !entry.isSymbolicLink() ? entry.isDirectory() : !!((_a = (0, uriUtils_1.tryStat)(this._realFs, partialStubPackagePath)) == null ? void 0 : _a.isDirectory());
|
|
15945
|
-
if (!isDirectory || !entry.name.endsWith(pathConsts_1.stubsSuffix)) {
|
|
15946
|
-
continue;
|
|
15947
|
-
}
|
|
15948
|
-
const pyTypedInfo = (0, pyTypedUtils_1.getPyTypedInfo)(this._realFs, partialStubPackagePath);
|
|
15949
|
-
if (!pyTypedInfo || !pyTypedInfo.isPartiallyTyped) {
|
|
15950
|
-
continue;
|
|
15951
|
-
}
|
|
15952
|
-
this._partialStubPackagePaths.add(partialStubPackagePath.key);
|
|
15953
|
-
const packageName = entry.name.substr(0, entry.name.length - pathConsts_1.stubsSuffix.length);
|
|
15954
|
-
for (const root of roots) {
|
|
15955
|
-
const packagePath = root.combinePaths(packageName);
|
|
15956
|
-
try {
|
|
15957
|
-
const stat = (0, uriUtils_1.tryStat)(this._realFs, packagePath);
|
|
15958
|
-
if (!(stat == null ? void 0 : stat.isDirectory())) {
|
|
15959
|
-
continue;
|
|
15960
|
-
}
|
|
15961
|
-
if (!allowMovingFn(isBundledStub, (0, pyTypedUtils_1.getPyTypedInfo)(this._realFs, packagePath), pyTypedInfo)) {
|
|
15962
|
-
continue;
|
|
15963
|
-
}
|
|
15964
|
-
this._movedDirectories.push(this._realFs.mapDirectory(packagePath, partialStubPackagePath, (u, fs8) => u.hasExtension(".pyi") || fs8.existsSync(u) && fs8.statSync(u).isDirectory()));
|
|
15965
|
-
} catch {
|
|
15966
|
-
}
|
|
15967
|
-
}
|
|
15968
|
-
}
|
|
15969
|
-
}
|
|
15970
|
-
}
|
|
15971
|
-
clearPartialStubs() {
|
|
15972
|
-
this._rootSearched.clear();
|
|
15973
|
-
this._partialStubPackagePaths.clear();
|
|
15974
|
-
this._movedDirectories.forEach((d) => d.dispose());
|
|
15975
|
-
this._movedDirectories = [];
|
|
15976
|
-
}
|
|
15977
|
-
_allowMoving(isBundled, packagePyTyped, _stubPyTyped) {
|
|
15978
|
-
if (!isBundled) {
|
|
15979
|
-
return true;
|
|
15980
|
-
}
|
|
15981
|
-
return !packagePyTyped || packagePyTyped.isPartiallyTyped;
|
|
15982
|
-
}
|
|
15983
|
-
_getRelativePathPartialStubs(partialStubPath) {
|
|
15984
|
-
const relativePaths = [];
|
|
15985
|
-
const searchAllStubs = (uri) => {
|
|
15986
|
-
for (const entry of this._realFs.readdirEntriesSync(uri)) {
|
|
15987
|
-
const filePath = uri.combinePaths(entry.name);
|
|
15988
|
-
let isDirectory = entry.isDirectory();
|
|
15989
|
-
let isFile = entry.isFile();
|
|
15990
|
-
if (entry.isSymbolicLink()) {
|
|
15991
|
-
const stat = (0, uriUtils_1.tryStat)(this._realFs, filePath);
|
|
15992
|
-
if (stat) {
|
|
15993
|
-
isDirectory = stat.isDirectory();
|
|
15994
|
-
isFile = stat.isFile();
|
|
15995
|
-
}
|
|
15996
|
-
}
|
|
15997
|
-
if (isDirectory) {
|
|
15998
|
-
searchAllStubs(filePath);
|
|
15999
|
-
}
|
|
16000
|
-
if (isFile && entry.name.endsWith(".pyi")) {
|
|
16001
|
-
const relative = partialStubPath.getRelativePathComponents(filePath).join("/");
|
|
16002
|
-
if (relative) {
|
|
16003
|
-
relativePaths.push(relative);
|
|
16004
|
-
}
|
|
16005
|
-
}
|
|
16006
|
-
}
|
|
16007
|
-
};
|
|
16008
|
-
searchAllStubs(partialStubPath);
|
|
16009
|
-
return relativePaths;
|
|
16010
|
-
}
|
|
16011
|
-
};
|
|
16012
|
-
exports2.PartialStubService = PartialStubService;
|
|
16013
|
-
}
|
|
16014
|
-
});
|
|
16015
|
-
|
|
16016
16013
|
// node_modules/@zzzen/pyright-internal/dist/common/serviceProviderExtensions.js
|
|
16017
16014
|
var require_serviceProviderExtensions = __commonJS({
|
|
16018
16015
|
"node_modules/@zzzen/pyright-internal/dist/common/serviceProviderExtensions.js"(exports2) {
|
|
@@ -16022,14 +16019,15 @@ var require_serviceProviderExtensions = __commonJS({
|
|
|
16022
16019
|
var cacheManager_1 = require_cacheManager();
|
|
16023
16020
|
var programTypes_1 = require_programTypes();
|
|
16024
16021
|
var sourceFile_1 = require_sourceFile();
|
|
16025
|
-
var
|
|
16022
|
+
var partialStubService_1 = require_partialStubService();
|
|
16023
|
+
var cancellationUtils_1 = require_cancellationUtils();
|
|
16026
16024
|
var caseSensitivityDetector_1 = require_caseSensitivityDetector();
|
|
16027
16025
|
var console_1 = require_console();
|
|
16028
|
-
var fileSystem_1 = require_fileSystem();
|
|
16029
|
-
var serviceProvider_1 = require_serviceProvider();
|
|
16030
16026
|
var docStringService_1 = require_docStringService();
|
|
16027
|
+
var fileSystem_1 = require_fileSystem();
|
|
16031
16028
|
var languageServerInterface_1 = require_languageServerInterface();
|
|
16032
|
-
var
|
|
16029
|
+
var serviceKeys_1 = require_serviceKeys();
|
|
16030
|
+
var serviceProvider_1 = require_serviceProvider();
|
|
16033
16031
|
function createServiceProvider(...services2) {
|
|
16034
16032
|
const sp = new serviceProvider_1.ServiceProvider();
|
|
16035
16033
|
services2.forEach((service) => {
|
|
@@ -16063,6 +16061,9 @@ var require_serviceProviderExtensions = __commonJS({
|
|
|
16063
16061
|
if (languageServerInterface_1.CommandService.is(service)) {
|
|
16064
16062
|
sp.add(serviceKeys_1.ServiceKeys.commandService, service);
|
|
16065
16063
|
}
|
|
16064
|
+
if (cancellationUtils_1.CancellationProvider.is(service)) {
|
|
16065
|
+
sp.add(serviceKeys_1.ServiceKeys.cancellationProvider, service);
|
|
16066
|
+
}
|
|
16066
16067
|
});
|
|
16067
16068
|
return sp;
|
|
16068
16069
|
}
|
|
@@ -16073,11 +16074,18 @@ var require_serviceProviderExtensions = __commonJS({
|
|
|
16073
16074
|
return this.get(serviceKeys_1.ServiceKeys.console);
|
|
16074
16075
|
};
|
|
16075
16076
|
serviceProvider_1.ServiceProvider.prototype.partialStubs = function() {
|
|
16077
|
+
const result = this.tryGet(serviceKeys_1.ServiceKeys.partialStubs);
|
|
16078
|
+
if (!result) {
|
|
16079
|
+
this.add(serviceKeys_1.ServiceKeys.partialStubs, new partialStubService_1.PartialStubService(this.fs()));
|
|
16080
|
+
}
|
|
16076
16081
|
return this.get(serviceKeys_1.ServiceKeys.partialStubs);
|
|
16077
16082
|
};
|
|
16078
16083
|
serviceProvider_1.ServiceProvider.prototype.tmp = function() {
|
|
16079
16084
|
return this.tryGet(serviceKeys_1.ServiceKeys.tempFile);
|
|
16080
16085
|
};
|
|
16086
|
+
serviceProvider_1.ServiceProvider.prototype.cancellationProvider = function() {
|
|
16087
|
+
return this.tryGet(serviceKeys_1.ServiceKeys.cancellationProvider) ?? new cancellationUtils_1.DefaultCancellationProvider();
|
|
16088
|
+
};
|
|
16081
16089
|
serviceProvider_1.ServiceProvider.prototype.sourceFileFactory = function() {
|
|
16082
16090
|
const result = this.tryGet(serviceKeys_1.ServiceKeys.sourceFileFactory);
|
|
16083
16091
|
return result || DefaultSourceFileFactory;
|
|
@@ -16291,6 +16299,7 @@ var require_package_nls_cs = __commonJS({
|
|
|
16291
16299
|
baseClassUnknown: "Typ z\xE1kladn\xED t\u0159\xEDdy je nezn\xE1m\xFD, co zakr\xFDv\xE1 typ odvozen\xE9 t\u0159\xEDdy",
|
|
16292
16300
|
baseClassVariableTypeIncompatible: "Z\xE1kladn\xED t\u0159\xEDdy pro t\u0159\xEDdu {classType} definuj\xED prom\u011Bnnou {name} nekompatibiln\xEDm zp\u016Fsobem",
|
|
16293
16301
|
binaryOperationNotAllowed: "Ve v\xFDrazu typu nen\xED povolen\xFD bin\xE1rn\xED oper\xE1tor.",
|
|
16302
|
+
bindParamMissing: "Nepovedlo se vytvo\u0159it vazbu metody {methodName}, proto\u017Ee chyb\xED parametr self nebo cls",
|
|
16294
16303
|
bindTypeMismatch: "Nepovedlo se vytvo\u0159it vazbu metody \u201E{methodName}\u201C, proto\u017Ee \u201E{type}\u201C nejde p\u0159i\u0159adit k parametru \u201E{paramName}\u201C",
|
|
16295
16304
|
breakInExceptionGroup: "V bloku except* nen\xED povolen\xE1 mo\u017Enost break.",
|
|
16296
16305
|
breakOutsideLoop: "\u201Ebreak\u201C se d\xE1 pou\u017E\xEDt jenom ve smy\u010Dce",
|
|
@@ -16722,6 +16731,7 @@ var require_package_nls_cs = __commonJS({
|
|
|
16722
16731
|
typeAliasRedeclared: "\u201E{name}\u201C se deklaruje jako TypeAlias a d\xE1 se p\u0159i\u0159adit jenom jednou.",
|
|
16723
16732
|
typeAliasStatementBadScope: "P\u0159\xEDkaz type se d\xE1 pou\u017E\xEDt jenom v r\xE1mci oboru modulu nebo t\u0159\xEDdy.",
|
|
16724
16733
|
typeAliasStatementIllegal: "P\u0159\xEDkaz alias typu vy\u017Eaduje Python 3.12 nebo nov\u011Bj\u0161\xED",
|
|
16734
|
+
typeAliasTypeBadScope: "Alias typu se d\xE1 definovat jenom v r\xE1mci oboru modulu nebo t\u0159\xEDdy",
|
|
16725
16735
|
typeAliasTypeBaseClass: 'Alias typu definovan\xFD v p\u0159\xEDkazu "type" nejde pou\u017E\xEDt jako z\xE1kladn\xED t\u0159\xEDdu.',
|
|
16726
16736
|
typeAliasTypeMustBeAssigned: "Typ TypeAliasType mus\xED b\xFDt p\u0159i\u0159azen prom\u011Bnn\xE9 se stejn\xFDm n\xE1zvem jako alias typu",
|
|
16727
16737
|
typeAliasTypeNameArg: "Prvn\xED argument TypeAliasType mus\xED b\xFDt \u0159et\u011Bzcov\xFD liter\xE1l p\u0159edstavuj\xEDc\xED n\xE1zev aliasu typu.",
|
|
@@ -16933,6 +16943,7 @@ var require_package_nls_cs = __commonJS({
|
|
|
16933
16943
|
kwargsParamMissing: "Parametr \u201E**{paramName}\u201C nem\xE1 \u017E\xE1dn\xFD odpov\xEDdaj\xEDc\xED parametr",
|
|
16934
16944
|
listAssignmentMismatch: "Typ {type} nen\xED kompatibiln\xED s c\xEDlov\xFDm seznamem",
|
|
16935
16945
|
literalAssignmentMismatch: "{sourceType} se ned\xE1 p\u0159i\u0159adit k typu {destType}.",
|
|
16946
|
+
literalNotAllowed: '"Literal" special form cannot be used with instance and class checks',
|
|
16936
16947
|
matchIsNotExhaustiveHint: "Pokud nen\xED zam\xFD\u0161leno vy\u010Derp\xE1vaj\xEDc\xED zpracov\xE1n\xED, p\u0159idejte case _: pass",
|
|
16937
16948
|
matchIsNotExhaustiveType: "Nezpracovan\xFD typ: {type}",
|
|
16938
16949
|
memberAssignment: "V\xFDraz typu {type} nelze p\u0159i\u0159adit k atributu {name} t\u0159\xEDdy {classType}.",
|
|
@@ -17130,6 +17141,7 @@ var require_package_nls_de = __commonJS({
|
|
|
17130
17141
|
baseClassUnknown: "Der Basisklassentyp ist unbekannt, sodass der Typ der abgeleiteten Klasse verdeckt wird.",
|
|
17131
17142
|
baseClassVariableTypeIncompatible: 'Basisklassen f\xFCr die Klasse "{classType}" definieren die Variable "{name}" auf inkompatible Weise.',
|
|
17132
17143
|
binaryOperationNotAllowed: "Der bin\xE4rer Operator ist im Typausdruck nicht zul\xE4ssig",
|
|
17144
|
+
bindParamMissing: "Die Methode \u201E{methodName}\u201C konnte nicht gebunden werden, weil der Parameter \u201Eself\u201C oder \u201Ecls\u201C fehlt.",
|
|
17133
17145
|
bindTypeMismatch: 'Die Methode "{methodName}" konnte nicht gebunden werden, da "{type}" dem Parameter "{paramName}" nicht zugewiesen werden kann.',
|
|
17134
17146
|
breakInExceptionGroup: "\u201Ebreak\u201C ist in einem \u201Eexcept*\u201C Block nicht zul\xE4ssig.",
|
|
17135
17147
|
breakOutsideLoop: '"break" kann nur innerhalb einer Schleife verwendet werden.',
|
|
@@ -17561,6 +17573,7 @@ var require_package_nls_de = __commonJS({
|
|
|
17561
17573
|
typeAliasRedeclared: '"{name}" ist als TypeAlias deklariert und kann nur einmal zugewiesen werden.',
|
|
17562
17574
|
typeAliasStatementBadScope: "Eine type Anweisung kann nur innerhalb eines Moduls oder Klassenbereichs verwendet werden.",
|
|
17563
17575
|
typeAliasStatementIllegal: "Die Typaliasanweisung erfordert Python 3.12 oder h\xF6her.",
|
|
17576
|
+
typeAliasTypeBadScope: "Ein Typalias kann nur innerhalb eines Modul- oder Klassenbereichs definiert werden.",
|
|
17564
17577
|
typeAliasTypeBaseClass: 'Ein in einer "type"-Anweisung definierter type Alias kann nicht als Basisklasse verwendet werden.',
|
|
17565
17578
|
typeAliasTypeMustBeAssigned: "TypeAliasType muss einer Variablen mit dem gleichen Namen wie der Typalias zugewiesen werden.",
|
|
17566
17579
|
typeAliasTypeNameArg: "Das erste Argument f\xFCr TypeAliasType muss ein Zeichenfolgenliteral sein, das den Namen des Typalias darstellt.",
|
|
@@ -17656,11 +17669,11 @@ var require_package_nls_de = __commonJS({
|
|
|
17656
17669
|
typedDictSecondArgDict: "Es wird ein dict- oder Schl\xFCsselwortparameter als zweiter Parameter erwartet.",
|
|
17657
17670
|
typedDictSecondArgDictEntry: "Einfacher W\xF6rterbucheintrag erwartet",
|
|
17658
17671
|
typedDictSet: "Element konnte in TypedDict nicht zugewiesen werden.",
|
|
17659
|
-
unaccessedClass: 'Auf
|
|
17660
|
-
unaccessedFunction: 'Auf
|
|
17661
|
-
unaccessedImport: 'Auf
|
|
17662
|
-
unaccessedSymbol: 'Auf "{name}"
|
|
17663
|
-
unaccessedVariable: 'Auf
|
|
17672
|
+
unaccessedClass: 'Auf Klasse "{name}" wird nicht zugegriffen',
|
|
17673
|
+
unaccessedFunction: 'Auf Funktion "{name}" wird nicht zugegriffen',
|
|
17674
|
+
unaccessedImport: 'Auf Import "{name}" wird nicht zugegriffen',
|
|
17675
|
+
unaccessedSymbol: 'Auf "{name}" wird nicht zugegriffen',
|
|
17676
|
+
unaccessedVariable: 'Auf Variable "{name}" wird nicht zugegriffen',
|
|
17664
17677
|
unannotatedFunctionSkipped: 'Die Analyse der Funktion "{name}" wird \xFCbersprungen, da sie nicht kommentiert wurde.',
|
|
17665
17678
|
unaryOperationNotAllowed: "Der un\xE4re Operator ist im Typausdruck nicht zul\xE4ssig",
|
|
17666
17679
|
unexpectedAsyncToken: 'Es wurde erwartet, dass "def", "with" oder "for" auf "async" folgt.',
|
|
@@ -17772,6 +17785,7 @@ var require_package_nls_de = __commonJS({
|
|
|
17772
17785
|
kwargsParamMissing: 'Der Parameter "**{paramName}" weist keinen entsprechenden Parameter auf.',
|
|
17773
17786
|
listAssignmentMismatch: 'Der Typ "{type}" ist nicht mit der Zielliste kompatibel.',
|
|
17774
17787
|
literalAssignmentMismatch: "\u201E{sourceType}\u201C kann dem Typ \u201E{destType}\u201C nicht zugewiesen werden.",
|
|
17788
|
+
literalNotAllowed: '"Literal" special form cannot be used with instance and class checks',
|
|
17775
17789
|
matchIsNotExhaustiveHint: 'Wenn keine ausf\xFChrliche Behandlung beabsichtigt ist, f\xFCgen Sie "case _: pass" hinzu.',
|
|
17776
17790
|
matchIsNotExhaustiveType: 'Unbehandelter Typ: "{type}"',
|
|
17777
17791
|
memberAssignment: "Ein Ausdruck vom Typ \u201E{type}\u201C kann dem Attribut \u201E{name}\u201C der Klasse \u201E{classType}\u201C nicht zugewiesen werden",
|
|
@@ -18395,6 +18409,18 @@ var require_package_nls_en_us = __commonJS({
|
|
|
18395
18409
|
message: 'A "Final" variable cannot be assigned within a loop',
|
|
18396
18410
|
comment: "{Locked='Final'}"
|
|
18397
18411
|
},
|
|
18412
|
+
finallyBreak: {
|
|
18413
|
+
message: 'A "break" cannot be used to exit a "finally" block',
|
|
18414
|
+
comment: "{Locked='break', 'finally'}"
|
|
18415
|
+
},
|
|
18416
|
+
finallyContinue: {
|
|
18417
|
+
message: 'A "continue" cannot be used to exit a "finally" block',
|
|
18418
|
+
comment: "{Locked='continue', 'finally'}"
|
|
18419
|
+
},
|
|
18420
|
+
finallyReturn: {
|
|
18421
|
+
message: 'A "return" cannot be used to exit a "finally" block',
|
|
18422
|
+
comment: "{Locked='return', 'finally'}"
|
|
18423
|
+
},
|
|
18398
18424
|
finalMethodOverride: {
|
|
18399
18425
|
message: 'Method "{name}" cannot override final method defined in class "{className}"',
|
|
18400
18426
|
comment: "{Locked='final'}"
|
|
@@ -18672,6 +18698,10 @@ var require_package_nls_en_us = __commonJS({
|
|
|
18672
18698
|
message: 'Cannot override "{name}" because parent class "{className}" is a named tuple',
|
|
18673
18699
|
comment: "{Locked='tuple'}"
|
|
18674
18700
|
},
|
|
18701
|
+
namedTupleFieldUnderscore: {
|
|
18702
|
+
message: "Named tuple field names cannot start with an underscore",
|
|
18703
|
+
comment: "{Locked='Named','tuple'}"
|
|
18704
|
+
},
|
|
18675
18705
|
namedTupleFirstArg: {
|
|
18676
18706
|
message: "Expected named tuple class name as first argument",
|
|
18677
18707
|
comment: "{Locked='tuple'}"
|
|
@@ -18691,7 +18721,7 @@ var require_package_nls_en_us = __commonJS({
|
|
|
18691
18721
|
},
|
|
18692
18722
|
namedTupleNoTypes: {
|
|
18693
18723
|
message: '"namedtuple" provides no types for tuple entries; use "NamedTuple" instead',
|
|
18694
|
-
comment:
|
|
18724
|
+
comment: "{Locked='namedtuple','tuple','NamedTuple'}"
|
|
18695
18725
|
},
|
|
18696
18726
|
namedTupleSecondArg: {
|
|
18697
18727
|
message: "Expected named tuple entry list as second argument",
|
|
@@ -19753,6 +19783,10 @@ var require_package_nls_en_us = __commonJS({
|
|
|
19753
19783
|
kwargsParamMissing: 'Parameter "**{paramName}" has no corresponding parameter',
|
|
19754
19784
|
listAssignmentMismatch: 'Type "{type}" is incompatible with target list',
|
|
19755
19785
|
literalAssignmentMismatch: '"{sourceType}" is not assignable to type "{destType}"',
|
|
19786
|
+
literalNotAllowed: {
|
|
19787
|
+
message: '"Literal" special form cannot be used with instance and class checks',
|
|
19788
|
+
comment: "{Locked='Literal'}"
|
|
19789
|
+
},
|
|
19756
19790
|
matchIsNotExhaustiveHint: {
|
|
19757
19791
|
message: 'If exhaustive handling is not intended, add "case _: pass"',
|
|
19758
19792
|
comment: "{Locked='case _: pass'}"
|
|
@@ -20085,6 +20119,7 @@ var require_package_nls_es = __commonJS({
|
|
|
20085
20119
|
baseClassUnknown: "Se desconoce el tipo de la clase base, lo que oculta el tipo de la clase derivada.",
|
|
20086
20120
|
baseClassVariableTypeIncompatible: 'Las clases base para la clase "{classType}" definen la variable "{name}" de forma incompatible',
|
|
20087
20121
|
binaryOperationNotAllowed: "Operador binario no permitido en la expresi\xF3n de tipo",
|
|
20122
|
+
bindParamMissing: 'No se pudo enlazar el m\xE9todo "{methodName}" porque falta un par\xE1metro "self" o "cls"',
|
|
20088
20123
|
bindTypeMismatch: 'No se pudo enlazar el m\xE9todo "{methodName}" porque "{type}" no se puede asignar al par\xE1metro "{paramName}"',
|
|
20089
20124
|
breakInExceptionGroup: 'No se permite "break" en un bloque "except*"',
|
|
20090
20125
|
breakOutsideLoop: '"break" solo se puede usar dentro de un bucle',
|
|
@@ -20516,6 +20551,7 @@ var require_package_nls_es = __commonJS({
|
|
|
20516
20551
|
typeAliasRedeclared: '"{name}" se declara como TypeAlias y solo puede asignarse una vez',
|
|
20517
20552
|
typeAliasStatementBadScope: "Una instrucci\xF3n de type solo se puede usar en el \xE1mbito de un m\xF3dulo o de una clase",
|
|
20518
20553
|
typeAliasStatementIllegal: "La sentencia Type alias requiere Python 3.12 o posterior",
|
|
20554
|
+
typeAliasTypeBadScope: "Un alias de tipo solo se puede definir dentro de un \xE1mbito de m\xF3dulo o clase",
|
|
20519
20555
|
typeAliasTypeBaseClass: 'Un alias de tipo definido en una instrucci\xF3n "type" no se puede usar como clase base',
|
|
20520
20556
|
typeAliasTypeMustBeAssigned: "TypeAliasType debe asignarse a una variable con el mismo nombre que el alias de tipo",
|
|
20521
20557
|
typeAliasTypeNameArg: "El primer argumento de TypeAliasType debe ser un literal de cadena que represente el nombre del alias de tipo",
|
|
@@ -20727,6 +20763,7 @@ var require_package_nls_es = __commonJS({
|
|
|
20727
20763
|
kwargsParamMissing: 'El par\xE1metro "**{paramName}" no tiene ning\xFAn par\xE1metro correspondiente.',
|
|
20728
20764
|
listAssignmentMismatch: 'El tipo "{type}" es incompatible con la lista de objetivos',
|
|
20729
20765
|
literalAssignmentMismatch: '"{sourceType}" no se puede asignar al tipo "{destType}"',
|
|
20766
|
+
literalNotAllowed: '"Literal" special form cannot be used with instance and class checks',
|
|
20730
20767
|
matchIsNotExhaustiveHint: 'Si no se pretende un tratamiento exhaustivo, agregue "case _: pass"',
|
|
20731
20768
|
matchIsNotExhaustiveType: 'Tipo no manejado: "{type}"',
|
|
20732
20769
|
memberAssignment: 'La expresi\xF3n de tipo "{type}" no se puede asignar al atributo "{name}" de la clase "{classType}"',
|
|
@@ -20924,6 +20961,7 @@ var require_package_nls_fr = __commonJS({
|
|
|
20924
20961
|
baseClassUnknown: "Le type de classe de base est inconnu, ce qui masque le type de classe d\xE9riv\xE9e",
|
|
20925
20962
|
baseClassVariableTypeIncompatible: "Les classes de base de la classe \xAB\xA0{classType}\xA0\xBB d\xE9finissent la variable \xAB\xA0{name}\xA0\xBB de mani\xE8re incompatible",
|
|
20926
20963
|
binaryOperationNotAllowed: "Op\xE9rateur binaire non autoris\xE9 dans l'expression de type",
|
|
20964
|
+
bindParamMissing: "Impossible de lier la m\xE9thode \xAB\xA0{methodName}\xA0\xBB, car il manque un param\xE8tre \xAB\xA0self\xA0\xBB ou \xAB\xA0cls\xA0\xBB",
|
|
20927
20965
|
bindTypeMismatch: `Impossible de lier la m\xE9thode "{methodName}" car "{type}" n'est pas attribuable au param\xE8tre "{paramName}"`,
|
|
20928
20966
|
breakInExceptionGroup: "\xAB\xA0break\xA0\xBB n\u2019est pas autoris\xE9 dans un bloc \xAB\xA0except*\xA0\xBB",
|
|
20929
20967
|
breakOutsideLoop: `"break" ne peut \xEAtre utilis\xE9 qu'\xE0 l'int\xE9rieur d'une boucle`,
|
|
@@ -21355,6 +21393,7 @@ var require_package_nls_fr = __commonJS({
|
|
|
21355
21393
|
typeAliasRedeclared: "\xAB {name} \xBB est d\xE9clar\xE9 en tant que TypeAlias et ne peut \xEAtre attribu\xE9 qu\u2019une seule fois",
|
|
21356
21394
|
typeAliasStatementBadScope: "Une instruction de type ne peut \xEAtre utilis\xE9e que dans une \xE9tendue de module ou de classe",
|
|
21357
21395
|
typeAliasStatementIllegal: "L\u2019instruction d\u2019alias de type n\xE9cessite Python 3.12 ou version ult\xE9rieure",
|
|
21396
|
+
typeAliasTypeBadScope: "Vous ne pouvez d\xE9finir un alias de type qu\u2019au sein d\u2019un module ou d\u2019une \xE9tendue de classe",
|
|
21358
21397
|
typeAliasTypeBaseClass: 'A type alias defined in a "type" statement cannot be used as a base class',
|
|
21359
21398
|
typeAliasTypeMustBeAssigned: "TypeAliasType doit \xEAtre affect\xE9 \xE0 une variable portant le m\xEAme nom que l'alias de type",
|
|
21360
21399
|
typeAliasTypeNameArg: "Le premier argument de TypeAliasType doit \xEAtre un litt\xE9ral de cha\xEEne repr\xE9sentant le nom de l'alias de type",
|
|
@@ -21566,6 +21605,7 @@ var require_package_nls_fr = __commonJS({
|
|
|
21566
21605
|
kwargsParamMissing: `Le param\xE8tre "**{paramName}" n'a pas de param\xE8tre correspondant`,
|
|
21567
21606
|
listAssignmentMismatch: "Le type \xAB\xA0{type}\xA0\xBB n\u2019est pas compatible avec la liste cible",
|
|
21568
21607
|
literalAssignmentMismatch: "\xAB\xA0{sourceType}\xA0\xBB n\u2019est pas assignable au type \xAB\xA0{destType}\xA0\xBB",
|
|
21608
|
+
literalNotAllowed: '"Literal" special form cannot be used with instance and class checks',
|
|
21569
21609
|
matchIsNotExhaustiveHint: "Si la gestion exhaustive n\u2019est pas pr\xE9vue, ajoutez \xAB case _: pass \xBB",
|
|
21570
21610
|
matchIsNotExhaustiveType: "Type non g\xE9r\xE9 : \xAB\xA0{type}\xA0\xBB",
|
|
21571
21611
|
memberAssignment: "L'expression de type \xAB\xA0{type}\xA0\xBB ne peut pas \xEAtre attribu\xE9e \xE0 l\u2019attribut \xAB\xA0{name}\xA0\xBB de la classe \xAB\xA0{classType}\xA0\xBB",
|
|
@@ -21763,6 +21803,7 @@ var require_package_nls_it = __commonJS({
|
|
|
21763
21803
|
baseClassUnknown: "Il tipo della classe di base \xE8 sconosciuto. \xC8 in corso il tentativo di determinare il tipo della classe derivata",
|
|
21764
21804
|
baseClassVariableTypeIncompatible: 'Le classi di base per la classe "{classType}" definiscono la variabile "{name}" in modo incompatibile',
|
|
21765
21805
|
binaryOperationNotAllowed: "Operatore binario non consentito nell'espressione di tipo",
|
|
21806
|
+
bindParamMissing: 'Impossibile associare il metodo "{methodName}" dal momento che il parametro "self" o "cls" risulta mancante',
|
|
21766
21807
|
bindTypeMismatch: 'Non \xE8 stato possibile associare il metodo "{methodName}" perch\xE9 non \xE8 possibile assegnare"{type}" al parametro "{paramName}"',
|
|
21767
21808
|
breakInExceptionGroup: '"break" non consentito in un blocco "except*"',
|
|
21768
21809
|
breakOutsideLoop: `"break" pu\xF2 essere usato solo all'interno di un ciclo`,
|
|
@@ -22194,6 +22235,7 @@ var require_package_nls_it = __commonJS({
|
|
|
22194
22235
|
typeAliasRedeclared: '"{name}" \xE8 dichiarato come TypeAlias e pu\xF2 essere assegnato una sola volta',
|
|
22195
22236
|
typeAliasStatementBadScope: "Un'istruzione type pu\xF2 essere usata solo all'interno di un modulo o di un ambito della classe",
|
|
22196
22237
|
typeAliasStatementIllegal: "L'istruzione alias di tipo richiede Python 3.12 o versione successiva",
|
|
22238
|
+
typeAliasTypeBadScope: "\xC8 possibile definire un alias di tipo solo all'interno di un ambito classe o modulo",
|
|
22197
22239
|
typeAliasTypeBaseClass: `Impossibile utilizzare come classe di base un alias di tipo definito in un'istruzione "type"`,
|
|
22198
22240
|
typeAliasTypeMustBeAssigned: "TypeAliasType deve essere assegnato a una variabile con lo stesso nome dell'alias di tipo",
|
|
22199
22241
|
typeAliasTypeNameArg: "Il primo argomento di TypeAliasType deve essere un valore letterale stringa che rappresenta il nome dell'alias di tipo",
|
|
@@ -22405,6 +22447,7 @@ var require_package_nls_it = __commonJS({
|
|
|
22405
22447
|
kwargsParamMissing: 'Il parametro "**{paramName}" non ha un parametro corrispondente',
|
|
22406
22448
|
listAssignmentMismatch: `Il tipo "{type}" non \xE8 compatibile con l'elenco di destinazione`,
|
|
22407
22449
|
literalAssignmentMismatch: '"{sourceType}" non \xE8 assegnabile al tipo "{destType}"',
|
|
22450
|
+
literalNotAllowed: '"Literal" special form cannot be used with instance and class checks',
|
|
22408
22451
|
matchIsNotExhaustiveHint: 'Se la gestione completa non \xE8 prevista, aggiungere "case _: pass"',
|
|
22409
22452
|
matchIsNotExhaustiveType: 'Tipo non gestito: "{type}"',
|
|
22410
22453
|
memberAssignment: `L'espressione di tipo "{type}" non pu\xF2 essere assegnata all'attributo "{name}" della classe "{classType}".`,
|
|
@@ -22602,6 +22645,7 @@ var require_package_nls_ja = __commonJS({
|
|
|
22602
22645
|
baseClassUnknown: "\u57FA\u5E95\u30AF\u30E9\u30B9\u306E\u578B\u304C\u4E0D\u660E\u3067\u3001\u6D3E\u751F\u30AF\u30E9\u30B9\u306E\u578B\u304C\u4E0D\u660E\u3067\u3059",
|
|
22603
22646
|
baseClassVariableTypeIncompatible: '\u30AF\u30E9\u30B9 "{classType}" \u306E\u57FA\u5E95\u30AF\u30E9\u30B9\u306F\u3001\u4E92\u63DB\u6027\u306E\u306A\u3044\u65B9\u6CD5\u3067\u5909\u6570 "{name}" \u3092\u5B9A\u7FA9\u3057\u307E\u3059',
|
|
22604
22647
|
binaryOperationNotAllowed: "2 \u9805\u6F14\u7B97\u5B50\u306F\u578B\u5F0F\u3067\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093",
|
|
22648
|
+
bindParamMissing: '"self" \u307E\u305F\u306F "cls" \u30D1\u30E9\u30E1\u30FC\u30BF\u30FC\u304C\u306A\u3044\u305F\u3081\u3001\u30E1\u30BD\u30C3\u30C9 "{methodName}" \u3092\u30D0\u30A4\u30F3\u30C9\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F',
|
|
22605
22649
|
bindTypeMismatch: '"{type}" \u304C\u30D1\u30E9\u30E1\u30FC\u30BF\u30FC "{paramName}" \u306B\u5272\u308A\u5F53\u3066\u3067\u304D\u306A\u3044\u305F\u3081\u3001\u30E1\u30BD\u30C3\u30C9 "{methodName}" \u3092\u30D0\u30A4\u30F3\u30C9\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F',
|
|
22606
22650
|
breakInExceptionGroup: '"except*" \u30D6\u30ED\u30C3\u30AF\u3067\u306F "break" \u3092\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093',
|
|
22607
22651
|
breakOutsideLoop: '"break" \u306F\u30EB\u30FC\u30D7\u5185\u3067\u306E\u307F\u4F7F\u7528\u3067\u304D\u307E\u3059',
|
|
@@ -23033,6 +23077,7 @@ var require_package_nls_ja = __commonJS({
|
|
|
23033
23077
|
typeAliasRedeclared: '"{name}" \u306F TypeAlias \u3068\u3057\u3066\u5BA3\u8A00\u3055\u308C\u3066\u304A\u308A\u30011 \u56DE\u3060\u3051\u5272\u308A\u5F53\u3066\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059',
|
|
23034
23078
|
typeAliasStatementBadScope: "type \u30B9\u30C6\u30FC\u30C8\u30E1\u30F3\u30C8\u306F\u3001\u30E2\u30B8\u30E5\u30FC\u30EB\u307E\u305F\u306F\u30AF\u30E9\u30B9\u30B9\u30B3\u30FC\u30D7\u5185\u3067\u306E\u307F\u4F7F\u7528\u3067\u304D\u307E\u3059",
|
|
23035
23079
|
typeAliasStatementIllegal: "\u578B\u30A8\u30A4\u30EA\u30A2\u30B9 \u30B9\u30C6\u30FC\u30C8\u30E1\u30F3\u30C8\u306B\u306F Python 3.12 \u4EE5\u964D\u304C\u5FC5\u8981\u3067\u3059",
|
|
23080
|
+
typeAliasTypeBadScope: "\u578B\u30A8\u30A4\u30EA\u30A2\u30B9\u306F\u3001\u30E2\u30B8\u30E5\u30FC\u30EB\u307E\u305F\u306F\u30AF\u30E9\u30B9 \u30B9\u30B3\u30FC\u30D7\u5185\u3067\u306E\u307F\u5B9A\u7FA9\u3067\u304D\u307E\u3059",
|
|
23036
23081
|
typeAliasTypeBaseClass: '"type" \u30B9\u30C6\u30FC\u30C8\u30E1\u30F3\u30C8\u3067\u5B9A\u7FA9\u3055\u308C\u305F\u578B\u30A8\u30A4\u30EA\u30A2\u30B9\u3092\u57FA\u5E95\u30AF\u30E9\u30B9\u3068\u3057\u3066\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093',
|
|
23037
23082
|
typeAliasTypeMustBeAssigned: "TypeAliasType \u306F\u3001\u578B\u30A8\u30A4\u30EA\u30A2\u30B9\u3068\u540C\u3058\u540D\u524D\u306E\u5909\u6570\u306B\u5272\u308A\u5F53\u3066\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059",
|
|
23038
23083
|
typeAliasTypeNameArg: "TypeAliasType \u306E\u6700\u521D\u306E\u5F15\u6570\u306F\u3001\u578B\u30A8\u30A4\u30EA\u30A2\u30B9\u306E\u540D\u524D\u3092\u8868\u3059\u6587\u5B57\u5217\u30EA\u30C6\u30E9\u30EB\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059",
|
|
@@ -23244,6 +23289,7 @@ var require_package_nls_ja = __commonJS({
|
|
|
23244
23289
|
kwargsParamMissing: '\u30D1\u30E9\u30E1\u30FC\u30BF\u30FC "**{paramName}" \u306B\u5BFE\u5FDC\u3059\u308B\u30D1\u30E9\u30E1\u30FC\u30BF\u30FC\u304C\u3042\u308A\u307E\u305B\u3093',
|
|
23245
23290
|
listAssignmentMismatch: '\u578B "{type}" \u306F\u30BF\u30FC\u30B2\u30C3\u30C8 \u30EA\u30B9\u30C8\u3068\u4E92\u63DB\u6027\u304C\u3042\u308A\u307E\u305B\u3093',
|
|
23246
23291
|
literalAssignmentMismatch: '"{sourceType}" \u306F\u578B "{destType}" \u306B\u5272\u308A\u5F53\u3066\u3067\u304D\u307E\u305B\u3093',
|
|
23292
|
+
literalNotAllowed: '"Literal" special form cannot be used with instance and class checks',
|
|
23247
23293
|
matchIsNotExhaustiveHint: '\u5B8C\u5168\u306A\u51E6\u7406\u304C\u610F\u56F3\u3055\u308C\u3066\u3044\u306A\u3044\u5834\u5408\u306F\u3001"case _: pass" \u3092\u8FFD\u52A0\u3057\u307E\u3059',
|
|
23248
23294
|
matchIsNotExhaustiveType: '\u30CF\u30F3\u30C9\u30EB\u3055\u308C\u306A\u3044\u578B: "{type}"',
|
|
23249
23295
|
memberAssignment: '\u578B "{type}" \u306E\u5F0F\u3092\u30AF\u30E9\u30B9 "{classType}" \u306E\u5C5E\u6027 "{name}" \u306B\u5272\u308A\u5F53\u3066\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093',
|
|
@@ -23441,6 +23487,7 @@ var require_package_nls_ko = __commonJS({
|
|
|
23441
23487
|
baseClassUnknown: "\uAE30\uBCF8 \uD074\uB798\uC2A4 \uD615\uC2DD\uC744 \uC54C \uC218 \uC5C6\uC73C\uBBC0\uB85C \uD30C\uC0DD \uD074\uB798\uC2A4\uC758 \uD615\uC2DD\uC774 \uBAA8\uD638\uD569\uB2C8\uB2E4.",
|
|
23442
23488
|
baseClassVariableTypeIncompatible: '"{classType}" \uD074\uB798\uC2A4\uC758 \uAE30\uBCF8 \uD074\uB798\uC2A4\uAC00 "{name}" \uBCC0\uC218\uB97C \uD638\uD658\uB418\uC9C0 \uC54A\uB294 \uBC29\uC2DD\uC73C\uB85C \uC815\uC758\uD569\uB2C8\uB2E4.',
|
|
23443
23489
|
binaryOperationNotAllowed: "\uD615\uC2DD \uC2DD\uC5D0\uB294 \uC774\uD56D \uC5F0\uC0B0\uC790\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",
|
|
23490
|
+
bindParamMissing: '"self" \uB610\uB294 "cls" \uB9E4\uAC1C \uBCC0\uC218\uAC00 \uB204\uB77D\uB418\uC5C8\uAE30 \uB54C\uBB38\uC5D0 \uBA54\uC11C\uB4DC "{methodName}"\uC744(\uB97C) \uBC14\uC778\uB529\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.',
|
|
23444
23491
|
bindTypeMismatch: "\u2018{type}\u2019\uC744(\uB97C) \uB9E4\uAC1C \uBCC0\uC218 \u2018{paramName}\u2019\uC5D0 \uD560\uB2F9\uD560 \uC218 \uC5C6\uC73C\uBBC0\uB85C \u2018{methodName}\u2019 \uBA54\uC11C\uB4DC\uB97C \uBC14\uC778\uB529\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",
|
|
23445
23492
|
breakInExceptionGroup: '"except*" \uBE14\uB85D\uC5D0\uB294 "break"\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4',
|
|
23446
23493
|
breakOutsideLoop: "\u2018break\u2019\uB294 \uB8E8\uD504 \uB0B4\uC5D0\uC11C\uB9CC \uC0AC\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.",
|
|
@@ -23872,6 +23919,7 @@ var require_package_nls_ko = __commonJS({
|
|
|
23872
23919
|
typeAliasRedeclared: '"{name}"\uC740(\uB294) TypeAlias\uB85C \uC120\uC5B8\uB418\uBA70 \uD55C \uBC88\uB9CC \uD560\uB2F9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.',
|
|
23873
23920
|
typeAliasStatementBadScope: "type \uBB38\uC740 \uBAA8\uB4C8 \uB610\uB294 \uD074\uB798\uC2A4 \uBC94\uC704 \uB0B4\uC5D0\uC11C\uB9CC \uC0AC\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.",
|
|
23874
23921
|
typeAliasStatementIllegal: "\uD615\uC2DD \uBCC4\uCE6D \uBB38\uC5D0\uB294 Python 3.12 \uC774\uC0C1\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.",
|
|
23922
|
+
typeAliasTypeBadScope: "\uD615\uC2DD \uBCC4\uCE6D\uC740 \uBAA8\uB4C8 \uB610\uB294 \uD074\uB798\uC2A4 \uBC94\uC704 \uB0B4\uC5D0\uC11C\uB9CC \uC815\uC758\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.",
|
|
23875
23923
|
typeAliasTypeBaseClass: '"type" \uBB38\uC5D0 \uC815\uC758\uB41C \uD615\uC2DD \uBCC4\uCE6D\uC740 \uAE30\uBCF8 \uD074\uB798\uC2A4\uB85C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.',
|
|
23876
23924
|
typeAliasTypeMustBeAssigned: "TypeAliasType\uC740 \uD615\uC2DD \uBCC4\uCE6D\uACFC \uC774\uB984\uC774 \uAC19\uC740 \uBCC0\uC218\uC5D0 \uD560\uB2F9\uD574\uC57C \uD569\uB2C8\uB2E4.",
|
|
23877
23925
|
typeAliasTypeNameArg: "TypeAliasType\uC758 \uCCAB \uBC88\uC9F8 \uC778\uC218\uB294 \uD615\uC2DD \uBCC4\uCE6D\uC758 \uC774\uB984\uC744 \uB098\uD0C0\uB0B4\uB294 \uBB38\uC790\uC5F4 \uB9AC\uD130\uB7F4\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.",
|
|
@@ -24083,6 +24131,7 @@ var require_package_nls_ko = __commonJS({
|
|
|
24083
24131
|
kwargsParamMissing: "\u2018**{paramName}\u2019 \uB9E4\uAC1C \uBCC0\uC218\uC5D0 \uD574\uB2F9\uD558\uB294 \uB9E4\uAC1C \uBCC0\uC218\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",
|
|
24084
24132
|
listAssignmentMismatch: '"{type}" \uD615\uC2DD\uC774 \uB300\uC0C1 \uBAA9\uB85D\uACFC \uD638\uD658\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.',
|
|
24085
24133
|
literalAssignmentMismatch: '"{sourceType}"\uC740 \uD615\uC2DD "{destType}"\uC5D0 \uD560\uB2F9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.',
|
|
24134
|
+
literalNotAllowed: '"Literal" special form cannot be used with instance and class checks',
|
|
24086
24135
|
matchIsNotExhaustiveHint: '\uC804\uCCB4 \uCC98\uB9AC\uAC00 \uC758\uB3C4\uB418\uC9C0 \uC54A\uC740 \uACBD\uC6B0 "case _: pass"\uB97C \uCD94\uAC00\uD569\uB2C8\uB2E4.',
|
|
24087
24136
|
matchIsNotExhaustiveType: '\uCC98\uB9AC\uB418\uC9C0 \uC54A\uC740 \uD615\uC2DD: "{type}"',
|
|
24088
24137
|
memberAssignment: '"{type}" \uD615\uC2DD\uC758 \uC2DD\uC744 "{classType}" \uD074\uB798\uC2A4\uC758 "{name}" \uD2B9\uC131\uC5D0 \uD560\uB2F9\uD560 \uC218 \uC5C6\uC74C',
|
|
@@ -24280,6 +24329,7 @@ var require_package_nls_pl = __commonJS({
|
|
|
24280
24329
|
baseClassUnknown: "Typ klasy bazowej jest nieznany, zas\u0142aniaj\u0105c typ klasy pochodnej",
|
|
24281
24330
|
baseClassVariableTypeIncompatible: "Klasy bazowe dla klasy \u201E{classType}\u201D definiuj\u0105 zmienn\u0105 \u201E{name}\u201D w niezgodny spos\xF3b",
|
|
24282
24331
|
binaryOperationNotAllowed: "Operator binarny nie jest dozwolony w wyra\u017Ceniu typu",
|
|
24332
|
+
bindParamMissing: "Nie mo\u017Cna powi\u0105za\u0107 metody \u201E{methodName}\u201D, poniewa\u017C brakuje w niej parametru \u201Eself\u201D lub \u201Ecls\u201D",
|
|
24283
24333
|
bindTypeMismatch: "Nie mo\u017Cna powi\u0105za\u0107 metody \u201E{methodName}\u201D, poniewa\u017C nie mo\u017Cna przypisa\u0107 typu \u201E{type}\u201D do parametru \u201E{paramName}\u201D",
|
|
24284
24334
|
breakInExceptionGroup: "\u201Ebreak\u201D nie jest dozwolone w bloku \u201Eexcept*\u201D",
|
|
24285
24335
|
breakOutsideLoop: "Warto\u015B\u0107 \u201Ebreak\u201D mo\u017Ce by\u0107 u\u017Cywana tylko w p\u0119tli",
|
|
@@ -24711,6 +24761,7 @@ var require_package_nls_pl = __commonJS({
|
|
|
24711
24761
|
typeAliasRedeclared: "Nazwa \u201E{name}\u201D jest zadeklarowana jako TypeAlias i mo\u017Ce by\u0107 przypisana tylko raz",
|
|
24712
24762
|
typeAliasStatementBadScope: "Instrukcja type mo\u017Ce by\u0107 u\u017Cyta tylko w zakresie modu\u0142u lub klasy",
|
|
24713
24763
|
typeAliasStatementIllegal: "Instrukcja typu alias wymaga j\u0119zyka Python w wersji 3.12 lub nowszej",
|
|
24764
|
+
typeAliasTypeBadScope: "Alias typu mo\u017Cna zdefiniowa\u0107 tylko w zakresie modu\u0142u lub klasy",
|
|
24714
24765
|
typeAliasTypeBaseClass: 'A type alias defined in a "type" statement cannot be used as a base class',
|
|
24715
24766
|
typeAliasTypeMustBeAssigned: "Typ TypeAliasType musi by\u0107 przypisany do zmiennej o takiej samej nazwie jak alias typu",
|
|
24716
24767
|
typeAliasTypeNameArg: "Pierwszy argument dla typu TypeAliasType musi by\u0107 litera\u0142em ci\u0105gu reprezentuj\u0105cym nazw\u0119 aliasu typu",
|
|
@@ -24922,6 +24973,7 @@ var require_package_nls_pl = __commonJS({
|
|
|
24922
24973
|
kwargsParamMissing: "Parametr \u201E**{paramName}\u201D nie ma odpowiadaj\u0105cego mu parametru",
|
|
24923
24974
|
listAssignmentMismatch: "Typ \u201E{type}\u201D jest niezgodny z list\u0105 docelow\u0105",
|
|
24924
24975
|
literalAssignmentMismatch: "Nie mo\u017Cna przypisa\u0107 typu \u201E{sourceType}\u201D do typu \u201E{destType}\u201D",
|
|
24976
|
+
literalNotAllowed: '"Literal" special form cannot be used with instance and class checks',
|
|
24925
24977
|
matchIsNotExhaustiveHint: "Je\u015Bli kompleksowa obs\u0142uga nie jest zamierzona, dodaj \u201Ecase _: pass\u201D",
|
|
24926
24978
|
matchIsNotExhaustiveType: "Nieobs\u0142ugiwany typ: \u201E{type}\u201D",
|
|
24927
24979
|
memberAssignment: "Wyra\u017Cenia typu \u201E{type}\u201D nie mo\u017Cna przypisa\u0107 do atrybutu \u201E{name}\u201D klasy \u201E{classType}\u201D",
|
|
@@ -25119,6 +25171,7 @@ var require_package_nls_pt_br = __commonJS({
|
|
|
25119
25171
|
baseClassUnknown: "O tipo de classe base \xE9 desconhecido, ocultando o tipo de classe derivada",
|
|
25120
25172
|
baseClassVariableTypeIncompatible: 'Classes base para a classe "{classType}" definem a vari\xE1vel "{name}" de maneira incompat\xEDvel',
|
|
25121
25173
|
binaryOperationNotAllowed: "Operador bin\xE1rio n\xE3o permitido na express\xE3o de tipo",
|
|
25174
|
+
bindParamMissing: 'N\xE3o foi poss\xEDvel vincular o m\xE9todo "{methodName}" porque est\xE1 faltando um par\xE2metro "self" ou "cls"',
|
|
25122
25175
|
bindTypeMismatch: 'N\xE3o foi poss\xEDvel associar o m\xE9todo "{methodName}" porque "{type}" n\xE3o \xE9 atribu\xEDvel ao par\xE2metro "{paramName}"',
|
|
25123
25176
|
breakInExceptionGroup: '"break" n\xE3o \xE9 permitido em um bloco "except*"',
|
|
25124
25177
|
breakOutsideLoop: '"break" s\xF3 pode ser usado dentro de um loop',
|
|
@@ -25550,6 +25603,7 @@ var require_package_nls_pt_br = __commonJS({
|
|
|
25550
25603
|
typeAliasRedeclared: '"{name}" \xE9 declarado como um TypeAlias e s\xF3 pode ser atribu\xEDdo uma vez',
|
|
25551
25604
|
typeAliasStatementBadScope: "Uma instru\xE7\xE3o type s\xF3 pode ser usada dentro de um m\xF3dulo ou escopo de classe",
|
|
25552
25605
|
typeAliasStatementIllegal: "A instru\xE7\xE3o de alias de tipo requer o Python 3.12 ou mais recente",
|
|
25606
|
+
typeAliasTypeBadScope: "Um alias de tipo s\xF3 pode ser definido dentro de um m\xF3dulo ou escopo de classe",
|
|
25553
25607
|
typeAliasTypeBaseClass: 'Um alias de tipo definido em uma instru\xE7\xE3o "type" n\xE3o pode ser usado como uma classe base',
|
|
25554
25608
|
typeAliasTypeMustBeAssigned: "TypeAliasType deve ser atribu\xEDdo a uma vari\xE1vel com o mesmo nome que o alias de tipo",
|
|
25555
25609
|
typeAliasTypeNameArg: "O primeiro argumento para TypeAliasType deve ser um literal de cadeia de caracteres que representa o nome do alias de tipo",
|
|
@@ -25761,6 +25815,7 @@ var require_package_nls_pt_br = __commonJS({
|
|
|
25761
25815
|
kwargsParamMissing: 'O par\xE2metro "**{paramName}" n\xE3o tem nenhum par\xE2metro correspondente',
|
|
25762
25816
|
listAssignmentMismatch: 'O tipo "{type}" \xE9 incompat\xEDvel com a lista de destino',
|
|
25763
25817
|
literalAssignmentMismatch: '"{sourceType}" n\xE3o pode ser atribu\xEDdo a o tipo"{destType}"',
|
|
25818
|
+
literalNotAllowed: '"Literal" special form cannot be used with instance and class checks',
|
|
25764
25819
|
matchIsNotExhaustiveHint: 'Se n\xE3o pretende usar a manipula\xE7\xE3o exaustiva, adicione "case _: pass"',
|
|
25765
25820
|
matchIsNotExhaustiveType: 'Tipo sem tratamento: "{type}"',
|
|
25766
25821
|
memberAssignment: 'A express\xE3o do tipo "{type}" n\xE3o pode ser atribu\xEDda ao atributo "{name}" da classe "{classType}"',
|
|
@@ -25958,6 +26013,7 @@ var require_package_nls_qps_ploc = __commonJS({
|
|
|
25958
26013
|
baseClassUnknown: "[QQxIX][\u0E19\u0E31\u0E49\xDF\xE6s\xEB \xE7l\xE6ss t\xFFp\xEB \xEFs \xB5\xF1k\xF1\xF8w\xF1, \xF8\xFEs\xE7\xB5r\xEF\xF1g t\xFFp\xEB \xF8f \xF0\xEBr\xEFv\xEB\xF0 \xE7l\xE6ss\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]",
|
|
25959
26014
|
baseClassVariableTypeIncompatible: '[YmxlD][\u0E19\u0E31\u0E49\xDF\xE6s\xEB \xE7l\xE6ss\xEBs f\xF8r \xE7l\xE6ss "{\xE7l\xE6ssT\xFFp\xEB}" \xF0\xEBf\xEF\xF1\xEB v\xE6r\xEF\xE6\xFEl\xEB "{\xF1\xE6m\xEB}" \xEF\xF1 \xEF\xF1\xE7\xF8mp\xE6t\xEF\xFEl\xEB w\xE6\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\u0E19\u0E31\u0E49\u0922\u0942\u0901]',
|
|
25960
26015
|
binaryOperationNotAllowed: "[1lzlz][\u0E19\u0E31\u0E49\xDF\xEF\xF1\xE6r\xFF \xF8p\xEBr\xE6t\xF8r \xF1\xF8t \xE6ll\xF8w\xEB\xF0 \xEF\xF1 t\xFFp\xEB \xEBxpr\xEBss\xEF\xF8\xF1\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0E19\u0E31\u0E49\u0922\u0942\u0901]",
|
|
26016
|
+
bindParamMissing: '[6ggqn][\u0E19\u0E31\u0E49\xC7\xF8\xB5l\xF0 \xF1\xF8t \xFE\xEF\xF1\xF0 m\xEBth\xF8\xF0 "{m\xEBth\xF8\xF0\xD1\xE6m\xEB}" \xFE\xEB\xE7\xE6\xB5s\xEB \xEFt \xEFs m\xEFss\xEF\xF1g \xE6 "s\xEBlf" \xF8r "\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\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0E19\u0E31\u0E49\u0922\u0942\u0901]',
|
|
25961
26017
|
bindTypeMismatch: '[x4sbf][\u0E19\u0E31\u0E49\xC7\xF8\xB5l\xF0 \xF1\xF8t \xFE\xEF\xF1\xF0 m\xEBth\xF8\xF0 "{m\xEBth\xF8\xF0\xD1\xE6m\xEB}" \xFE\xEB\xE7\xE6\xB5s\xEB "{t\xFFp\xEB}" \xEFs \xF1\xF8t \xE6ss\xEFg\xF1\xE6\xFEl\xEB t\xF8 p\xE6r\xE6m\xEBt\xEBr "{p\xE6r\xE6m\xD1\xE6m\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\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u0E19\u0E31\u0E49\u0922\u0942\u0901]',
|
|
25962
26018
|
breakInExceptionGroup: '[Kwoku][\u0E19\u0E31\u0E49"break" \xEFs \xF1\xF8t \xE6ll\xF8w\xEB\xF0 \xEF\xF1 \xE6\xF1 "except*" \xFEl\xF8\xE7k\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0E19\u0E31\u0E49\u0922\u0942\u0901]',
|
|
25963
26019
|
breakOutsideLoop: '[Ca4Ip][\u0E19\u0E31\u0E49"break" \xE7\xE6\xF1 \xFE\xEB \xB5s\xEB\xF0 \xF8\xF1l\xFF w\xEFth\xEF\xF1 \xE6 l\xF8\xF8p\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u0E19\u0E31\u0E49\u0922\u0942\u0901]',
|
|
@@ -26389,6 +26445,7 @@ var require_package_nls_qps_ploc = __commonJS({
|
|
|
26389
26445
|
typeAliasRedeclared: '[P036x][\u0E19\u0E31\u0E49"{\xF1\xE6m\xEB}" \xEFs \xF0\xEB\xE7l\xE6r\xEB\xF0 \xE6s \xE6 TypeAlias \xE6\xF1\xF0 \xE7\xE6\xF1 \xFE\xEB \xE6ss\xEFg\xF1\xEB\xF0 \xF8\xF1l\xFF \xF8\xF1\xE7\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]',
|
|
26390
26446
|
typeAliasStatementBadScope: "[C24Up][\u0E19\u0E31\u0E49\xC6 type st\xE6t\xEBm\xEB\xF1t \xE7\xE6\xF1 \xFE\xEB \xB5s\xEB\xF0 \xF8\xF1l\xFF w\xEFth\xEF\xF1 \xE6 m\xF8\xF0\xB5l\xEB \xF8r \xE7l\xE6ss s\xE7\xF8p\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]",
|
|
26391
26447
|
typeAliasStatementIllegal: "[2EW0Q][\u0E19\u0E31\u0E49T\xFFp\xEB \xE6l\xEF\xE6s st\xE6t\xEBm\xEB\xF1t r\xEBq\xB5\xEFr\xEBs P\xFFth\xF8\xF1 3.12 \xF8r \xF1\xEBw\xEBr\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]",
|
|
26448
|
+
typeAliasTypeBadScope: "[kdK34][\u0E19\u0E31\u0E49\xC6 t\xFFp\xEB \xE6l\xEF\xE6s \xE7\xE6\xF1 \xFE\xEB \xF0\xEBf\xEF\xF1\xEB\xF0 \xF8\xF1l\xFF w\xEFth\xEF\xF1 \xE6 m\xF8\xF0\xB5l\xEB \xF8r \xE7l\xE6ss s\xE7\xF8p\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]",
|
|
26392
26449
|
typeAliasTypeBaseClass: '[RIpMs][\u0E19\u0E31\u0E49\xC6 t\xFFp\xEB \xE6l\xEF\xE6s \xF0\xEBf\xEF\xF1\xEB\xF0 \xEF\xF1 \xE6 "type" st\xE6t\xEBm\xEB\xF1t \xE7\xE6\xF1\xF1\xF8t \xFE\xEB \xB5s\xEB\xF0 \xE6s \xE6 \xFE\xE6s\xEB \xE7l\xE6ss\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\u0E19\u0E31\u0E49\u0922\u0942\u0901]',
|
|
26393
26450
|
typeAliasTypeMustBeAssigned: "[aV4Nn][\u0E19\u0E31\u0E49TypeAliasType m\xB5st \xFE\xEB \xE6ss\xEFg\xF1\xEB\xF0 t\xF8 \xE6 v\xE6r\xEF\xE6\xFEl\xEB w\xEFth th\xEB s\xE6m\xEB \xF1\xE6m\xEB \xE6s th\xEB t\xFFp\xEB \xE6l\xEF\xE6s\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]",
|
|
26394
26451
|
typeAliasTypeNameArg: "[dUUf1][\u0E19\u0E31\u0E49F\xEFrst \xE6rg\xB5m\xEB\xF1t t\xF8 TypeAliasType m\xB5st \xFE\xEB \xE6 str\xEF\xF1g l\xEFt\xEBr\xE6l r\xEBpr\xEBs\xEB\xF1t\xEF\xF1g th\xEB \xF1\xE6m\xEB \xF8f th\xEB t\xFFp\xEB \xE6l\xEF\xE6s\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]",
|
|
@@ -26600,6 +26657,7 @@ var require_package_nls_qps_ploc = __commonJS({
|
|
|
26600
26657
|
kwargsParamMissing: '[KHgb2][\u0E19\u0E31\u0E49P\xE6r\xE6m\xEBt\xEBr "**{p\xE6r\xE6m\xD1\xE6m\xEB}" h\xE6s \xF1\xF8 \xE7\xF8rr\xEBsp\xF8\xF1\xF0\xEF\xF1g 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]',
|
|
26601
26658
|
listAssignmentMismatch: '[fERKI][\u0E19\u0E31\u0E49T\xFFp\xEB "{t\xFFp\xEB}" \xEFs \xEF\xF1\xE7\xF8mp\xE6t\xEF\xFEl\xEB w\xEFth t\xE6rg\xEBt l\xEFst\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0E19\u0E31\u0E49\u0922\u0942\u0901]',
|
|
26602
26659
|
literalAssignmentMismatch: '[17LiQ][\u0E19\u0E31\u0E49"{s\xF8\xB5r\xE7\xEBT\xFFp\xEB}" \xEFs \xF1\xF8t \xE6ss\xEFg\xF1\xE6\xFEl\xEB t\xF8 t\xFFp\xEB "{\xF0\xEBstT\xFFp\xEB}"\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]',
|
|
26660
|
+
literalNotAllowed: '[kRsub][\u0E19\u0E31\u0E49"Literal" sp\xEB\xE7\xEF\xE6l f\xF8rm \xE7\xE6\xF1\xF1\xF8t \xFE\xEB \xB5s\xEB\xF0 w\xEFth \xEF\xF1st\xE6\xF1\xE7\xEB \xE6\xF1\xF0 \xE7l\xE6ss \xE7h\xEB\xE7ks\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]',
|
|
26603
26661
|
matchIsNotExhaustiveHint: '[3NR39][\u0E19\u0E31\u0E49\xCFf \xEBxh\xE6\xB5st\xEFv\xEB h\xE6\xF1\xF0l\xEF\xF1g \xEFs \xF1\xF8t \xEF\xF1t\xEB\xF1\xF0\xEB\xF0, \xE6\xF0\xF0 "case _: pass"\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]',
|
|
26604
26662
|
matchIsNotExhaustiveType: '[9RN1P][\u0E19\u0E31\u0E49\xDC\xF1h\xE6\xF1\xF0l\xEB\xF0 t\xFFp\xEB: "{t\xFFp\xEB}"\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0E19\u0E31\u0E49\u0922\u0942\u0901]',
|
|
26605
26663
|
memberAssignment: '[1WFCt][\u0E19\u0E31\u0E49\xCBxpr\xEBss\xEF\xF8\xF1 \xF8f t\xFFp\xEB "{t\xFFp\xEB}" \xE7\xE6\xF1\xF1\xF8t \xFE\xEB \xE6ss\xEFg\xF1\xEB\xF0 t\xF8 \xE6ttr\xEF\xFE\xB5t\xEB "{\xF1\xE6m\xEB}" \xF8f \xE7l\xE6ss "{\xE7l\xE6ssT\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\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0E19\u0E31\u0E49\u0922\u0942\u0901]',
|
|
@@ -26797,6 +26855,7 @@ var require_package_nls_ru = __commonJS({
|
|
|
26797
26855
|
baseClassUnknown: "\u041D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u044B\u0439 \u0442\u0438\u043F \u0431\u0430\u0437\u043E\u0432\u043E\u0433\u043E \u043A\u043B\u0430\u0441\u0441\u0430 \u0441\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u0442\u0438\u043F \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u043D\u043E\u0433\u043E \u043A\u043B\u0430\u0441\u0441\u0430",
|
|
26798
26856
|
baseClassVariableTypeIncompatible: '\u0411\u0430\u0437\u043E\u0432\u044B\u0435 \u043A\u043B\u0430\u0441\u0441\u044B \u043A\u043B\u0430\u0441\u0441\u0430 "{classType}" \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u044F\u044E\u0442 \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u0443\u044E "{name}" \u043D\u0435\u0441\u043E\u0432\u043C\u0435\u0441\u0442\u0438\u043C\u044B\u043C \u0441\u043F\u043E\u0441\u043E\u0431\u043E\u043C',
|
|
26799
26857
|
binaryOperationNotAllowed: "\u0411\u0438\u043D\u0430\u0440\u043D\u044B\u0439 \u043E\u043F\u0435\u0440\u0430\u0442\u043E\u0440 \u043D\u0435\u043B\u044C\u0437\u044F \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0432 \u0432\u044B\u0440\u0430\u0436\u0435\u043D\u0438\u0438 \u0442\u0438\u043F\u0430",
|
|
26858
|
+
bindParamMissing: '\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043F\u0440\u0438\u0432\u044F\u0437\u0430\u0442\u044C \u043C\u0435\u0442\u043E\u0434 "{methodName}", \u0442\u0430\u043A \u043A\u0430\u043A \u0432 \u043D\u0435\u043C \u043E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 "self" \u0438\u043B\u0438 "cls"',
|
|
26800
26859
|
bindTypeMismatch: '\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043F\u0440\u0438\u0432\u044F\u0437\u0430\u0442\u044C \u043C\u0435\u0442\u043E\u0434 "{methodName}", "{type}" \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u043D\u0430\u0437\u043D\u0430\u0447\u0435\u043D \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0443 "{paramName}"',
|
|
26801
26860
|
breakInExceptionGroup: '\u0417\u0430\u043F\u0440\u0435\u0449\u0435\u043D\u043E \u043D\u0430\u043B\u0438\u0447\u0438\u0435 "break" \u0432 \u0431\u043B\u043E\u043A\u0435 "except*"',
|
|
26802
26861
|
breakOutsideLoop: '"break" \u043C\u043E\u0436\u043D\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0442\u043E\u043B\u044C\u043A\u043E \u0432\u043D\u0443\u0442\u0440\u0438 \u0446\u0438\u043A\u043B\u0430',
|
|
@@ -27228,6 +27287,7 @@ var require_package_nls_ru = __commonJS({
|
|
|
27228
27287
|
typeAliasRedeclared: '"{name}" \u043E\u0431\u044A\u044F\u0432\u043B\u0435\u043D \u043A\u0430\u043A TypeAlias \u0438 \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u043F\u0440\u0438\u0441\u0432\u043E\u0435\u043D \u0442\u043E\u043B\u044C\u043A\u043E \u043E\u0434\u0438\u043D \u0440\u0430\u0437',
|
|
27229
27288
|
typeAliasStatementBadScope: "\u0423\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u0435 type \u043C\u043E\u0436\u043D\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0442\u043E\u043B\u044C\u043A\u043E \u0432\u043D\u0443\u0442\u0440\u0438 \u043E\u0431\u043B\u0430\u0441\u0442\u0438 \u043C\u043E\u0434\u0443\u043B\u044F \u0438\u043B\u0438 \u043A\u043B\u0430\u0441\u0441\u0430",
|
|
27230
27289
|
typeAliasStatementIllegal: "\u041E\u043F\u0435\u0440\u0430\u0442\u043E\u0440 \u043F\u0441\u0435\u0432\u0434\u043E\u043D\u0438\u043C\u0430 \u0442\u0438\u043F\u0430 \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.12",
|
|
27290
|
+
typeAliasTypeBadScope: "\u041F\u0441\u0435\u0432\u0434\u043E\u043D\u0438\u043C \u0442\u0438\u043F\u0430 \u043C\u043E\u0436\u043D\u043E \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0438\u0442\u044C \u0442\u043E\u043B\u044C\u043A\u043E \u0432\u043D\u0443\u0442\u0440\u0438 \u043E\u0431\u043B\u0430\u0441\u0442\u0438 \u043C\u043E\u0434\u0443\u043B\u044F \u0438\u043B\u0438 \u043A\u043B\u0430\u0441\u0441\u0430",
|
|
27231
27291
|
typeAliasTypeBaseClass: '\u041F\u0441\u0435\u0432\u0434\u043E\u043D\u0438\u043C \u0442\u0438\u043F\u0430, \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u044F\u0435\u043C\u044B\u0439 \u0432 \u043E\u043F\u0435\u0440\u0430\u0442\u043E\u0440\u0435 "type", \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C\u0441\u044F \u0432 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u0437\u043E\u0432\u043E\u0433\u043E \u043A\u043B\u0430\u0441\u0441\u0430.',
|
|
27232
27292
|
typeAliasTypeMustBeAssigned: "TypeAliasType \u0434\u043E\u043B\u0436\u0435\u043D \u0431\u044B\u0442\u044C \u043D\u0430\u0437\u043D\u0430\u0447\u0435\u043D \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u043E\u0439 \u0441 \u0442\u0435\u043C \u0436\u0435 \u0438\u043C\u0435\u043D\u0435\u043C, \u0447\u0442\u043E \u0438 \u043F\u0441\u0435\u0432\u0434\u043E\u043D\u0438\u043C \u0442\u0438\u043F\u0430",
|
|
27233
27293
|
typeAliasTypeNameArg: "\u041F\u0435\u0440\u0432\u044B\u0439 \u0430\u0440\u0433\u0443\u043C\u0435\u043D\u0442 TypeAliasType \u0434\u043E\u043B\u0436\u0435\u043D \u0431\u044B\u0442\u044C \u0441\u0442\u0440\u043E\u043A\u043E\u0432\u044B\u043C \u043B\u0438\u0442\u0435\u0440\u0430\u043B\u043E\u043C, \u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u044F\u044E\u0449\u0438\u043C \u0438\u043C\u044F \u043F\u0441\u0435\u0432\u0434\u043E\u043D\u0438\u043C\u0430 \u0442\u0438\u043F\u0430",
|
|
@@ -27439,6 +27499,7 @@ var require_package_nls_ru = __commonJS({
|
|
|
27439
27499
|
kwargsParamMissing: '\u0423 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430 "**{paramName}" \u043D\u0435\u0442 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044E\u0449\u0435\u0433\u043E \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430',
|
|
27440
27500
|
listAssignmentMismatch: '\u0422\u0438\u043F "{type}" \u043D\u0435\u0441\u043E\u0432\u043C\u0435\u0441\u0442\u0438\u043C \u0441 \u0446\u0435\u043B\u0435\u0432\u044B\u043C \u0441\u043F\u0438\u0441\u043A\u043E\u043C',
|
|
27441
27501
|
literalAssignmentMismatch: '"{sourceType}" \u043D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u043D\u0430\u0437\u043D\u0430\u0447\u0438\u0442\u044C \u0442\u0438\u043F "{destType}"',
|
|
27502
|
+
literalNotAllowed: '"Literal" special form cannot be used with instance and class checks',
|
|
27442
27503
|
matchIsNotExhaustiveHint: '\u0415\u0441\u043B\u0438 \u043D\u0435 \u043F\u0440\u0435\u0434\u043F\u043E\u043B\u0430\u0433\u0430\u0435\u0442\u0441\u044F \u0438\u0441\u0447\u0435\u0440\u043F\u044B\u0432\u0430\u044E\u0449\u0430\u044F \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430, \u0434\u043E\u0431\u0430\u0432\u044C\u0442\u0435 "case _: pass"',
|
|
27443
27504
|
matchIsNotExhaustiveType: '\u0422\u0438\u043F "{type}" \u043D\u0435 \u043E\u0431\u0440\u0430\u0431\u0430\u0442\u044B\u0432\u0430\u0435\u0442\u0441\u044F',
|
|
27444
27505
|
memberAssignment: '\u0412\u044B\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0442\u0438\u043F\u0430 "{type}" \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u043D\u0430\u0437\u043D\u0430\u0447\u0435\u043D\u043E \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0443 "{name}" \u043A\u043B\u0430\u0441\u0441\u0430 "{classType}"',
|
|
@@ -27636,6 +27697,7 @@ var require_package_nls_tr = __commonJS({
|
|
|
27636
27697
|
baseClassUnknown: "Temel s\u0131n\u0131f t\xFCr\xFC bilinmiyor, t\xFCretilmi\u015F s\u0131n\u0131f\u0131 gizliyor",
|
|
27637
27698
|
baseClassVariableTypeIncompatible: '"{classType}" s\u0131n\u0131f\u0131 i\xE7in temel s\u0131n\u0131flar, "{name}" de\u011Fi\u015Fkenini uyumsuz bir \u015Fekilde tan\u0131ml\u0131yor',
|
|
27638
27699
|
binaryOperationNotAllowed: "T\xFCr ifadesinde ikili i\u015Fle\xE7 kullan\u0131lamaz",
|
|
27700
|
+
bindParamMissing: '"self" veya "cls" parametresi eksik oldu\u011Fundan "{methodName}" y\xF6ntemi ba\u011Flanamad\u0131',
|
|
27639
27701
|
bindTypeMismatch: '"{type}", "{paramName}" parametresine atanamad\u0131\u011F\u0131ndan "{methodName}" metodu ba\u011Flanamad\u0131',
|
|
27640
27702
|
breakInExceptionGroup: '"except*" blo\u011Funda "break" kullan\u0131lamaz',
|
|
27641
27703
|
breakOutsideLoop: '"break" yaln\u0131zca bir d\xF6ng\xFC i\xE7inde kullan\u0131labilir',
|
|
@@ -28067,6 +28129,7 @@ var require_package_nls_tr = __commonJS({
|
|
|
28067
28129
|
typeAliasRedeclared: '"{name}" bir TypeAlias olarak bildirilmi\u015F ve yaln\u0131zca bir kez atanabilir',
|
|
28068
28130
|
typeAliasStatementBadScope: "A type statement can be used only within a module or class scope",
|
|
28069
28131
|
typeAliasStatementIllegal: "T\xFCr di\u011Fer ad\u0131 deyimi i\xE7in Python 3.12 veya daha yeni bir s\xFCr\xFCm\xFC gerekiyor",
|
|
28132
|
+
typeAliasTypeBadScope: "T\xFCr di\u011Fer ad\u0131 yaln\u0131zca bir mod\xFCl veya s\u0131n\u0131f kapsam\u0131nda tan\u0131mlanabilir",
|
|
28070
28133
|
typeAliasTypeBaseClass: 'Bir "type" deyiminde tan\u0131mlanan type di\u011Fer ad\u0131 temel s\u0131n\u0131f olarak kullan\u0131lamaz',
|
|
28071
28134
|
typeAliasTypeMustBeAssigned: "TypeAliasType, t\xFCr di\u011Fer ad\u0131yla ayn\u0131 ada sahip bir de\u011Fi\u015Fkene atanmal\u0131d\u0131r",
|
|
28072
28135
|
typeAliasTypeNameArg: "TypeAliasType i\xE7in ilk ba\u011F\u0131ms\u0131z de\u011Fi\u015Fken, t\xFCr di\u011Fer ad\u0131n\u0131n ad\u0131n\u0131 temsil eden bir sabit de\u011Ferli dize olmal\u0131d\u0131r",
|
|
@@ -28278,6 +28341,7 @@ var require_package_nls_tr = __commonJS({
|
|
|
28278
28341
|
kwargsParamMissing: '"**{paramName}" parametresine kar\u015F\u0131l\u0131k gelen bir parametre yok',
|
|
28279
28342
|
listAssignmentMismatch: '"{type}" t\xFCr\xFC hedef listeyle uyumsuz',
|
|
28280
28343
|
literalAssignmentMismatch: '"{sourceType}" "{destType}" t\xFCr\xFCne atanamaz',
|
|
28344
|
+
literalNotAllowed: '"Literal" special form cannot be used with instance and class checks',
|
|
28281
28345
|
matchIsNotExhaustiveHint: 'T\xFCmlemeli i\u015Fleme ama\xE7lanmad\u0131ysa "case _: pass" ekleyin',
|
|
28282
28346
|
matchIsNotExhaustiveType: '"{type}" t\xFCr\xFC i\u015Flenmemi\u015F',
|
|
28283
28347
|
memberAssignment: '"{type}" t\xFCr\xFCndeki ifade, "{classType}" s\u0131n\u0131f\u0131n\u0131n "{name}" \xF6zniteli\u011Fine atanamaz',
|
|
@@ -28475,6 +28539,7 @@ var require_package_nls_zh_cn = __commonJS({
|
|
|
28475
28539
|
baseClassUnknown: "\u57FA\u7C7B\u7C7B\u578B\u672A\u77E5\uFF0C\u9690\u853D\u6D3E\u751F\u7C7B\u7684\u7C7B\u578B",
|
|
28476
28540
|
baseClassVariableTypeIncompatible: "\u7C7B\u201C{classType}\u201D\u7684\u57FA\u7C7B\u4EE5\u4E0D\u517C\u5BB9\u7684\u65B9\u5F0F\u5B9A\u4E49\u53D8\u91CF\u201C{name}\u201D",
|
|
28477
28541
|
binaryOperationNotAllowed: "\u7C7B\u578B\u8868\u8FBE\u5F0F\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u4E8C\u5143\u8FD0\u7B97\u7B26",
|
|
28542
|
+
bindParamMissing: "\u65E0\u6CD5\u7ED1\u5B9A\u65B9\u6CD5\u201C{methodName}\u201D\uFF0C\u56E0\u4E3A\u5B83\u7F3A\u5C11 \u201Cself\u201D \u6216 \u201Ccls\u201D \u53C2\u6570",
|
|
28478
28543
|
bindTypeMismatch: "\u65E0\u6CD5\u7ED1\u5B9A\u65B9\u6CD5\u201C{methodName}\u201D\uFF0C\u56E0\u4E3A\u201C{type}\u201D\u4E0D\u80FD\u5206\u914D\u7ED9\u53C2\u6570\u201C{paramName}\u201D",
|
|
28479
28544
|
breakInExceptionGroup: '"except*" \u5757\u4E2D\u4E0D\u5141\u8BB8 "break"',
|
|
28480
28545
|
breakOutsideLoop: "\u201Cbreak\u201D\u53EA\u80FD\u5728\u5FAA\u73AF\u4E2D\u4F7F\u7528",
|
|
@@ -28906,6 +28971,7 @@ var require_package_nls_zh_cn = __commonJS({
|
|
|
28906
28971
|
typeAliasRedeclared: "\u201C{name}\u201D\u58F0\u660E\u4E3A TypeAlias\uFF0C\u53EA\u80FD\u5206\u914D\u4E00\u6B21",
|
|
28907
28972
|
typeAliasStatementBadScope: "type \u8BED\u53E5\u53EA\u80FD\u5728\u6A21\u5757\u6216\u7C7B\u8303\u56F4\u5185\u4F7F\u7528",
|
|
28908
28973
|
typeAliasStatementIllegal: "\u7C7B\u578B\u522B\u540D\u8BED\u53E5\u9700\u8981 Python 3.12 \u6216\u66F4\u9AD8\u7248\u672C",
|
|
28974
|
+
typeAliasTypeBadScope: "\u53EA\u80FD\u5728\u6A21\u5757\u6216\u7C7B\u8303\u56F4\u5185\u5B9A\u4E49\u7C7B\u578B\u522B\u540D",
|
|
28909
28975
|
typeAliasTypeBaseClass: '"type" \u8BED\u53E5\u4E2D\u5B9A\u4E49\u7684\u7C7B\u578B\u522B\u540D\u4E0D\u80FD\u7528\u4F5C\u57FA\u7C7B',
|
|
28910
28976
|
typeAliasTypeMustBeAssigned: "\u5FC5\u987B\u5C06 TypeAliasType \u5206\u914D\u7ED9\u4E0E\u7C7B\u578B\u522B\u540D\u540C\u540D\u7684\u53D8\u91CF",
|
|
28911
28977
|
typeAliasTypeNameArg: "TypeAliasType \u7684\u7B2C\u4E00\u4E2A\u53C2\u6570\u5FC5\u987B\u662F\u8868\u793A\u7C7B\u578B\u522B\u540D\u540D\u79F0\u7684\u5B57\u7B26\u4E32\u6587\u672C",
|
|
@@ -29117,6 +29183,7 @@ var require_package_nls_zh_cn = __commonJS({
|
|
|
29117
29183
|
kwargsParamMissing: "\u53C2\u6570\u201C**{paramName}\u201D\u6CA1\u6709\u76F8\u5E94\u7684\u53C2\u6570",
|
|
29118
29184
|
listAssignmentMismatch: "\u7C7B\u578B\u201C{type}\u201D\u4E0E\u76EE\u6807\u5217\u8868\u4E0D\u517C\u5BB9",
|
|
29119
29185
|
literalAssignmentMismatch: "\u201C{sourceType}\u201D\u4E0D\u53EF\u5206\u914D\u7ED9\u7C7B\u578B\u201C{destType}\u201D",
|
|
29186
|
+
literalNotAllowed: '"Literal" special form cannot be used with instance and class checks',
|
|
29120
29187
|
matchIsNotExhaustiveHint: '\u5982\u679C\u672A\u8FDB\u884C\u8BE6\u5C3D\u5904\u7406\uFF0C\u8BF7\u6DFB\u52A0"case _: pass"',
|
|
29121
29188
|
matchIsNotExhaustiveType: '\u672A\u5904\u7406\u7684\u7C7B\u578B: "{type}"',
|
|
29122
29189
|
memberAssignment: "\u65E0\u6CD5\u5C06\u7C7B\u578B\u201C{type}\u201D\u7684\u8868\u8FBE\u5F0F\u5206\u914D\u7ED9\u7C7B\u201C{classType}\u201D\u7684\u5C5E\u6027\u201C{name}\u201D",
|
|
@@ -29314,6 +29381,7 @@ var require_package_nls_zh_tw = __commonJS({
|
|
|
29314
29381
|
baseClassUnknown: "\u57FA\u5E95\u985E\u5225\u985E\u578B\u672A\u77E5\uFF0C\u906E\u853D\u884D\u751F\u985E\u5225\u7684\u985E\u578B",
|
|
29315
29382
|
baseClassVariableTypeIncompatible: '\u985E\u5225 "{classType}" \u7684\u57FA\u5E95\u985E\u5225\u4EE5\u4E0D\u76F8\u5BB9\u7684\u65B9\u5F0F\u5B9A\u7FA9\u8B8A\u6578 "{name}"',
|
|
29316
29383
|
binaryOperationNotAllowed: "\u985E\u578B\u904B\u7B97\u5F0F\u4E2D\u4E0D\u5141\u8A31\u4E8C\u5143\u904B\u7B97\u5B50",
|
|
29384
|
+
bindParamMissing: '\u7121\u6CD5\u7E6B\u7D50\u65B9\u6CD5 "{methodName}"\uFF0C\u56E0\u70BA\u7F3A\u5C11 "self" \u6216 "cls" \u53C3\u6578',
|
|
29317
29385
|
bindTypeMismatch: '\u7121\u6CD5\u7E6B\u7D50\u65B9\u6CD5 "{methodName}"\uFF0C\u56E0\u70BA "{type}" \u7121\u6CD5\u6307\u6D3E\u7D66\u53C3\u6578 "{paramName}"',
|
|
29318
29386
|
breakInExceptionGroup: '"except*" \u5340\u584A\u4E2D\u4E0D\u5141\u8A31 "break"',
|
|
29319
29387
|
breakOutsideLoop: '"break" \u53EA\u80FD\u5728\u8FF4\u5708\u5167\u4F7F\u7528',
|
|
@@ -29745,6 +29813,7 @@ var require_package_nls_zh_tw = __commonJS({
|
|
|
29745
29813
|
typeAliasRedeclared: '"{name}" \u5BA3\u544A\u70BA TypeAlias\uFF0C\u4E14\u53EA\u80FD\u6307\u6D3E\u4E00\u6B21',
|
|
29746
29814
|
typeAliasStatementBadScope: "A type statement can be used only within a module or class scope",
|
|
29747
29815
|
typeAliasStatementIllegal: "\u985E\u578B\u5225\u540D\u9673\u8FF0\u5F0F\u9700\u8981 Python 3.12 \u6216\u66F4\u65B0\u7248\u672C",
|
|
29816
|
+
typeAliasTypeBadScope: "\u985E\u578B\u5225\u540D\u53EA\u80FD\u5728\u6A21\u7D44\u6216\u985E\u5225\u7BC4\u570D\u5167\u5B9A\u7FA9",
|
|
29748
29817
|
typeAliasTypeBaseClass: '"type" \u9673\u8FF0\u5F0F\u4E2D\u5B9A\u7FA9\u7684\u985E\u578B\u5225\u540D\u4E0D\u80FD\u505A\u70BA\u57FA\u5E95\u985E\u5225\u4F7F\u7528',
|
|
29749
29818
|
typeAliasTypeMustBeAssigned: "TypeAliasType \u5FC5\u9808\u6307\u6D3E\u7D66\u8207\u578B\u5225\u5225\u540D\u76F8\u540C\u7684\u8B8A\u6578",
|
|
29750
29819
|
typeAliasTypeNameArg: "TypeAliasType \u7684\u7B2C\u4E00\u500B\u5F15\u6578\u5FC5\u9808\u662F\u4EE3\u8868\u578B\u5225\u5225\u540D\u540D\u7A31\u7684\u5B57\u4E32\u5E38\u503C",
|
|
@@ -29956,6 +30025,7 @@ var require_package_nls_zh_tw = __commonJS({
|
|
|
29956
30025
|
kwargsParamMissing: '\u53C3\u6578 "**{paramName}" \u6C92\u6709\u5C0D\u61C9\u7684\u53C3\u6578',
|
|
29957
30026
|
listAssignmentMismatch: '\u985E\u578B "{type}" \u8207\u76EE\u6A19\u6E05\u55AE\u4E0D\u76F8\u5BB9',
|
|
29958
30027
|
literalAssignmentMismatch: '"{sourceType}" \u7121\u6CD5\u6307\u6D3E\u7D66\u578B\u5225 "{destType}"',
|
|
30028
|
+
literalNotAllowed: '"Literal" special form cannot be used with instance and class checks',
|
|
29959
30029
|
matchIsNotExhaustiveHint: '\u5982\u679C\u4E0D\u9700\u8981\u5FB9\u5E95\u8655\u7406\uFF0C\u8ACB\u65B0\u589E "case _: pass"',
|
|
29960
30030
|
matchIsNotExhaustiveType: '\u672A\u8655\u7406\u7684\u985E\u578B: "{type}"',
|
|
29961
30031
|
memberAssignment: '\u7121\u6CD5\u5C07\u578B\u5225 "{type}" \u7684\u904B\u7B97\u5F0F\u6307\u6D3E\u7D66\u985E\u5225 "{classType}" \u7684\u5C6C\u6027 "{name}"',
|
|
@@ -30453,6 +30523,9 @@ var require_localize = __commonJS({
|
|
|
30453
30523
|
Diagnostic4.finalClassIsAbstract = () => new ParameterizedString(getRawString("Diagnostic.finalClassIsAbstract"));
|
|
30454
30524
|
Diagnostic4.finalContext = () => getRawString("Diagnostic.finalContext");
|
|
30455
30525
|
Diagnostic4.finalInLoop = () => getRawString("Diagnostic.finalInLoop");
|
|
30526
|
+
Diagnostic4.finallyBreak = () => getRawString("Diagnostic.finallyBreak");
|
|
30527
|
+
Diagnostic4.finallyContinue = () => getRawString("Diagnostic.finallyContinue");
|
|
30528
|
+
Diagnostic4.finallyReturn = () => getRawString("Diagnostic.finallyReturn");
|
|
30456
30529
|
Diagnostic4.finalMethodOverride = () => new ParameterizedString(getRawString("Diagnostic.finalMethodOverride"));
|
|
30457
30530
|
Diagnostic4.finalNonMethod = () => new ParameterizedString(getRawString("Diagnostic.finalNonMethod"));
|
|
30458
30531
|
Diagnostic4.finalReassigned = () => new ParameterizedString(getRawString("Diagnostic.finalReassigned"));
|
|
@@ -30553,6 +30626,7 @@ var require_localize = __commonJS({
|
|
|
30553
30626
|
Diagnostic4.namedParamAfterParamSpecArgs = () => new ParameterizedString(getRawString("Diagnostic.namedParamAfterParamSpecArgs"));
|
|
30554
30627
|
Diagnostic4.namedTupleEmptyName = () => getRawString("Diagnostic.namedTupleEmptyName");
|
|
30555
30628
|
Diagnostic4.namedTupleEntryRedeclared = () => new ParameterizedString(getRawString("Diagnostic.namedTupleEntryRedeclared"));
|
|
30629
|
+
Diagnostic4.namedTupleFieldUnderscore = () => getRawString("Diagnostic.namedTupleFieldUnderscore");
|
|
30556
30630
|
Diagnostic4.namedTupleFirstArg = () => getRawString("Diagnostic.namedTupleFirstArg");
|
|
30557
30631
|
Diagnostic4.namedTupleMultipleInheritance = () => getRawString("Diagnostic.namedTupleMultipleInheritance");
|
|
30558
30632
|
Diagnostic4.namedTupleNameKeyword = () => getRawString("Diagnostic.namedTupleNameKeyword");
|
|
@@ -30938,6 +31012,7 @@ var require_localize = __commonJS({
|
|
|
30938
31012
|
DiagnosticAddendum2.kwargsParamMissing = () => new ParameterizedString(getRawString("DiagnosticAddendum.kwargsParamMissing"));
|
|
30939
31013
|
DiagnosticAddendum2.listAssignmentMismatch = () => new ParameterizedString(getRawString("DiagnosticAddendum.listAssignmentMismatch"));
|
|
30940
31014
|
DiagnosticAddendum2.literalAssignmentMismatch = () => new ParameterizedString(getRawString("DiagnosticAddendum.literalAssignmentMismatch"));
|
|
31015
|
+
DiagnosticAddendum2.literalNotAllowed = () => getRawString("DiagnosticAddendum.literalNotAllowed");
|
|
30941
31016
|
DiagnosticAddendum2.matchIsNotExhaustiveType = () => new ParameterizedString(getRawString("DiagnosticAddendum.matchIsNotExhaustiveType"));
|
|
30942
31017
|
DiagnosticAddendum2.matchIsNotExhaustiveHint = () => getRawString("DiagnosticAddendum.matchIsNotExhaustiveHint");
|
|
30943
31018
|
DiagnosticAddendum2.memberAssignment = () => new ParameterizedString(getRawString("DiagnosticAddendum.memberAssignment"));
|
|
@@ -33007,6 +33082,9 @@ var require_codeFlowTypes = __commonJS({
|
|
|
33007
33082
|
if (reference.nodeType === 35) {
|
|
33008
33083
|
return isCodeFlowSupportedForReference(reference.d.leftExpr);
|
|
33009
33084
|
}
|
|
33085
|
+
if (reference.nodeType === 4) {
|
|
33086
|
+
return true;
|
|
33087
|
+
}
|
|
33010
33088
|
if (reference.nodeType === 27) {
|
|
33011
33089
|
if (reference.d.items.length !== 1 || reference.d.trailingComma || reference.d.items[0].d.name !== void 0 || reference.d.items[0].d.argCategory !== 0) {
|
|
33012
33090
|
return false;
|
|
@@ -33026,6 +33104,8 @@ var require_codeFlowTypes = __commonJS({
|
|
|
33026
33104
|
let key;
|
|
33027
33105
|
if (reference.nodeType === 38) {
|
|
33028
33106
|
key = reference.d.value;
|
|
33107
|
+
} else if (reference.nodeType === 4) {
|
|
33108
|
+
key = reference.d.name.d.value;
|
|
33029
33109
|
} else if (reference.nodeType === 35) {
|
|
33030
33110
|
const leftKey = createKeyForReference(reference.d.leftExpr);
|
|
33031
33111
|
key = `${leftKey}.${reference.d.member.d.value}`;
|
|
@@ -33056,6 +33136,9 @@ var require_codeFlowTypes = __commonJS({
|
|
|
33056
33136
|
if (reference.nodeType === 38) {
|
|
33057
33137
|
return [createKeyForReference(reference)];
|
|
33058
33138
|
}
|
|
33139
|
+
if (reference.nodeType === 4) {
|
|
33140
|
+
return [createKeyForReference(reference.d.name)];
|
|
33141
|
+
}
|
|
33059
33142
|
if (reference.nodeType === 35) {
|
|
33060
33143
|
return [
|
|
33061
33144
|
...createKeysForReferenceSubexpressions(reference.d.leftExpr),
|
|
@@ -33126,9 +33209,6 @@ var require_analyzerNodeInfo = __commonJS({
|
|
|
33126
33209
|
if (info == null ? void 0 : info.dunderAllInfo) {
|
|
33127
33210
|
info.dunderAllInfo = void 0;
|
|
33128
33211
|
}
|
|
33129
|
-
if (info == null ? void 0 : info.typeParamSymbol) {
|
|
33130
|
-
info.typeParamSymbol = void 0;
|
|
33131
|
-
}
|
|
33132
33212
|
}
|
|
33133
33213
|
function getImportInfo(node) {
|
|
33134
33214
|
const info = getAnalyzerInfo(node);
|
|
@@ -33993,6 +34073,8 @@ var require_parseTreeUtils = __commonJS({
|
|
|
33993
34073
|
exports2.checkDecorator = checkDecorator;
|
|
33994
34074
|
exports2.isSimpleDefault = isSimpleDefault;
|
|
33995
34075
|
exports2.getPreviousNonWhitespaceToken = getPreviousNonWhitespaceToken;
|
|
34076
|
+
exports2.getNextNonWhitespaceToken = getNextNonWhitespaceToken;
|
|
34077
|
+
exports2.getNextMatchingToken = getNextMatchingToken;
|
|
33996
34078
|
var AnalyzerNodeInfo = __importStar(require_analyzerNodeInfo());
|
|
33997
34079
|
var core_1 = require_core();
|
|
33998
34080
|
var debug_1 = require_debug();
|
|
@@ -35018,12 +35100,22 @@ var require_parseTreeUtils = __commonJS({
|
|
|
35018
35100
|
walker.walk(node);
|
|
35019
35101
|
return foundAwait;
|
|
35020
35102
|
}
|
|
35021
|
-
function isMatchingExpression(reference, expression) {
|
|
35103
|
+
function isMatchingExpression(reference, expression, compareName) {
|
|
35022
35104
|
if (reference.nodeType === 38) {
|
|
35105
|
+
let nameToCompare;
|
|
35023
35106
|
if (expression.nodeType === 38) {
|
|
35024
|
-
|
|
35107
|
+
nameToCompare = expression;
|
|
35025
35108
|
} else if (expression.nodeType === 4) {
|
|
35026
|
-
|
|
35109
|
+
nameToCompare = expression.d.name;
|
|
35110
|
+
}
|
|
35111
|
+
if (nameToCompare) {
|
|
35112
|
+
if (reference.d.value !== nameToCompare.d.value) {
|
|
35113
|
+
return false;
|
|
35114
|
+
}
|
|
35115
|
+
if (compareName) {
|
|
35116
|
+
return compareName(reference, nameToCompare);
|
|
35117
|
+
}
|
|
35118
|
+
return true;
|
|
35027
35119
|
}
|
|
35028
35120
|
return false;
|
|
35029
35121
|
} else if (reference.nodeType === 35 && expression.nodeType === 35) {
|
|
@@ -36126,6 +36218,23 @@ var require_parseTreeUtils = __commonJS({
|
|
|
36126
36218
|
}
|
|
36127
36219
|
return void 0;
|
|
36128
36220
|
}
|
|
36221
|
+
function getNextNonWhitespaceToken(tokens, offset) {
|
|
36222
|
+
return getNextMatchingToken(tokens, offset, (token) => !isWhitespace(token));
|
|
36223
|
+
}
|
|
36224
|
+
function getNextMatchingToken(tokens, offset, match2, exit = () => false) {
|
|
36225
|
+
let tokenIndex = tokens.getItemAtPosition(offset) + 1;
|
|
36226
|
+
while (tokenIndex < tokens.count) {
|
|
36227
|
+
const token = tokens.getItemAt(tokenIndex);
|
|
36228
|
+
if (match2(token)) {
|
|
36229
|
+
return token;
|
|
36230
|
+
}
|
|
36231
|
+
if (exit(token)) {
|
|
36232
|
+
return void 0;
|
|
36233
|
+
}
|
|
36234
|
+
tokenIndex += 1;
|
|
36235
|
+
}
|
|
36236
|
+
return void 0;
|
|
36237
|
+
}
|
|
36129
36238
|
}
|
|
36130
36239
|
});
|
|
36131
36240
|
|
|
@@ -41154,6 +41263,7 @@ var require_tokenizer = __commonJS({
|
|
|
41154
41263
|
exports2.Tokenizer = void 0;
|
|
41155
41264
|
var parseTreeUtils_1 = require_parseTreeUtils();
|
|
41156
41265
|
var sourceFile_1 = require_sourceFile();
|
|
41266
|
+
var core_1 = require_core();
|
|
41157
41267
|
var textRangeCollection_1 = require_textRangeCollection();
|
|
41158
41268
|
var characters_1 = require_characters();
|
|
41159
41269
|
var characterStream_1 = require_characterStream();
|
|
@@ -42024,7 +42134,7 @@ var require_tokenizer = __commonJS({
|
|
|
42024
42134
|
if (_keywords.has(value)) {
|
|
42025
42135
|
this._tokens.push(tokenizerTypes_1.KeywordToken.create(start, this._cs.position - start, _keywords.get(value), this._getComments()));
|
|
42026
42136
|
} else {
|
|
42027
|
-
this._tokens.push(tokenizerTypes_1.IdentifierToken.create(start, this._cs.position - start, value, this._getComments()));
|
|
42137
|
+
this._tokens.push(tokenizerTypes_1.IdentifierToken.create(start, this._cs.position - start, (0, core_1.cloneStr)(value), this._getComments()));
|
|
42028
42138
|
}
|
|
42029
42139
|
return true;
|
|
42030
42140
|
}
|
|
@@ -42361,7 +42471,7 @@ var require_tokenizer = __commonJS({
|
|
|
42361
42471
|
if (endTrimmed.length > 0) {
|
|
42362
42472
|
commentRules.push({
|
|
42363
42473
|
range: { start: currentOffset, length: endTrimmed.length },
|
|
42364
|
-
text: endTrimmed
|
|
42474
|
+
text: (0, core_1.cloneStr)(endTrimmed)
|
|
42365
42475
|
});
|
|
42366
42476
|
}
|
|
42367
42477
|
currentOffset += frontTrimmed.length + 1;
|
|
@@ -42399,8 +42509,6 @@ var require_tokenizer = __commonJS({
|
|
|
42399
42509
|
switch (prefix) {
|
|
42400
42510
|
case "rf":
|
|
42401
42511
|
case "fr":
|
|
42402
|
-
case "ur":
|
|
42403
|
-
case "ru":
|
|
42404
42512
|
case "br":
|
|
42405
42513
|
case "rb":
|
|
42406
42514
|
return 2;
|
|
@@ -43625,7 +43733,7 @@ var require_binder = __commonJS({
|
|
|
43625
43733
|
this._addImplicitSymbolToCurrentScope("__loader__", node, "Any");
|
|
43626
43734
|
this._addImplicitSymbolToCurrentScope("__package__", node, "str | None");
|
|
43627
43735
|
this._addImplicitSymbolToCurrentScope("__spec__", node, "Any");
|
|
43628
|
-
this._addImplicitSymbolToCurrentScope("__path__", node, "
|
|
43736
|
+
this._addImplicitSymbolToCurrentScope("__path__", node, "MutableSequence[str]");
|
|
43629
43737
|
this._addImplicitSymbolToCurrentScope("__file__", node, "str");
|
|
43630
43738
|
this._addImplicitSymbolToCurrentScope("__cached__", node, "str");
|
|
43631
43739
|
this._addImplicitSymbolToCurrentScope("__dict__", node, "Dict[str, Any]");
|
|
@@ -43685,6 +43793,7 @@ var require_binder = __commonJS({
|
|
|
43685
43793
|
return false;
|
|
43686
43794
|
}
|
|
43687
43795
|
visitModuleName(node) {
|
|
43796
|
+
var _a;
|
|
43688
43797
|
const importResult = AnalyzerNodeInfo.getImportInfo(node);
|
|
43689
43798
|
(0, debug_1.assert)(importResult !== void 0);
|
|
43690
43799
|
if (importResult.isNativeLib) {
|
|
@@ -43697,7 +43806,19 @@ var require_binder = __commonJS({
|
|
|
43697
43806
|
}), node);
|
|
43698
43807
|
return true;
|
|
43699
43808
|
}
|
|
43809
|
+
let reportStubMissing = false;
|
|
43700
43810
|
if (!importResult.isStubFile && importResult.importType === 1 && !importResult.pyTypedInfo) {
|
|
43811
|
+
reportStubMissing = true;
|
|
43812
|
+
if (importResult.isNamespacePackage && ((_a = node.parent) == null ? void 0 : _a.nodeType) === 25) {
|
|
43813
|
+
if (node.parent.d.imports.every((importAs) => {
|
|
43814
|
+
const implicitImport = importResult.filteredImplicitImports.get(importAs.d.name.d.value);
|
|
43815
|
+
return !!(implicitImport == null ? void 0 : implicitImport.pyTypedInfo);
|
|
43816
|
+
})) {
|
|
43817
|
+
reportStubMissing = false;
|
|
43818
|
+
}
|
|
43819
|
+
}
|
|
43820
|
+
}
|
|
43821
|
+
if (reportStubMissing) {
|
|
43701
43822
|
const diagnostic = this._addDiagnostic(diagnosticRules_1.DiagnosticRule.reportMissingTypeStubs, localize_1.LocMessage.stubFileMissing().format({ importName: importResult.importName }), node);
|
|
43702
43823
|
if (diagnostic) {
|
|
43703
43824
|
const createTypeStubAction = {
|
|
@@ -44329,6 +44450,7 @@ var require_binder = __commonJS({
|
|
|
44329
44450
|
this._targetFunctionDeclaration.returnStatements.push(node);
|
|
44330
44451
|
}
|
|
44331
44452
|
if (node.d.expr) {
|
|
44453
|
+
AnalyzerNodeInfo.setFlowNode(node.d.expr, this._currentFlowNode);
|
|
44332
44454
|
this.walk(node.d.expr);
|
|
44333
44455
|
}
|
|
44334
44456
|
AnalyzerNodeInfo.setFlowNode(node, this._currentFlowNode);
|
|
@@ -46756,6 +46878,7 @@ var require_types = __commonJS({
|
|
|
46756
46878
|
exports2.isUnpacked = isUnpacked;
|
|
46757
46879
|
exports2.isFunction = isFunction;
|
|
46758
46880
|
exports2.isOverloaded = isOverloaded;
|
|
46881
|
+
exports2.isFunctionOrOverloaded = isFunctionOrOverloaded;
|
|
46759
46882
|
exports2.getTypeAliasInfo = getTypeAliasInfo;
|
|
46760
46883
|
exports2.isTypeSame = isTypeSame;
|
|
46761
46884
|
exports2.removeUnknownFromUnion = removeUnknownFromUnion;
|
|
@@ -47567,6 +47690,15 @@ var require_types = __commonJS({
|
|
|
47567
47690
|
}
|
|
47568
47691
|
return true;
|
|
47569
47692
|
}
|
|
47693
|
+
const subclassDepth = TypeBase.getInstantiableDepth(subclassType);
|
|
47694
|
+
if (subclassDepth > 0) {
|
|
47695
|
+
if (isBuiltIn(parentClassType, "type") && TypeBase.getInstantiableDepth(parentClassType) < subclassDepth) {
|
|
47696
|
+
if (inheritanceChain) {
|
|
47697
|
+
inheritanceChain.push(parentClassType);
|
|
47698
|
+
}
|
|
47699
|
+
return true;
|
|
47700
|
+
}
|
|
47701
|
+
}
|
|
47570
47702
|
if (ClassType2.isBuiltIn(subclassType, "property") && ClassType2.isBuiltIn(parentClassType, "property")) {
|
|
47571
47703
|
if (inheritanceChain) {
|
|
47572
47704
|
inheritanceChain.push(subclassType);
|
|
@@ -47712,16 +47844,14 @@ var require_types = __commonJS({
|
|
|
47712
47844
|
if (stripFirstParam) {
|
|
47713
47845
|
if (type.shared.parameters.length > 0) {
|
|
47714
47846
|
if (type.shared.parameters[0].category === 0) {
|
|
47715
|
-
if (type.shared.parameters.length > 0
|
|
47716
|
-
newFunction.priv.strippedFirstParamType = getParamType(type, 0);
|
|
47847
|
+
if (type.shared.parameters.length > 0) {
|
|
47848
|
+
newFunction.priv.strippedFirstParamType = FunctionParam.isTypeInferred(type.shared.parameters[0]) ? AnyType.create() : getParamType(type, 0);
|
|
47717
47849
|
}
|
|
47718
47850
|
newFunction.shared.parameters = type.shared.parameters.slice(1);
|
|
47719
47851
|
}
|
|
47720
47852
|
} else {
|
|
47721
47853
|
stripFirstParam = false;
|
|
47722
47854
|
}
|
|
47723
|
-
newFunction.shared.flags &= ~(1 | 2);
|
|
47724
|
-
newFunction.shared.flags |= 4;
|
|
47725
47855
|
}
|
|
47726
47856
|
if ((_a = type.props) == null ? void 0 : _a.typeAliasInfo) {
|
|
47727
47857
|
TypeBase.setTypeAliasInfo(newFunction, type.props.typeAliasInfo);
|
|
@@ -47733,7 +47863,7 @@ var require_types = __commonJS({
|
|
|
47733
47863
|
returnType: type.priv.specializedTypes.returnType
|
|
47734
47864
|
};
|
|
47735
47865
|
}
|
|
47736
|
-
newFunction.
|
|
47866
|
+
newFunction.shared.inferredReturnType = type.shared.inferredReturnType;
|
|
47737
47867
|
return newFunction;
|
|
47738
47868
|
}
|
|
47739
47869
|
FunctionType2.clone = clone;
|
|
@@ -47766,20 +47896,13 @@ var require_types = __commonJS({
|
|
|
47766
47896
|
return newInstance;
|
|
47767
47897
|
}
|
|
47768
47898
|
FunctionType2.cloneAsInstantiable = cloneAsInstantiable;
|
|
47769
|
-
function specialize(type, specializedTypes
|
|
47770
|
-
var _a;
|
|
47899
|
+
function specialize(type, specializedTypes) {
|
|
47771
47900
|
const newFunction = TypeBase.cloneType(type);
|
|
47772
47901
|
(0, debug_1.assert)(specializedTypes.parameterTypes.length === type.shared.parameters.length);
|
|
47773
47902
|
if (specializedTypes.parameterDefaultTypes) {
|
|
47774
47903
|
(0, debug_1.assert)(specializedTypes.parameterDefaultTypes.length === type.shared.parameters.length);
|
|
47775
47904
|
}
|
|
47776
47905
|
newFunction.priv.specializedTypes = specializedTypes;
|
|
47777
|
-
if (specializedInferredReturnType) {
|
|
47778
|
-
newFunction.priv.inferredReturnType = {
|
|
47779
|
-
type: specializedInferredReturnType,
|
|
47780
|
-
isIncomplete: (_a = type.priv.inferredReturnType) == null ? void 0 : _a.isIncomplete
|
|
47781
|
-
};
|
|
47782
|
-
}
|
|
47783
47906
|
return newFunction;
|
|
47784
47907
|
}
|
|
47785
47908
|
FunctionType2.specialize = specialize;
|
|
@@ -47895,8 +48018,8 @@ var require_types = __commonJS({
|
|
|
47895
48018
|
newFunction.priv.specializedTypes.parameterDefaultTypes = newFunction.priv.specializedTypes.parameterDefaultTypes.slice(0, newFunction.priv.specializedTypes.parameterDefaultTypes.length - paramsToDrop);
|
|
47896
48019
|
}
|
|
47897
48020
|
}
|
|
47898
|
-
if (type.
|
|
47899
|
-
newFunction.
|
|
48021
|
+
if (type.shared.inferredReturnType) {
|
|
48022
|
+
newFunction.shared.inferredReturnType = type.shared.inferredReturnType;
|
|
47900
48023
|
}
|
|
47901
48024
|
return newFunction;
|
|
47902
48025
|
}
|
|
@@ -48095,7 +48218,7 @@ var require_types = __commonJS({
|
|
|
48095
48218
|
return type.shared.declaredReturnType;
|
|
48096
48219
|
}
|
|
48097
48220
|
if (includeInferred) {
|
|
48098
|
-
return (_b = type.
|
|
48221
|
+
return (_b = type.shared.inferredReturnType) == null ? void 0 : _b.type;
|
|
48099
48222
|
}
|
|
48100
48223
|
return void 0;
|
|
48101
48224
|
}
|
|
@@ -48734,6 +48857,9 @@ var require_types = __commonJS({
|
|
|
48734
48857
|
function isOverloaded(type) {
|
|
48735
48858
|
return type.category === 5;
|
|
48736
48859
|
}
|
|
48860
|
+
function isFunctionOrOverloaded(type) {
|
|
48861
|
+
return type.category === 4 || type.category === 5;
|
|
48862
|
+
}
|
|
48737
48863
|
function getTypeAliasInfo(type) {
|
|
48738
48864
|
var _a, _b;
|
|
48739
48865
|
if ((_a = type.props) == null ? void 0 : _a.typeAliasInfo) {
|
|
@@ -48881,15 +49007,15 @@ var require_types = __commonJS({
|
|
|
48881
49007
|
if (type1.priv.specializedTypes && type1.priv.specializedTypes.returnType) {
|
|
48882
49008
|
return1Type = type1.priv.specializedTypes.returnType;
|
|
48883
49009
|
}
|
|
48884
|
-
if (!return1Type && type1.
|
|
48885
|
-
return1Type = (_e = type1.
|
|
49010
|
+
if (!return1Type && type1.shared.inferredReturnType) {
|
|
49011
|
+
return1Type = (_e = type1.shared.inferredReturnType) == null ? void 0 : _e.type;
|
|
48886
49012
|
}
|
|
48887
49013
|
let return2Type = functionType2.shared.declaredReturnType;
|
|
48888
49014
|
if (functionType2.priv.specializedTypes && functionType2.priv.specializedTypes.returnType) {
|
|
48889
49015
|
return2Type = functionType2.priv.specializedTypes.returnType;
|
|
48890
49016
|
}
|
|
48891
|
-
if (!return2Type && functionType2.
|
|
48892
|
-
return2Type = (_f = functionType2.
|
|
49017
|
+
if (!return2Type && functionType2.shared.inferredReturnType) {
|
|
49018
|
+
return2Type = (_f = functionType2.shared.inferredReturnType) == null ? void 0 : _f.type;
|
|
48893
49019
|
}
|
|
48894
49020
|
if (return1Type || return2Type) {
|
|
48895
49021
|
if (!return1Type || !return2Type || !isTypeSame(return1Type, return2Type, { ...options, ignoreTypeFlags: false }, recursionCount)) {
|
|
@@ -49422,7 +49548,7 @@ var require_typeWalker = __commonJS({
|
|
|
49422
49548
|
}
|
|
49423
49549
|
}
|
|
49424
49550
|
if (!this._isWalkCanceled && !types_1.FunctionType.isParamSpecValue(type) && !types_1.FunctionType.isParamSpecValue(type)) {
|
|
49425
|
-
const returnType = type.shared.declaredReturnType ?? ((_a = type.
|
|
49551
|
+
const returnType = type.shared.declaredReturnType ?? ((_a = type.shared.inferredReturnType) == null ? void 0 : _a.type);
|
|
49426
49552
|
if (returnType) {
|
|
49427
49553
|
this.walk(returnType);
|
|
49428
49554
|
}
|
|
@@ -50135,7 +50261,10 @@ var require_typeUtils = __commonJS({
|
|
|
50135
50261
|
if (type === typeAliasPlaceholder) {
|
|
50136
50262
|
return true;
|
|
50137
50263
|
}
|
|
50138
|
-
|
|
50264
|
+
if (!(0, types_1.isUnbound)(type) && !isTypeAliasPlaceholder(type)) {
|
|
50265
|
+
return false;
|
|
50266
|
+
}
|
|
50267
|
+
return ((_a = type.props) == null ? void 0 : _a.typeAliasInfo) && type.props.typeAliasInfo.shared.name === ((_b = typeAliasPlaceholder.shared.recursiveAlias) == null ? void 0 : _b.name);
|
|
50139
50268
|
}
|
|
50140
50269
|
return (0, types_1.findSubtype)(type, (subtype) => (0, types_1.isTypeVar)(subtype) && subtype.shared === typeAliasPlaceholder.shared) !== void 0;
|
|
50141
50270
|
}
|
|
@@ -50384,7 +50513,7 @@ var require_typeUtils = __commonJS({
|
|
|
50384
50513
|
return (0, types_1.isClassInstance)(type) && types_1.ClassType.isPropertyClass(type);
|
|
50385
50514
|
}
|
|
50386
50515
|
function isCallableType(type) {
|
|
50387
|
-
if ((0, types_1.
|
|
50516
|
+
if ((0, types_1.isFunctionOrOverloaded)(type) || (0, types_1.isAnyOrUnknown)(type)) {
|
|
50388
50517
|
return true;
|
|
50389
50518
|
}
|
|
50390
50519
|
if (isEffectivelyInstantiable(type)) {
|
|
@@ -51531,8 +51660,8 @@ var require_typeUtils = __commonJS({
|
|
|
51531
51660
|
if (requiresSpecialization(declaredReturnType, options, recursionCount)) {
|
|
51532
51661
|
return true;
|
|
51533
51662
|
}
|
|
51534
|
-
} else if (type.
|
|
51535
|
-
if (requiresSpecialization((_b = type.
|
|
51663
|
+
} else if (type.shared.inferredReturnType) {
|
|
51664
|
+
if (requiresSpecialization((_b = type.shared.inferredReturnType) == null ? void 0 : _b.type, options, recursionCount)) {
|
|
51536
51665
|
return true;
|
|
51537
51666
|
}
|
|
51538
51667
|
}
|
|
@@ -52114,9 +52243,10 @@ var require_typeUtils = __commonJS({
|
|
|
52114
52243
|
}
|
|
52115
52244
|
}
|
|
52116
52245
|
let specializedInferredReturnType;
|
|
52117
|
-
if (functionType.
|
|
52118
|
-
specializedInferredReturnType = this.apply((_a = functionType.
|
|
52119
|
-
if (specializedInferredReturnType !== ((_b = functionType.
|
|
52246
|
+
if (functionType.shared.inferredReturnType) {
|
|
52247
|
+
specializedInferredReturnType = this.apply((_a = functionType.shared.inferredReturnType) == null ? void 0 : _a.type, recursionCount);
|
|
52248
|
+
if (specializedInferredReturnType !== ((_b = functionType.shared.inferredReturnType) == null ? void 0 : _b.type)) {
|
|
52249
|
+
specializedParams.returnType = specializedInferredReturnType;
|
|
52120
52250
|
typesRequiredSpecialization = true;
|
|
52121
52251
|
}
|
|
52122
52252
|
}
|
|
@@ -52131,7 +52261,7 @@ var require_typeUtils = __commonJS({
|
|
|
52131
52261
|
);
|
|
52132
52262
|
}
|
|
52133
52263
|
}
|
|
52134
|
-
if (functionType.priv.strippedFirstParamType) {
|
|
52264
|
+
if (functionType.priv.strippedFirstParamType && !(0, types_1.isAnyOrUnknown)(functionType.priv.strippedFirstParamType)) {
|
|
52135
52265
|
const newStrippedType = this.apply(functionType.priv.strippedFirstParamType, recursionCount);
|
|
52136
52266
|
if (newStrippedType !== functionType.priv.strippedFirstParamType) {
|
|
52137
52267
|
functionType = types_1.TypeBase.cloneType(functionType);
|
|
@@ -52145,7 +52275,7 @@ var require_typeUtils = __commonJS({
|
|
|
52145
52275
|
specializedParams.parameterDefaultTypes = specializedDefaultArgs;
|
|
52146
52276
|
}
|
|
52147
52277
|
if (!variadicTypesToUnpack) {
|
|
52148
|
-
return types_1.FunctionType.specialize(functionType, specializedParams
|
|
52278
|
+
return types_1.FunctionType.specialize(functionType, specializedParams);
|
|
52149
52279
|
}
|
|
52150
52280
|
const newFunctionType = types_1.TypeBase.isInstantiable(functionType) ? types_1.FunctionType.createInstantiable(
|
|
52151
52281
|
functionType.shared.flags | 64
|
|
@@ -52238,7 +52368,7 @@ var require_typeUtils = __commonJS({
|
|
|
52238
52368
|
}
|
|
52239
52369
|
});
|
|
52240
52370
|
updatedSourceType = applySolvedTypeVars(sourceType, solution);
|
|
52241
|
-
(0, debug_1.assert)((0, types_1.
|
|
52371
|
+
(0, debug_1.assert)((0, types_1.isFunctionOrOverloaded)(updatedSourceType));
|
|
52242
52372
|
}
|
|
52243
52373
|
}
|
|
52244
52374
|
this._signatureTracker.addSignature(sourceType, this._expressionOffset);
|
|
@@ -54543,7 +54673,7 @@ var require_constraintSolver = __commonJS({
|
|
|
54543
54673
|
}
|
|
54544
54674
|
if (destType.shared.boundType) {
|
|
54545
54675
|
const updatedType = newLowerBound || newUpperBound;
|
|
54546
|
-
if (types_1.TypeBase.isInstantiable(destType) && !(0, typeUtils_1.isEffectivelyInstantiable)(srcType)) {
|
|
54676
|
+
if (types_1.TypeBase.isInstantiable(destType) && !(0, typeUtils_1.isEffectivelyInstantiable)(srcType, { honorTypeVarBounds: true })) {
|
|
54547
54677
|
return false;
|
|
54548
54678
|
}
|
|
54549
54679
|
const effectiveConstraints = types_1.TypeVarType.isSelf(destType) ? constraints : void 0;
|
|
@@ -54868,11 +54998,12 @@ var require_parameterUtils = __commonJS({
|
|
|
54868
54998
|
"node_modules/@zzzen/pyright-internal/dist/analyzer/parameterUtils.js"(exports2) {
|
|
54869
54999
|
"use strict";
|
|
54870
55000
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
54871
|
-
exports2.ParamKind = void 0;
|
|
55001
|
+
exports2.ParamAssignmentTracker = exports2.ParamKind = void 0;
|
|
54872
55002
|
exports2.isTypedKwargs = isTypedKwargs;
|
|
54873
55003
|
exports2.getParamListDetails = getParamListDetails;
|
|
54874
55004
|
exports2.isParamSpecArgs = isParamSpecArgs;
|
|
54875
55005
|
exports2.isParamSpecKwargs = isParamSpecKwargs;
|
|
55006
|
+
var debug_1 = require_debug();
|
|
54876
55007
|
var symbolNameUtils_1 = require_symbolNameUtils();
|
|
54877
55008
|
var types_1 = require_types();
|
|
54878
55009
|
var typeUtils_1 = require_typeUtils();
|
|
@@ -55044,7 +55175,7 @@ var require_parameterUtils = __commonJS({
|
|
|
55044
55175
|
}
|
|
55045
55176
|
});
|
|
55046
55177
|
result.paramSpec = types_1.FunctionType.getParamSpecFromArgsKwargs(type);
|
|
55047
|
-
result.firstPositionOrKeywordIndex = result.params.findIndex((p) => p.kind !== ParamKind.Positional);
|
|
55178
|
+
result.firstPositionOrKeywordIndex = result.params.findIndex((p) => p.kind !== ParamKind.Positional && p.kind !== ParamKind.ExpandedArgs);
|
|
55048
55179
|
if (result.firstPositionOrKeywordIndex < 0) {
|
|
55049
55180
|
result.firstPositionOrKeywordIndex = result.params.length;
|
|
55050
55181
|
}
|
|
@@ -55082,6 +55213,60 @@ var require_parameterUtils = __commonJS({
|
|
|
55082
55213
|
});
|
|
55083
55214
|
return isCompatible;
|
|
55084
55215
|
}
|
|
55216
|
+
var ParamAssignmentTracker = class {
|
|
55217
|
+
constructor(paramInfos) {
|
|
55218
|
+
this.params = paramInfos.map((p) => {
|
|
55219
|
+
const argsNeeded = !!p.defaultType || p.param.category !== 0 ? 0 : 1;
|
|
55220
|
+
return { paramDetails: p, argsNeeded, argsReceived: 0 };
|
|
55221
|
+
});
|
|
55222
|
+
}
|
|
55223
|
+
// Add a virtual keyword parameter for a keyword argument that
|
|
55224
|
+
// targets a **kwargs parameter. This allows us to detect duplicate
|
|
55225
|
+
// keyword arguments.
|
|
55226
|
+
addKeywordParam(name, info) {
|
|
55227
|
+
this.params.push({
|
|
55228
|
+
paramDetails: info,
|
|
55229
|
+
keywordName: name,
|
|
55230
|
+
argsNeeded: 1,
|
|
55231
|
+
argsReceived: 1
|
|
55232
|
+
});
|
|
55233
|
+
}
|
|
55234
|
+
lookupName(name) {
|
|
55235
|
+
return this.params.find((p) => {
|
|
55236
|
+
const kind = p.paramDetails.kind;
|
|
55237
|
+
if (kind === ParamKind.Positional || kind === ParamKind.ExpandedArgs) {
|
|
55238
|
+
return false;
|
|
55239
|
+
}
|
|
55240
|
+
const effectiveName = p.keywordName ?? p.paramDetails.param.name;
|
|
55241
|
+
return effectiveName === name;
|
|
55242
|
+
});
|
|
55243
|
+
}
|
|
55244
|
+
lookupDetails(paramInfo) {
|
|
55245
|
+
const info = this.params.find((p) => p.paramDetails === paramInfo);
|
|
55246
|
+
(0, debug_1.assert)(info !== void 0);
|
|
55247
|
+
return info;
|
|
55248
|
+
}
|
|
55249
|
+
markArgReceived(paramInfo) {
|
|
55250
|
+
const entry = this.lookupDetails(paramInfo);
|
|
55251
|
+
entry.argsReceived++;
|
|
55252
|
+
}
|
|
55253
|
+
// Returns a list of params that have not received their
|
|
55254
|
+
// required number of arguments.
|
|
55255
|
+
getUnassignedParams() {
|
|
55256
|
+
const unassignedParams = [];
|
|
55257
|
+
this.params.forEach((p) => {
|
|
55258
|
+
if (!p.paramDetails.param.name) {
|
|
55259
|
+
return;
|
|
55260
|
+
}
|
|
55261
|
+
if (p.argsReceived >= p.argsNeeded) {
|
|
55262
|
+
return;
|
|
55263
|
+
}
|
|
55264
|
+
unassignedParams.push(p.paramDetails.param.name);
|
|
55265
|
+
});
|
|
55266
|
+
return unassignedParams;
|
|
55267
|
+
}
|
|
55268
|
+
};
|
|
55269
|
+
exports2.ParamAssignmentTracker = ParamAssignmentTracker;
|
|
55085
55270
|
}
|
|
55086
55271
|
});
|
|
55087
55272
|
|
|
@@ -56521,7 +56706,7 @@ var require_constructorTransform = __commonJS({
|
|
|
56521
56706
|
newParamList.forEach((param) => {
|
|
56522
56707
|
types_1.FunctionType.addParam(newCallMemberType, param);
|
|
56523
56708
|
});
|
|
56524
|
-
newCallMemberType.shared.declaredReturnType = specializedFunctionType.shared.declaredReturnType ? types_1.FunctionType.getEffectiveReturnType(specializedFunctionType) : (_a = specializedFunctionType.
|
|
56709
|
+
newCallMemberType.shared.declaredReturnType = specializedFunctionType.shared.declaredReturnType ? types_1.FunctionType.getEffectiveReturnType(specializedFunctionType) : (_a = specializedFunctionType.shared.inferredReturnType) == null ? void 0 : _a.type;
|
|
56525
56710
|
newCallMemberType.shared.declaration = partialCallMemberType.shared.declaration;
|
|
56526
56711
|
newCallMemberType.shared.typeVarScopeId = specializedFunctionType.shared.typeVarScopeId;
|
|
56527
56712
|
return { returnType: newCallMemberType, isTypeIncomplete: false, argumentErrors };
|
|
@@ -56829,7 +57014,7 @@ var require_constructors = __commonJS({
|
|
|
56829
57014
|
0
|
|
56830
57015
|
/* MemberAccessFlags.Default */
|
|
56831
57016
|
)) == null ? void 0 : _a.type;
|
|
56832
|
-
if (!newMethodType || !(0, types_1.
|
|
57017
|
+
if (!newMethodType || !(0, types_1.isFunctionOrOverloaded)(newMethodType)) {
|
|
56833
57018
|
return { returnType: (0, typeUtils_1.convertToInstance)(type) };
|
|
56834
57019
|
}
|
|
56835
57020
|
return validateNewMethod(
|
|
@@ -56968,7 +57153,7 @@ var require_constructors = __commonJS({
|
|
|
56968
57153
|
return void 0;
|
|
56969
57154
|
}
|
|
56970
57155
|
const callType = evaluator.getTypeOfMember(callInfo);
|
|
56971
|
-
if (!(0, types_1.
|
|
57156
|
+
if (!(0, types_1.isFunctionOrOverloaded)(callType)) {
|
|
56972
57157
|
return void 0;
|
|
56973
57158
|
}
|
|
56974
57159
|
const boundCallType = evaluator.bindFunctionToClassOrObject(
|
|
@@ -57185,7 +57370,7 @@ var require_constructors = __commonJS({
|
|
|
57185
57370
|
return skipInitCheck;
|
|
57186
57371
|
}
|
|
57187
57372
|
function isDefaultNewMethod(newMethod) {
|
|
57188
|
-
var _a;
|
|
57373
|
+
var _a, _b;
|
|
57189
57374
|
if (!newMethod || !(0, types_1.isFunction)(newMethod)) {
|
|
57190
57375
|
return false;
|
|
57191
57376
|
}
|
|
@@ -57196,7 +57381,12 @@ var require_constructors = __commonJS({
|
|
|
57196
57381
|
if (params[0].category !== 1 || params[1].category !== 2) {
|
|
57197
57382
|
return false;
|
|
57198
57383
|
}
|
|
57199
|
-
|
|
57384
|
+
let returnType;
|
|
57385
|
+
if (newMethod.shared.declaredReturnType) {
|
|
57386
|
+
returnType = newMethod.shared.declaredReturnType;
|
|
57387
|
+
} else {
|
|
57388
|
+
returnType = ((_a = newMethod.priv.specializedTypes) == null ? void 0 : _a.returnType) ?? ((_b = newMethod.shared.inferredReturnType) == null ? void 0 : _b.type);
|
|
57389
|
+
}
|
|
57200
57390
|
if (!returnType || !(0, types_1.isTypeVar)(returnType) || !types_1.TypeVarType.isSelf(returnType)) {
|
|
57201
57391
|
return false;
|
|
57202
57392
|
}
|
|
@@ -57346,6 +57536,10 @@ var require_namedTuples = __commonJS({
|
|
|
57346
57536
|
entries.forEach((entryName, index) => {
|
|
57347
57537
|
entryName = entryName.trim();
|
|
57348
57538
|
if (entryName) {
|
|
57539
|
+
if (entryName.startsWith("_")) {
|
|
57540
|
+
evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.namedTupleFieldUnderscore(), entriesArg.valueExpression);
|
|
57541
|
+
return;
|
|
57542
|
+
}
|
|
57349
57543
|
entryName = renameKeyword(evaluator, entryName, allowRename, entriesArg.valueExpression, index);
|
|
57350
57544
|
const entryType = types_1.UnknownType.create();
|
|
57351
57545
|
const paramInfo = types_1.FunctionParam.create(0, entryType, types_1.FunctionParamFlags.TypeDeclared, entryName, index >= firstParamWithDefaultIndex ? entryType : void 0);
|
|
@@ -57396,6 +57590,10 @@ var require_namedTuples = __commonJS({
|
|
|
57396
57590
|
if (!entryName) {
|
|
57397
57591
|
evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.namedTupleEmptyName(), entryNameNode);
|
|
57398
57592
|
} else {
|
|
57593
|
+
if (entryName.startsWith("_")) {
|
|
57594
|
+
evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.namedTupleFieldUnderscore(), entryNameNode);
|
|
57595
|
+
return;
|
|
57596
|
+
}
|
|
57399
57597
|
entryName = renameKeyword(evaluator, entryName, allowRename, entryNameNode, index);
|
|
57400
57598
|
}
|
|
57401
57599
|
} else {
|
|
@@ -57715,7 +57913,7 @@ var require_dataClasses = __commonJS({
|
|
|
57715
57913
|
}
|
|
57716
57914
|
hasDefault = true;
|
|
57717
57915
|
defaultExpr = statement.d.rightExpr;
|
|
57718
|
-
if (statement.d.rightExpr.nodeType === 9) {
|
|
57916
|
+
if (!isNamedTuple && statement.d.rightExpr.nodeType === 9) {
|
|
57719
57917
|
const callTypeResult = evaluator.getTypeOfExpression(
|
|
57720
57918
|
statement.d.rightExpr.d.leftExpr,
|
|
57721
57919
|
2
|
|
@@ -57804,6 +58002,10 @@ var require_dataClasses = __commonJS({
|
|
|
57804
58002
|
}
|
|
57805
58003
|
if (variableNameNode && variableTypeEvaluator) {
|
|
57806
58004
|
const variableName = variableNameNode.d.value;
|
|
58005
|
+
if (isNamedTuple && variableName.startsWith("_")) {
|
|
58006
|
+
evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.namedTupleFieldUnderscore(), variableNameNode);
|
|
58007
|
+
return;
|
|
58008
|
+
}
|
|
57807
58009
|
const variableSymbol = types_1.ClassType.getSymbolTable(classType).get(variableName);
|
|
57808
58010
|
namedTupleEntries.add(variableName);
|
|
57809
58011
|
if (variableSymbol == null ? void 0 : variableSymbol.isClassVar()) {
|
|
@@ -57885,7 +58087,7 @@ var require_dataClasses = __commonJS({
|
|
|
57885
58087
|
if (!statement || statement.nodeType !== 3) {
|
|
57886
58088
|
return;
|
|
57887
58089
|
}
|
|
57888
|
-
if (statement.d.rightExpr.nodeType === 9) {
|
|
58090
|
+
if (!isNamedTuple && statement.d.rightExpr.nodeType === 9) {
|
|
57889
58091
|
const callType = evaluator.getTypeOfExpression(
|
|
57890
58092
|
statement.d.rightExpr.d.leftExpr,
|
|
57891
58093
|
2
|
|
@@ -58105,7 +58307,7 @@ var require_dataClasses = __commonJS({
|
|
|
58105
58307
|
targetFunction.shared.declaredReturnType = fieldType;
|
|
58106
58308
|
types_1.FunctionType.addParam(targetFunction, types_1.FunctionParam.create(0, typeVar, types_1.FunctionParamFlags.TypeDeclared | types_1.FunctionParamFlags.NameSynthesized, "__input"));
|
|
58107
58309
|
types_1.FunctionType.addPositionOnlyParamSeparator(targetFunction);
|
|
58108
|
-
if ((0, types_1.
|
|
58310
|
+
if ((0, types_1.isFunctionOrOverloaded)(converterType)) {
|
|
58109
58311
|
const acceptedTypes = [];
|
|
58110
58312
|
const diagAddendum = new diagnostic_1.DiagnosticAddendum();
|
|
58111
58313
|
(0, typeUtils_1.doForEachSignature)(converterType, (signature) => {
|
|
@@ -58151,7 +58353,7 @@ var require_dataClasses = __commonJS({
|
|
|
58151
58353
|
return fieldType;
|
|
58152
58354
|
}
|
|
58153
58355
|
function getConverterAsFunction(evaluator, converterType) {
|
|
58154
|
-
if ((0, types_1.
|
|
58356
|
+
if ((0, types_1.isFunctionOrOverloaded)(converterType)) {
|
|
58155
58357
|
return converterType;
|
|
58156
58358
|
}
|
|
58157
58359
|
if ((0, types_1.isClassInstance)(converterType)) {
|
|
@@ -58163,7 +58365,7 @@ var require_dataClasses = __commonJS({
|
|
|
58163
58365
|
if ((0, types_1.isUnion)(fromConstructor)) {
|
|
58164
58366
|
fromConstructor = fromConstructor.priv.subtypes[0];
|
|
58165
58367
|
}
|
|
58166
|
-
if ((0, types_1.
|
|
58368
|
+
if ((0, types_1.isFunctionOrOverloaded)(fromConstructor)) {
|
|
58167
58369
|
return fromConstructor;
|
|
58168
58370
|
}
|
|
58169
58371
|
}
|
|
@@ -58347,7 +58549,7 @@ var require_dataClasses = __commonJS({
|
|
|
58347
58549
|
case "field_descriptors":
|
|
58348
58550
|
case "field_specifiers": {
|
|
58349
58551
|
const valueType = evaluator.getTypeOfExpression(arg.d.valueExpr).type;
|
|
58350
|
-
if (!(0, types_1.isClassInstance)(valueType) || !types_1.ClassType.isBuiltIn(valueType, "tuple") || !valueType.priv.tupleTypeArgs || valueType.priv.tupleTypeArgs.some((entry) => !(0, types_1.isInstantiableClass)(entry.type) && !(0, types_1.
|
|
58552
|
+
if (!(0, types_1.isClassInstance)(valueType) || !types_1.ClassType.isBuiltIn(valueType, "tuple") || !valueType.priv.tupleTypeArgs || valueType.priv.tupleTypeArgs.some((entry) => !(0, types_1.isInstantiableClass)(entry.type) && !(0, types_1.isFunctionOrOverloaded)(entry.type))) {
|
|
58351
58553
|
evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.dataClassTransformFieldSpecifier().format({
|
|
58352
58554
|
type: evaluator.printType(valueType)
|
|
58353
58555
|
}), arg.d.valueExpr);
|
|
@@ -58935,12 +59137,12 @@ var require_typeGuards = __commonJS({
|
|
|
58935
59137
|
if (leftExpression.nodeType === 4) {
|
|
58936
59138
|
leftExpression = leftExpression.d.name;
|
|
58937
59139
|
}
|
|
58938
|
-
if (ParseTreeUtils.isMatchingExpression(reference, leftExpression)) {
|
|
59140
|
+
if (ParseTreeUtils.isMatchingExpression(reference, leftExpression, (ref, expr) => isNameSameScope(evaluator, ref, expr))) {
|
|
58939
59141
|
return (type) => {
|
|
58940
59142
|
return { type: narrowTypeForIsNone(evaluator, type, adjIsPositiveTest), isIncomplete: false };
|
|
58941
59143
|
};
|
|
58942
59144
|
}
|
|
58943
|
-
if (leftExpression.nodeType === 27 && ParseTreeUtils.isMatchingExpression(reference, leftExpression.d.leftExpr) && leftExpression.d.items.length === 1 && !leftExpression.d.trailingComma && leftExpression.d.items[0].d.argCategory === 0 && !leftExpression.d.items[0].d.name && leftExpression.d.items[0].d.valueExpr.nodeType === 40 && leftExpression.d.items[0].d.valueExpr.d.isInteger && !leftExpression.d.items[0].d.valueExpr.d.isImaginary) {
|
|
59145
|
+
if (leftExpression.nodeType === 27 && ParseTreeUtils.isMatchingExpression(reference, leftExpression.d.leftExpr, (ref, expr) => isNameSameScope(evaluator, ref, expr)) && leftExpression.d.items.length === 1 && !leftExpression.d.trailingComma && leftExpression.d.items[0].d.argCategory === 0 && !leftExpression.d.items[0].d.name && leftExpression.d.items[0].d.valueExpr.nodeType === 40 && leftExpression.d.items[0].d.valueExpr.d.isInteger && !leftExpression.d.items[0].d.valueExpr.d.isImaginary) {
|
|
58944
59146
|
const indexValue = leftExpression.d.items[0].d.valueExpr.d.value;
|
|
58945
59147
|
if (typeof indexValue === "number") {
|
|
58946
59148
|
return (type) => {
|
|
@@ -58957,7 +59159,7 @@ var require_typeGuards = __commonJS({
|
|
|
58957
59159
|
if (leftExpression.nodeType === 4) {
|
|
58958
59160
|
leftExpression = leftExpression.d.name;
|
|
58959
59161
|
}
|
|
58960
|
-
if (ParseTreeUtils.isMatchingExpression(reference, leftExpression)) {
|
|
59162
|
+
if (ParseTreeUtils.isMatchingExpression(reference, leftExpression, (ref, expr) => isNameSameScope(evaluator, ref, expr))) {
|
|
58961
59163
|
return (type) => {
|
|
58962
59164
|
return {
|
|
58963
59165
|
type: narrowTypeForIsEllipsis(evaluator, testExpression, type, adjIsPositiveTest),
|
|
@@ -58969,20 +59171,34 @@ var require_typeGuards = __commonJS({
|
|
|
58969
59171
|
if (testExpression.d.leftExpr.nodeType === 9) {
|
|
58970
59172
|
if (testExpression.d.leftExpr.d.args.length === 1 && testExpression.d.leftExpr.d.args[0].d.argCategory === 0) {
|
|
58971
59173
|
const arg0Expr = testExpression.d.leftExpr.d.args[0].d.valueExpr;
|
|
58972
|
-
if (ParseTreeUtils.isMatchingExpression(reference, arg0Expr)) {
|
|
59174
|
+
if (ParseTreeUtils.isMatchingExpression(reference, arg0Expr, (ref, expr) => isNameSameScope(evaluator, ref, expr))) {
|
|
58973
59175
|
const callType = evaluator.getTypeOfExpression(
|
|
58974
59176
|
testExpression.d.leftExpr.d.leftExpr,
|
|
58975
59177
|
2
|
|
58976
59178
|
/* EvalFlags.CallBaseDefaults */
|
|
58977
59179
|
).type;
|
|
58978
59180
|
if ((0, types_1.isInstantiableClass)(callType) && types_1.ClassType.isBuiltIn(callType, "type")) {
|
|
58979
|
-
const
|
|
58980
|
-
const
|
|
58981
|
-
|
|
59181
|
+
const rhsResult = evaluator.getTypeOfExpression(testExpression.d.rightExpr);
|
|
59182
|
+
const classTypes = [];
|
|
59183
|
+
let isClassType = true;
|
|
59184
|
+
evaluator.mapSubtypesExpandTypeVars(
|
|
59185
|
+
rhsResult.type,
|
|
59186
|
+
/* options */
|
|
59187
|
+
void 0,
|
|
59188
|
+
(expandedSubtype) => {
|
|
59189
|
+
if ((0, types_1.isInstantiableClass)(expandedSubtype)) {
|
|
59190
|
+
classTypes.push(expandedSubtype);
|
|
59191
|
+
} else {
|
|
59192
|
+
isClassType = false;
|
|
59193
|
+
}
|
|
59194
|
+
return void 0;
|
|
59195
|
+
}
|
|
59196
|
+
);
|
|
59197
|
+
if (isClassType && classTypes.length > 0) {
|
|
58982
59198
|
return (type) => {
|
|
58983
59199
|
return {
|
|
58984
|
-
type: narrowTypeForTypeIs(evaluator, type,
|
|
58985
|
-
isIncomplete: !!
|
|
59200
|
+
type: narrowTypeForTypeIs(evaluator, type, classTypes, adjIsPositiveTest),
|
|
59201
|
+
isIncomplete: !!rhsResult.isIncomplete
|
|
58986
59202
|
};
|
|
58987
59203
|
};
|
|
58988
59204
|
}
|
|
@@ -58991,7 +59207,7 @@ var require_typeGuards = __commonJS({
|
|
|
58991
59207
|
}
|
|
58992
59208
|
}
|
|
58993
59209
|
if (isOrIsNotOperator) {
|
|
58994
|
-
if (ParseTreeUtils.isMatchingExpression(reference, testExpression.d.leftExpr)) {
|
|
59210
|
+
if (ParseTreeUtils.isMatchingExpression(reference, testExpression.d.leftExpr, (ref, expr) => isNameSameScope(evaluator, ref, expr))) {
|
|
58995
59211
|
const rightTypeResult = evaluator.getTypeOfExpression(testExpression.d.rightExpr);
|
|
58996
59212
|
const rightType = rightTypeResult.type;
|
|
58997
59213
|
if ((0, types_1.isClassInstance)(rightType) && rightType.priv.literalValue !== void 0) {
|
|
@@ -59018,7 +59234,7 @@ var require_typeGuards = __commonJS({
|
|
|
59018
59234
|
};
|
|
59019
59235
|
}
|
|
59020
59236
|
}
|
|
59021
|
-
if (testExpression.d.leftExpr.nodeType === 27 && testExpression.d.leftExpr.d.items.length === 1 && !testExpression.d.leftExpr.d.trailingComma && testExpression.d.leftExpr.d.items[0].d.argCategory === 0 && ParseTreeUtils.isMatchingExpression(reference, testExpression.d.leftExpr.d.leftExpr)) {
|
|
59237
|
+
if (testExpression.d.leftExpr.nodeType === 27 && testExpression.d.leftExpr.d.items.length === 1 && !testExpression.d.leftExpr.d.trailingComma && testExpression.d.leftExpr.d.items[0].d.argCategory === 0 && ParseTreeUtils.isMatchingExpression(reference, testExpression.d.leftExpr.d.leftExpr, (ref, expr) => isNameSameScope(evaluator, ref, expr))) {
|
|
59022
59238
|
const indexTypeResult = evaluator.getTypeOfExpression(testExpression.d.leftExpr.d.items[0].d.valueExpr);
|
|
59023
59239
|
const indexType = indexTypeResult.type;
|
|
59024
59240
|
if ((0, types_1.isClassInstance)(indexType) && (0, typeUtils_1.isLiteralType)(indexType)) {
|
|
@@ -59057,7 +59273,7 @@ var require_typeGuards = __commonJS({
|
|
|
59057
59273
|
}
|
|
59058
59274
|
if (equalsOrNotEqualsOperator) {
|
|
59059
59275
|
const adjIsPositiveTest2 = testExpression.d.operator === 12 ? isPositiveTest : !isPositiveTest;
|
|
59060
|
-
if (ParseTreeUtils.isMatchingExpression(reference, testExpression.d.leftExpr)) {
|
|
59276
|
+
if (ParseTreeUtils.isMatchingExpression(reference, testExpression.d.leftExpr, (ref, expr) => isNameSameScope(evaluator, ref, expr))) {
|
|
59061
59277
|
const rightTypeResult = evaluator.getTypeOfExpression(testExpression.d.rightExpr);
|
|
59062
59278
|
const rightType = rightTypeResult.type;
|
|
59063
59279
|
if ((0, types_1.isClassInstance)(rightType) && rightType.priv.literalValue !== void 0) {
|
|
@@ -59076,7 +59292,7 @@ var require_typeGuards = __commonJS({
|
|
|
59076
59292
|
};
|
|
59077
59293
|
}
|
|
59078
59294
|
}
|
|
59079
|
-
if (testExpression.d.leftExpr.nodeType === 27 && testExpression.d.leftExpr.d.items.length === 1 && !testExpression.d.leftExpr.d.trailingComma && testExpression.d.leftExpr.d.items[0].d.argCategory === 0 && ParseTreeUtils.isMatchingExpression(reference, testExpression.d.leftExpr.d.leftExpr)) {
|
|
59295
|
+
if (testExpression.d.leftExpr.nodeType === 27 && testExpression.d.leftExpr.d.items.length === 1 && !testExpression.d.leftExpr.d.trailingComma && testExpression.d.leftExpr.d.items[0].d.argCategory === 0 && ParseTreeUtils.isMatchingExpression(reference, testExpression.d.leftExpr.d.leftExpr, (ref, expr) => isNameSameScope(evaluator, ref, expr))) {
|
|
59080
59296
|
const indexTypeResult = evaluator.getTypeOfExpression(testExpression.d.leftExpr.d.items[0].d.valueExpr);
|
|
59081
59297
|
const indexType = indexTypeResult.type;
|
|
59082
59298
|
if ((0, types_1.isClassInstance)(indexType) && (0, typeUtils_1.isLiteralType)(indexType)) {
|
|
@@ -59101,7 +59317,7 @@ var require_typeGuards = __commonJS({
|
|
|
59101
59317
|
}
|
|
59102
59318
|
}
|
|
59103
59319
|
}
|
|
59104
|
-
if (equalsOrNotEqualsOperator && testExpression.d.leftExpr.nodeType === 35 && ParseTreeUtils.isMatchingExpression(reference, testExpression.d.leftExpr.d.leftExpr)) {
|
|
59320
|
+
if (equalsOrNotEqualsOperator && testExpression.d.leftExpr.nodeType === 35 && ParseTreeUtils.isMatchingExpression(reference, testExpression.d.leftExpr.d.leftExpr, (ref, expr) => isNameSameScope(evaluator, ref, expr))) {
|
|
59105
59321
|
const rightTypeResult = evaluator.getTypeOfExpression(testExpression.d.rightExpr);
|
|
59106
59322
|
const rightType = rightTypeResult.type;
|
|
59107
59323
|
const memberName = testExpression.d.leftExpr.d.member;
|
|
@@ -59116,7 +59332,7 @@ var require_typeGuards = __commonJS({
|
|
|
59116
59332
|
}
|
|
59117
59333
|
}
|
|
59118
59334
|
}
|
|
59119
|
-
if (testExpression.d.leftExpr.nodeType === 35 && ParseTreeUtils.isMatchingExpression(reference, testExpression.d.leftExpr.d.leftExpr)) {
|
|
59335
|
+
if (testExpression.d.leftExpr.nodeType === 35 && ParseTreeUtils.isMatchingExpression(reference, testExpression.d.leftExpr.d.leftExpr, (ref, expr) => isNameSameScope(evaluator, ref, expr))) {
|
|
59120
59336
|
const rightTypeResult = evaluator.getTypeOfExpression(testExpression.d.rightExpr);
|
|
59121
59337
|
const rightType = rightTypeResult.type;
|
|
59122
59338
|
const memberName = testExpression.d.leftExpr.d.member;
|
|
@@ -59129,7 +59345,7 @@ var require_typeGuards = __commonJS({
|
|
|
59129
59345
|
};
|
|
59130
59346
|
}
|
|
59131
59347
|
}
|
|
59132
|
-
if (testExpression.d.leftExpr.nodeType === 35 && ParseTreeUtils.isMatchingExpression(reference, testExpression.d.leftExpr.d.leftExpr) && testExpression.d.rightExpr.nodeType === 14 && testExpression.d.rightExpr.d.constType === 26) {
|
|
59348
|
+
if (testExpression.d.leftExpr.nodeType === 35 && ParseTreeUtils.isMatchingExpression(reference, testExpression.d.leftExpr.d.leftExpr, (ref, expr) => isNameSameScope(evaluator, ref, expr)) && testExpression.d.rightExpr.nodeType === 14 && testExpression.d.rightExpr.d.constType === 26) {
|
|
59133
59349
|
const memberName = testExpression.d.leftExpr.d.member;
|
|
59134
59350
|
return (type) => {
|
|
59135
59351
|
return {
|
|
@@ -59141,7 +59357,7 @@ var require_typeGuards = __commonJS({
|
|
|
59141
59357
|
}
|
|
59142
59358
|
if (comparisonOperator && testExpression.d.leftExpr.nodeType === 9 && testExpression.d.leftExpr.d.args.length === 1) {
|
|
59143
59359
|
const arg0Expr = testExpression.d.leftExpr.d.args[0].d.valueExpr;
|
|
59144
|
-
if (ParseTreeUtils.isMatchingExpression(reference, arg0Expr)) {
|
|
59360
|
+
if (ParseTreeUtils.isMatchingExpression(reference, arg0Expr, (ref, expr) => isNameSameScope(evaluator, ref, expr))) {
|
|
59145
59361
|
const callTypeResult = evaluator.getTypeOfExpression(
|
|
59146
59362
|
testExpression.d.leftExpr.d.leftExpr,
|
|
59147
59363
|
2
|
|
@@ -59170,7 +59386,7 @@ var require_typeGuards = __commonJS({
|
|
|
59170
59386
|
}
|
|
59171
59387
|
}
|
|
59172
59388
|
if (testExpression.d.operator === 41 || testExpression.d.operator === 42) {
|
|
59173
|
-
if (ParseTreeUtils.isMatchingExpression(reference, testExpression.d.leftExpr)) {
|
|
59389
|
+
if (ParseTreeUtils.isMatchingExpression(reference, testExpression.d.leftExpr, (ref, expr) => isNameSameScope(evaluator, ref, expr))) {
|
|
59174
59390
|
const rightTypeResult = evaluator.getTypeOfExpression(testExpression.d.rightExpr);
|
|
59175
59391
|
const rightType = rightTypeResult.type;
|
|
59176
59392
|
const adjIsPositiveTest = testExpression.d.operator === 41 ? isPositiveTest : !isPositiveTest;
|
|
@@ -59181,7 +59397,7 @@ var require_typeGuards = __commonJS({
|
|
|
59181
59397
|
};
|
|
59182
59398
|
};
|
|
59183
59399
|
}
|
|
59184
|
-
if (ParseTreeUtils.isMatchingExpression(reference, testExpression.d.rightExpr)) {
|
|
59400
|
+
if (ParseTreeUtils.isMatchingExpression(reference, testExpression.d.rightExpr, (ref, expr) => isNameSameScope(evaluator, ref, expr))) {
|
|
59185
59401
|
const leftTypeResult = evaluator.getTypeOfExpression(testExpression.d.leftExpr);
|
|
59186
59402
|
const leftType = leftTypeResult.type;
|
|
59187
59403
|
if ((0, types_1.isClassInstance)(leftType) && types_1.ClassType.isBuiltIn(leftType, "str") && (0, typeUtils_1.isLiteralType)(leftType)) {
|
|
@@ -59200,7 +59416,7 @@ var require_typeGuards = __commonJS({
|
|
|
59200
59416
|
if (testExpression.d.args.length === 2) {
|
|
59201
59417
|
const arg0Expr = testExpression.d.args[0].d.valueExpr;
|
|
59202
59418
|
const arg1Expr = testExpression.d.args[1].d.valueExpr;
|
|
59203
|
-
if (ParseTreeUtils.isMatchingExpression(reference, arg0Expr)) {
|
|
59419
|
+
if (ParseTreeUtils.isMatchingExpression(reference, arg0Expr, (ref, expr) => isNameSameScope(evaluator, ref, expr))) {
|
|
59204
59420
|
const callTypeResult = evaluator.getTypeOfExpression(
|
|
59205
59421
|
testExpression.d.leftExpr,
|
|
59206
59422
|
2
|
|
@@ -59245,7 +59461,7 @@ var require_typeGuards = __commonJS({
|
|
|
59245
59461
|
}
|
|
59246
59462
|
}
|
|
59247
59463
|
if (testExpression.d.args.length === 1 && !testExpression.d.args[0].d.name) {
|
|
59248
|
-
if (ParseTreeUtils.isMatchingExpression(reference, testExpression.d.args[0].d.valueExpr)) {
|
|
59464
|
+
if (ParseTreeUtils.isMatchingExpression(reference, testExpression.d.args[0].d.valueExpr, (ref, expr) => isNameSameScope(evaluator, ref, expr))) {
|
|
59249
59465
|
const callTypeResult = evaluator.getTypeOfExpression(
|
|
59250
59466
|
testExpression.d.leftExpr,
|
|
59251
59467
|
2
|
|
@@ -59264,7 +59480,7 @@ var require_typeGuards = __commonJS({
|
|
|
59264
59480
|
}
|
|
59265
59481
|
if (testExpression.d.args.length >= 1) {
|
|
59266
59482
|
const arg0Expr = testExpression.d.args[0].d.valueExpr;
|
|
59267
|
-
if (ParseTreeUtils.isMatchingExpression(reference, arg0Expr)) {
|
|
59483
|
+
if (ParseTreeUtils.isMatchingExpression(reference, arg0Expr, (ref, expr) => isNameSameScope(evaluator, ref, expr))) {
|
|
59268
59484
|
let isPossiblyTypeGuard = false;
|
|
59269
59485
|
const isFunctionReturnTypeGuard = (type) => {
|
|
59270
59486
|
return type.shared.declaredReturnType && (0, types_1.isClassInstance)(type.shared.declaredReturnType) && types_1.ClassType.isBuiltIn(type.shared.declaredReturnType, ["TypeGuard", "TypeIs"]);
|
|
@@ -59300,7 +59516,7 @@ var require_typeGuards = __commonJS({
|
|
|
59300
59516
|
}
|
|
59301
59517
|
}
|
|
59302
59518
|
}
|
|
59303
|
-
if (ParseTreeUtils.isMatchingExpression(reference, testExpression)) {
|
|
59519
|
+
if (ParseTreeUtils.isMatchingExpression(reference, testExpression, (ref, expr) => isNameSameScope(evaluator, ref, expr))) {
|
|
59304
59520
|
return (type) => {
|
|
59305
59521
|
return {
|
|
59306
59522
|
type: narrowTypeForTruthiness(evaluator, type, isPositiveTest),
|
|
@@ -59895,8 +60111,23 @@ var require_typeGuards = __commonJS({
|
|
|
59895
60111
|
} else {
|
|
59896
60112
|
filteredTypes.push((0, typeUtils_1.convertToInstance)(filterType));
|
|
59897
60113
|
}
|
|
59898
|
-
} else
|
|
59899
|
-
|
|
60114
|
+
} else {
|
|
60115
|
+
const filterTypeInstance = (0, typeUtils_1.convertToInstance)(convertVarTypeToFree(concreteFilterType));
|
|
60116
|
+
if (evaluator.assignType(filterTypeInstance, varType)) {
|
|
60117
|
+
filteredTypes.push((0, typeUtils_1.convertToInstance)(varType));
|
|
60118
|
+
} else {
|
|
60119
|
+
if ((0, types_1.isClassInstance)(filterTypeInstance) && !types_1.ClassType.isFinal(filterTypeInstance)) {
|
|
60120
|
+
const gradualFunc = types_1.FunctionType.createSynthesizedInstance(
|
|
60121
|
+
"",
|
|
60122
|
+
32768
|
|
60123
|
+
/* FunctionTypeFlags.GradualCallableForm */
|
|
60124
|
+
);
|
|
60125
|
+
types_1.FunctionType.addDefaultParams(gradualFunc);
|
|
60126
|
+
if (!evaluator.assignType(gradualFunc, filterTypeInstance)) {
|
|
60127
|
+
filteredTypes.push((0, typeUtils_1.convertToInstance)(filterType));
|
|
60128
|
+
}
|
|
60129
|
+
}
|
|
60130
|
+
}
|
|
59900
60131
|
}
|
|
59901
60132
|
}
|
|
59902
60133
|
} else {
|
|
@@ -59953,7 +60184,7 @@ var require_typeGuards = __commonJS({
|
|
|
59953
60184
|
if ((0, types_1.isClass)(subtype)) {
|
|
59954
60185
|
return (0, types_1.combineTypes)(filterClassType(unexpandedSubtype, types_1.ClassType.cloneAsInstantiable(subtype), (0, typeUtils_1.getTypeCondition)(subtype), negativeFallback));
|
|
59955
60186
|
}
|
|
59956
|
-
if ((0, types_1.
|
|
60187
|
+
if ((0, types_1.isFunctionOrOverloaded)(subtype)) {
|
|
59957
60188
|
return (0, types_1.combineTypes)(filterFunctionType(subtype, unexpandedSubtype));
|
|
59958
60189
|
}
|
|
59959
60190
|
return isPositiveTest ? void 0 : negativeFallback;
|
|
@@ -60136,10 +60367,10 @@ var require_typeGuards = __commonJS({
|
|
|
60136
60367
|
if (!evaluator.isTypeComparable(elementSubtype, referenceSubtype)) {
|
|
60137
60368
|
return void 0;
|
|
60138
60369
|
}
|
|
60139
|
-
if ((0, types_1.isClassInstance)(elementSubtype) && ((0, typeUtils_1.
|
|
60370
|
+
if ((0, types_1.isClassInstance)(elementSubtype) && ((0, typeUtils_1.isLiteralLikeType)(elementSubtype) || (0, typeUtils_1.isNoneInstance)(elementSubtype)) && evaluator.assignType(referenceSubtype, elementSubtype)) {
|
|
60140
60371
|
return (0, typeUtils_1.stripTypeForm)((0, typeUtils_1.addConditionToType)(elementSubtype, (_a = referenceSubtype.props) == null ? void 0 : _a.condition));
|
|
60141
60372
|
}
|
|
60142
|
-
if ((0, types_1.isClassInstance)(referenceSubtype) && ((0, typeUtils_1.
|
|
60373
|
+
if ((0, types_1.isClassInstance)(referenceSubtype) && ((0, typeUtils_1.isLiteralLikeType)(referenceSubtype) || (0, typeUtils_1.isNoneInstance)(referenceSubtype)) && evaluator.assignType(elementSubtype, referenceSubtype)) {
|
|
60143
60374
|
return (0, typeUtils_1.stripTypeForm)((0, typeUtils_1.addConditionToType)(referenceSubtype, (_b = elementSubtype.props) == null ? void 0 : _b.condition));
|
|
60144
60375
|
}
|
|
60145
60376
|
if ((0, types_1.isInstantiableClass)(elementSubtype) && !elementSubtype.priv.includeSubclasses && evaluator.assignType(referenceSubtype, elementSubtype)) {
|
|
@@ -60311,37 +60542,48 @@ var require_typeGuards = __commonJS({
|
|
|
60311
60542
|
return subtype;
|
|
60312
60543
|
});
|
|
60313
60544
|
}
|
|
60314
|
-
function narrowTypeForTypeIs(evaluator, type,
|
|
60315
|
-
|
|
60316
|
-
type
|
|
60317
|
-
|
|
60318
|
-
|
|
60319
|
-
(
|
|
60320
|
-
|
|
60321
|
-
|
|
60322
|
-
|
|
60323
|
-
|
|
60324
|
-
|
|
60325
|
-
|
|
60326
|
-
|
|
60545
|
+
function narrowTypeForTypeIs(evaluator, type, classTypes, isPositiveTest) {
|
|
60546
|
+
if (!isPositiveTest && classTypes.length > 1) {
|
|
60547
|
+
return type;
|
|
60548
|
+
}
|
|
60549
|
+
const typesToCombine = classTypes.map((classType) => {
|
|
60550
|
+
return evaluator.mapSubtypesExpandTypeVars(
|
|
60551
|
+
type,
|
|
60552
|
+
/* options */
|
|
60553
|
+
void 0,
|
|
60554
|
+
(subtype, unexpandedSubtype) => {
|
|
60555
|
+
var _a, _b;
|
|
60556
|
+
if ((0, types_1.isClassInstance)(subtype)) {
|
|
60557
|
+
const matches = types_1.ClassType.isDerivedFrom(classType, types_1.ClassType.cloneAsInstantiable(subtype));
|
|
60558
|
+
if (isPositiveTest) {
|
|
60559
|
+
if (matches) {
|
|
60560
|
+
if (types_1.ClassType.isSameGenericClass(types_1.ClassType.cloneAsInstantiable(subtype), classType)) {
|
|
60561
|
+
return (0, typeUtils_1.addConditionToType)(subtype, (0, typeUtils_1.getTypeCondition)(classType));
|
|
60562
|
+
}
|
|
60563
|
+
return (0, typeUtils_1.addConditionToType)(types_1.ClassType.cloneAsInstance(classType), (_a = subtype.props) == null ? void 0 : _a.condition);
|
|
60564
|
+
}
|
|
60565
|
+
if (!classType.priv.includeSubclasses) {
|
|
60566
|
+
return void 0;
|
|
60567
|
+
}
|
|
60568
|
+
if (!(0, types_1.isTypeVar)(unexpandedSubtype) || !types_1.TypeVarType.isSelf(unexpandedSubtype)) {
|
|
60569
|
+
return (0, typeUtils_1.addConditionToType)(subtype, (_b = classType.props) == null ? void 0 : _b.condition);
|
|
60327
60570
|
}
|
|
60328
|
-
return (0, typeUtils_1.addConditionToType)(types_1.ClassType.cloneAsInstance(classType), (_a = subtype.props) == null ? void 0 : _a.condition);
|
|
60329
60571
|
}
|
|
60330
60572
|
if (!classType.priv.includeSubclasses) {
|
|
60331
|
-
|
|
60332
|
-
|
|
60333
|
-
|
|
60334
|
-
|
|
60335
|
-
return void 0;
|
|
60573
|
+
if (matches && types_1.ClassType.isFinal(subtype)) {
|
|
60574
|
+
return void 0;
|
|
60575
|
+
}
|
|
60576
|
+
return subtype;
|
|
60336
60577
|
}
|
|
60337
|
-
return subtype;
|
|
60338
60578
|
}
|
|
60339
|
-
|
|
60340
|
-
|
|
60579
|
+
if ((0, types_1.isAnyOrUnknown)(subtype)) {
|
|
60580
|
+
return isPositiveTest ? types_1.ClassType.cloneAsInstance((0, typeUtils_1.addConditionToType)(classType, (0, typeUtils_1.getTypeCondition)(subtype))) : subtype;
|
|
60581
|
+
}
|
|
60582
|
+
return unexpandedSubtype;
|
|
60341
60583
|
}
|
|
60342
|
-
|
|
60343
|
-
|
|
60344
|
-
);
|
|
60584
|
+
);
|
|
60585
|
+
});
|
|
60586
|
+
return (0, types_1.combineTypes)(typesToCombine);
|
|
60345
60587
|
}
|
|
60346
60588
|
function narrowTypeForClassComparison(evaluator, referenceType, classType, isPositiveTest) {
|
|
60347
60589
|
return (0, typeUtils_1.mapSubtypes)(referenceType, (subtype) => {
|
|
@@ -60410,24 +60652,29 @@ var require_typeGuards = __commonJS({
|
|
|
60410
60652
|
return literalType;
|
|
60411
60653
|
}
|
|
60412
60654
|
return subtype;
|
|
60413
|
-
}
|
|
60655
|
+
}
|
|
60656
|
+
if ((0, types_1.isClassInstance)(subtype) && types_1.ClassType.isSameGenericClass(literalType, subtype)) {
|
|
60414
60657
|
if (subtype.priv.literalValue !== void 0) {
|
|
60415
60658
|
const literalValueMatches = types_1.ClassType.isLiteralValueSame(subtype, literalType);
|
|
60416
60659
|
if (isPositiveTest) {
|
|
60417
60660
|
return literalValueMatches ? subtype : void 0;
|
|
60418
|
-
} else {
|
|
60419
|
-
const isEnumOrBool = types_1.ClassType.isEnumClass(literalType) || types_1.ClassType.isBuiltIn(literalType, "bool");
|
|
60420
|
-
return literalValueMatches && (isEnumOrBool || !isIsOperator) ? void 0 : subtype;
|
|
60421
60661
|
}
|
|
60422
|
-
|
|
60662
|
+
const isEnumOrBool = types_1.ClassType.isEnumClass(literalType) || types_1.ClassType.isBuiltIn(literalType, "bool");
|
|
60663
|
+
return literalValueMatches && (isEnumOrBool || !isIsOperator) ? void 0 : subtype;
|
|
60664
|
+
}
|
|
60665
|
+
if (isPositiveTest) {
|
|
60666
|
+
return literalType;
|
|
60667
|
+
}
|
|
60668
|
+
const allLiteralTypes = enumerateLiteralsForType(evaluator, subtype);
|
|
60669
|
+
if (allLiteralTypes && allLiteralTypes.length > 0) {
|
|
60670
|
+
return (0, types_1.combineTypes)(allLiteralTypes.filter((type) => !types_1.ClassType.isLiteralValueSame(type, literalType)));
|
|
60671
|
+
}
|
|
60672
|
+
return subtype;
|
|
60673
|
+
}
|
|
60674
|
+
if (isPositiveTest) {
|
|
60675
|
+
if ((0, types_1.isClassInstance)(subtype) && types_1.ClassType.isBuiltIn(subtype, "LiteralString")) {
|
|
60423
60676
|
return literalType;
|
|
60424
|
-
} else {
|
|
60425
|
-
const allLiteralTypes = enumerateLiteralsForType(evaluator, subtype);
|
|
60426
|
-
if (allLiteralTypes && allLiteralTypes.length > 0) {
|
|
60427
|
-
return (0, types_1.combineTypes)(allLiteralTypes.filter((type) => !types_1.ClassType.isLiteralValueSame(type, literalType)));
|
|
60428
|
-
}
|
|
60429
60677
|
}
|
|
60430
|
-
} else if (isPositiveTest) {
|
|
60431
60678
|
if (isIsOperator || (0, typeUtils_1.isNoneInstance)(subtype)) {
|
|
60432
60679
|
const isSubtype = evaluator.assignType(subtype, literalType);
|
|
60433
60680
|
return isSubtype ? literalType : void 0;
|
|
@@ -60471,6 +60718,29 @@ var require_typeGuards = __commonJS({
|
|
|
60471
60718
|
}
|
|
60472
60719
|
return void 0;
|
|
60473
60720
|
}
|
|
60721
|
+
function isNameSameScope(evaluator, reference, expression) {
|
|
60722
|
+
const refSymbol = evaluator.lookUpSymbolRecursive(
|
|
60723
|
+
reference,
|
|
60724
|
+
reference.d.value,
|
|
60725
|
+
/* honorCodeFlow */
|
|
60726
|
+
false
|
|
60727
|
+
);
|
|
60728
|
+
const exprSymbol = evaluator.lookUpSymbolRecursive(
|
|
60729
|
+
expression,
|
|
60730
|
+
expression.d.value,
|
|
60731
|
+
/* honorCodeFlow */
|
|
60732
|
+
false
|
|
60733
|
+
);
|
|
60734
|
+
if (!refSymbol || !exprSymbol) {
|
|
60735
|
+
return true;
|
|
60736
|
+
}
|
|
60737
|
+
const refScope = refSymbol.scope;
|
|
60738
|
+
const exprScope = exprSymbol.scope;
|
|
60739
|
+
if (refScope === exprScope) {
|
|
60740
|
+
return true;
|
|
60741
|
+
}
|
|
60742
|
+
return (0, scopeUtils_1.isScopeContainedWithin)(refScope, exprScope);
|
|
60743
|
+
}
|
|
60474
60744
|
}
|
|
60475
60745
|
});
|
|
60476
60746
|
|
|
@@ -60737,7 +61007,7 @@ var require_enums = __commonJS({
|
|
|
60737
61007
|
if ((0, symbolNameUtils_1.isPrivateName)(memberName)) {
|
|
60738
61008
|
return void 0;
|
|
60739
61009
|
}
|
|
60740
|
-
if (!(0, types_1.findSubtype)(valueType, (subtype) => !(0, types_1.
|
|
61010
|
+
if (!(0, types_1.findSubtype)(valueType, (subtype) => !(0, types_1.isFunctionOrOverloaded)(subtype))) {
|
|
60741
61011
|
return void 0;
|
|
60742
61012
|
}
|
|
60743
61013
|
if (!assignedType && ((_f = nameNode.parent) == null ? void 0 : _f.nodeType) === 3 && nameNode.parent.d.leftExpr === nameNode) {
|
|
@@ -61595,7 +61865,7 @@ var require_importResolver = __commonJS({
|
|
|
61595
61865
|
return result;
|
|
61596
61866
|
};
|
|
61597
61867
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
61598
|
-
exports2.ImportResolver = exports2.supportedFileExtensions = void 0;
|
|
61868
|
+
exports2.ImportResolver = exports2.supportedFileExtensions = exports2.supportedSourceFileExtensions = void 0;
|
|
61599
61869
|
exports2.createImportedModuleDescriptor = createImportedModuleDescriptor;
|
|
61600
61870
|
exports2.formatImportName = formatImportName;
|
|
61601
61871
|
exports2.getParentImportResolutionRoot = getParentImportResolutionRoot;
|
|
@@ -61606,7 +61876,6 @@ var require_importResolver = __commonJS({
|
|
|
61606
61876
|
var pathConsts_1 = require_pathConsts();
|
|
61607
61877
|
var pathUtils_1 = require_pathUtils();
|
|
61608
61878
|
var pythonVersion_1 = require_pythonVersion();
|
|
61609
|
-
var serviceKeys_1 = require_serviceKeys();
|
|
61610
61879
|
var StringUtils = __importStar(require_stringUtils());
|
|
61611
61880
|
var stringUtils_1 = require_stringUtils();
|
|
61612
61881
|
var uri_1 = require_uri();
|
|
@@ -61637,8 +61906,8 @@ var require_importResolver = __commonJS({
|
|
|
61637
61906
|
};
|
|
61638
61907
|
}
|
|
61639
61908
|
var supportedNativeLibExtensions = [".pyd", ".so", ".dylib"];
|
|
61640
|
-
|
|
61641
|
-
exports2.supportedFileExtensions = [...supportedSourceFileExtensions, ...supportedNativeLibExtensions];
|
|
61909
|
+
exports2.supportedSourceFileExtensions = [".py", ".pyi"];
|
|
61910
|
+
exports2.supportedFileExtensions = [...exports2.supportedSourceFileExtensions, ...supportedNativeLibExtensions];
|
|
61642
61911
|
var allowPartialResolutionForThirdPartyPackages = false;
|
|
61643
61912
|
var ImportResolver = class _ImportResolver {
|
|
61644
61913
|
constructor(serviceProvider, _configOptions, host) {
|
|
@@ -61659,11 +61928,11 @@ var require_importResolver = __commonJS({
|
|
|
61659
61928
|
return this.serviceProvider.tmp();
|
|
61660
61929
|
}
|
|
61661
61930
|
get partialStubs() {
|
|
61662
|
-
return this.serviceProvider.
|
|
61931
|
+
return this.serviceProvider.partialStubs();
|
|
61663
61932
|
}
|
|
61664
61933
|
static isSupportedImportSourceFile(uri) {
|
|
61665
61934
|
const fileExtension = uri.lastExtension.toLowerCase();
|
|
61666
|
-
return supportedSourceFileExtensions.some((ext2) => fileExtension === ext2);
|
|
61935
|
+
return exports2.supportedSourceFileExtensions.some((ext2) => fileExtension === ext2);
|
|
61667
61936
|
}
|
|
61668
61937
|
static isSupportedImportFile(uri) {
|
|
61669
61938
|
const fileExtension = uri.lastExtension.toLowerCase();
|
|
@@ -64878,11 +65147,7 @@ var require_properties = __commonJS({
|
|
|
64878
65147
|
propertyClass.priv.isAsymmetricDescriptor = false;
|
|
64879
65148
|
updateGetSetDelMethodForClonedProperty(evaluator, propertyObject);
|
|
64880
65149
|
propertyObject.priv.fgetInfo = {
|
|
64881
|
-
methodType:
|
|
64882
|
-
fget,
|
|
64883
|
-
fget.shared.flags | 4
|
|
64884
|
-
/* FunctionTypeFlags.StaticMethod */
|
|
64885
|
-
),
|
|
65150
|
+
methodType: fget,
|
|
64886
65151
|
classType: fget.shared.methodClass
|
|
64887
65152
|
};
|
|
64888
65153
|
if (types_1.FunctionType.isClassMethod(fget)) {
|
|
@@ -64938,11 +65203,7 @@ var require_properties = __commonJS({
|
|
|
64938
65203
|
});
|
|
64939
65204
|
updateGetSetDelMethodForClonedProperty(evaluator, propertyObject);
|
|
64940
65205
|
propertyObject.priv.fsetInfo = {
|
|
64941
|
-
methodType:
|
|
64942
|
-
fset,
|
|
64943
|
-
fset.shared.flags | 4
|
|
64944
|
-
/* FunctionTypeFlags.StaticMethod */
|
|
64945
|
-
),
|
|
65206
|
+
methodType: fset,
|
|
64946
65207
|
classType: fset.shared.methodClass
|
|
64947
65208
|
};
|
|
64948
65209
|
addSetMethodToPropertySymbolTable(evaluator, propertyObject, fset);
|
|
@@ -64972,11 +65233,7 @@ var require_properties = __commonJS({
|
|
|
64972
65233
|
});
|
|
64973
65234
|
updateGetSetDelMethodForClonedProperty(evaluator, propertyObject);
|
|
64974
65235
|
propertyObject.priv.fdelInfo = {
|
|
64975
|
-
methodType:
|
|
64976
|
-
fdel,
|
|
64977
|
-
fdel.shared.flags | 4
|
|
64978
|
-
/* FunctionTypeFlags.StaticMethod */
|
|
64979
|
-
),
|
|
65236
|
+
methodType: fdel,
|
|
64980
65237
|
classType: fdel.shared.methodClass
|
|
64981
65238
|
};
|
|
64982
65239
|
addDelMethodToPropertySymbolTable(evaluator, propertyObject, fdel);
|
|
@@ -65117,7 +65374,7 @@ var require_properties = __commonJS({
|
|
|
65117
65374
|
accessors.forEach((accessorInfo) => {
|
|
65118
65375
|
let destAccessType = accessorInfo.getFunction(destPropertyType);
|
|
65119
65376
|
if (destAccessType && (0, types_1.isFunction)(destAccessType)) {
|
|
65120
|
-
|
|
65377
|
+
const srcAccessType = accessorInfo.getFunction(srcPropertyType);
|
|
65121
65378
|
if (!srcAccessType || !(0, types_1.isFunction)(srcAccessType)) {
|
|
65122
65379
|
diag == null ? void 0 : diag.addMessage(accessorInfo.missingDiagMsg());
|
|
65123
65380
|
isAssignable = false;
|
|
@@ -65128,16 +65385,6 @@ var require_properties = __commonJS({
|
|
|
65128
65385
|
if (selfSolution) {
|
|
65129
65386
|
destAccessType = (0, typeUtils_1.applySolvedTypeVars)(destAccessType, selfSolution);
|
|
65130
65387
|
}
|
|
65131
|
-
destAccessType = types_1.FunctionType.cloneWithNewFlags(
|
|
65132
|
-
destAccessType,
|
|
65133
|
-
destAccessType.shared.flags & ~4
|
|
65134
|
-
/* FunctionTypeFlags.StaticMethod */
|
|
65135
|
-
);
|
|
65136
|
-
srcAccessType = types_1.FunctionType.cloneWithNewFlags(
|
|
65137
|
-
srcAccessType,
|
|
65138
|
-
srcAccessType.shared.flags & ~4
|
|
65139
|
-
/* FunctionTypeFlags.StaticMethod */
|
|
65140
|
-
);
|
|
65141
65388
|
const boundDestAccessType = evaluator.bindFunctionToClassOrObject(
|
|
65142
65389
|
destObjectToBind,
|
|
65143
65390
|
destAccessType,
|
|
@@ -65447,7 +65694,7 @@ var require_protocols = __commonJS({
|
|
|
65447
65694
|
} else {
|
|
65448
65695
|
srcMemberType = types_1.UnknownType.create();
|
|
65449
65696
|
}
|
|
65450
|
-
if ((0, types_1.
|
|
65697
|
+
if ((0, types_1.isFunctionOrOverloaded)(srcMemberType)) {
|
|
65451
65698
|
if (isMemberFromMetaclass || (0, types_1.isInstantiableClass)(srcMemberInfo.classType)) {
|
|
65452
65699
|
let isInstanceMember = !srcMemberInfo.symbol.isClassMember();
|
|
65453
65700
|
if (types_1.ClassType.isDataClass(srcType)) {
|
|
@@ -65492,7 +65739,7 @@ var require_protocols = __commonJS({
|
|
|
65492
65739
|
srcMemberType = evaluator.getEffectiveTypeOfSymbol(srcSymbol);
|
|
65493
65740
|
}
|
|
65494
65741
|
destMemberType = (0, typeUtils_1.applySolvedTypeVars)(destMemberType, selfSolution);
|
|
65495
|
-
if (!destSymbol.isInstanceMember() && (
|
|
65742
|
+
if (!destSymbol.isInstanceMember() && (0, types_1.isFunctionOrOverloaded)(destMemberType)) {
|
|
65496
65743
|
let boundDeclaredType;
|
|
65497
65744
|
isDestReadOnly = true;
|
|
65498
65745
|
if ((0, types_1.isClass)(srcType)) {
|
|
@@ -67213,7 +67460,7 @@ var require_codeFlowEngine = __commonJS({
|
|
|
67213
67460
|
}
|
|
67214
67461
|
const newMethodResult = (0, constructors_1.getBoundNewMethod)(evaluator2, node, callSubtype);
|
|
67215
67462
|
if (newMethodResult) {
|
|
67216
|
-
if ((0, types_1.
|
|
67463
|
+
if ((0, types_1.isFunctionOrOverloaded)(newMethodResult.type)) {
|
|
67217
67464
|
callSubtype = newMethodResult.type;
|
|
67218
67465
|
}
|
|
67219
67466
|
}
|
|
@@ -68424,7 +68671,7 @@ var require_operations = __commonJS({
|
|
|
68424
68671
|
}
|
|
68425
68672
|
if (!type) {
|
|
68426
68673
|
if (!isIncomplete) {
|
|
68427
|
-
if (inferenceContext) {
|
|
68674
|
+
if (inferenceContext && !(0, types_1.isAnyOrUnknown)(inferenceContext.expectedType)) {
|
|
68428
68675
|
evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportOperatorIssue, localize_1.LocMessage.typeNotSupportUnaryOperatorBidirectional().format({
|
|
68429
68676
|
operator: (0, parseTreeUtils_1.printOperator)(node.d.operator),
|
|
68430
68677
|
type: evaluator.printType(exprType),
|
|
@@ -68627,10 +68874,13 @@ var require_operations = __commonJS({
|
|
|
68627
68874
|
} else if (operator === 13) {
|
|
68628
68875
|
if (rightLiteralValue !== BigInt(0)) {
|
|
68629
68876
|
newValue = leftLiteralValue / rightLiteralValue;
|
|
68877
|
+
if (newValue * rightLiteralValue !== leftLiteralValue && leftLiteralValue < BigInt(0) !== rightLiteralValue < BigInt(0)) {
|
|
68878
|
+
newValue -= BigInt(1);
|
|
68879
|
+
}
|
|
68630
68880
|
}
|
|
68631
68881
|
} else if (operator === 24) {
|
|
68632
68882
|
if (rightLiteralValue !== BigInt(0)) {
|
|
68633
|
-
newValue = leftLiteralValue % rightLiteralValue;
|
|
68883
|
+
newValue = (leftLiteralValue % rightLiteralValue + rightLiteralValue) % rightLiteralValue;
|
|
68634
68884
|
}
|
|
68635
68885
|
} else if (operator === 29) {
|
|
68636
68886
|
if (rightLiteralValue >= BigInt(0)) {
|
|
@@ -68640,9 +68890,13 @@ var require_operations = __commonJS({
|
|
|
68640
68890
|
}
|
|
68641
68891
|
}
|
|
68642
68892
|
} else if (operator === 17) {
|
|
68643
|
-
|
|
68893
|
+
if (rightLiteralValue >= BigInt(0)) {
|
|
68894
|
+
newValue = leftLiteralValue << rightLiteralValue;
|
|
68895
|
+
}
|
|
68644
68896
|
} else if (operator === 31) {
|
|
68645
|
-
|
|
68897
|
+
if (rightLiteralValue >= BigInt(0)) {
|
|
68898
|
+
newValue = leftLiteralValue >> rightLiteralValue;
|
|
68899
|
+
}
|
|
68646
68900
|
} else if (operator === 3) {
|
|
68647
68901
|
newValue = leftLiteralValue & rightLiteralValue;
|
|
68648
68902
|
} else if (operator === 6) {
|
|
@@ -68698,7 +68952,7 @@ var require_operations = __commonJS({
|
|
|
68698
68952
|
return true;
|
|
68699
68953
|
}
|
|
68700
68954
|
function convertFunctionToObject(evaluator, type) {
|
|
68701
|
-
if ((0, types_1.
|
|
68955
|
+
if ((0, types_1.isFunctionOrOverloaded)(type)) {
|
|
68702
68956
|
return evaluator.getObjectType();
|
|
68703
68957
|
}
|
|
68704
68958
|
return type;
|
|
@@ -68813,7 +69067,7 @@ var require_operations = __commonJS({
|
|
|
68813
69067
|
}
|
|
68814
69068
|
}
|
|
68815
69069
|
if (!resultTypeResult) {
|
|
68816
|
-
if (inferenceContext) {
|
|
69070
|
+
if (inferenceContext && !(0, types_1.isAnyOrUnknown)(inferenceContext.expectedType)) {
|
|
68817
69071
|
diag.addMessage(localize_1.LocMessage.typeNotSupportBinaryOperatorBidirectional().format({
|
|
68818
69072
|
operator: (0, parseTreeUtils_1.printOperator)(operator),
|
|
68819
69073
|
leftType: evaluator.printType(leftSubtypeExpanded),
|
|
@@ -68980,6 +69234,8 @@ var require_tuples = __commonJS({
|
|
|
68980
69234
|
type = makeTupleObject(evaluator, evaluator.buildTupleTypesList(
|
|
68981
69235
|
entryTypeResults,
|
|
68982
69236
|
/* stripLiterals */
|
|
69237
|
+
false,
|
|
69238
|
+
/* convertModule */
|
|
68983
69239
|
false
|
|
68984
69240
|
));
|
|
68985
69241
|
}
|
|
@@ -68995,7 +69251,12 @@ var require_tuples = __commonJS({
|
|
|
68995
69251
|
if (node.d.items.length > maxInferredTupleEntryCount) {
|
|
68996
69252
|
return { type: makeTupleObject(evaluator, [{ type: types_1.UnknownType.create(), isUnbounded: true }]) };
|
|
68997
69253
|
}
|
|
68998
|
-
const type = makeTupleObject(evaluator, evaluator.buildTupleTypesList(
|
|
69254
|
+
const type = makeTupleObject(evaluator, evaluator.buildTupleTypesList(
|
|
69255
|
+
entryTypeResults,
|
|
69256
|
+
(flags & 268435456) !== 0,
|
|
69257
|
+
/* convertModule */
|
|
69258
|
+
true
|
|
69259
|
+
));
|
|
68999
69260
|
if (isIncomplete) {
|
|
69000
69261
|
if ((0, typeUtils_1.getContainerDepth)(type) > typeEvaluatorTypes_1.maxInferredContainerDepth) {
|
|
69001
69262
|
return { type: types_1.UnknownType.create() };
|
|
@@ -70390,6 +70651,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
70390
70651
|
exports2.createTypeEvaluator = createTypeEvaluator;
|
|
70391
70652
|
var cancellationUtils_1 = require_cancellationUtils();
|
|
70392
70653
|
var collectionUtils_1 = require_collectionUtils();
|
|
70654
|
+
var core_1 = require_core();
|
|
70393
70655
|
var debug_1 = require_debug();
|
|
70394
70656
|
var diagnostic_1 = require_diagnostic();
|
|
70395
70657
|
var diagnosticRules_1 = require_diagnosticRules();
|
|
@@ -70434,7 +70696,6 @@ var require_typeEvaluator = __commonJS({
|
|
|
70434
70696
|
var TypePrinter = __importStar(require_typePrinter());
|
|
70435
70697
|
var types_1 = require_types();
|
|
70436
70698
|
var typeUtils_1 = require_typeUtils();
|
|
70437
|
-
var core_1 = require_core();
|
|
70438
70699
|
var nonSubscriptableBuiltinTypes = /* @__PURE__ */ new Map([
|
|
70439
70700
|
["asyncio.futures.Future", pythonVersion_1.pythonVersion3_9],
|
|
70440
70701
|
["asyncio.tasks.Task", pythonVersion_1.pythonVersion3_9],
|
|
@@ -70463,6 +70724,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
70463
70724
|
var maxReturnCallSiteTypeInferenceCodeFlowComplexity = 8;
|
|
70464
70725
|
var maxCallSiteReturnTypeCacheSize = 8;
|
|
70465
70726
|
var maxEntriesToUseForInference = 64;
|
|
70727
|
+
var maxReturnTypeInferenceAttempts = 8;
|
|
70466
70728
|
var maxDeclarationsToUseForInference = 64;
|
|
70467
70729
|
var maxEffectiveTypeEvaluationAttempts = 16;
|
|
70468
70730
|
var maxTotalOverloadArgTypeExpansionCount = 256;
|
|
@@ -70487,7 +70749,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
70487
70749
|
let deferredClassCompletions = [];
|
|
70488
70750
|
let cancellationToken;
|
|
70489
70751
|
let printExpressionSpaceCount = 0;
|
|
70490
|
-
let
|
|
70752
|
+
let incompleteGenCount = 0;
|
|
70491
70753
|
const returnTypeInferenceContextStack = [];
|
|
70492
70754
|
let returnTypeInferenceTypeCache;
|
|
70493
70755
|
const signatureTrackerStack = [];
|
|
@@ -70537,7 +70799,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
70537
70799
|
if (!cacheEntry) {
|
|
70538
70800
|
return false;
|
|
70539
70801
|
}
|
|
70540
|
-
return !cacheEntry.typeResult.isIncomplete || cacheEntry.
|
|
70802
|
+
return !cacheEntry.typeResult.isIncomplete || cacheEntry.incompleteGenCount === incompleteGenCount;
|
|
70541
70803
|
}
|
|
70542
70804
|
function readTypeCache(node, flags) {
|
|
70543
70805
|
var _a;
|
|
@@ -70565,18 +70827,18 @@ var require_typeEvaluator = __commonJS({
|
|
|
70565
70827
|
function writeTypeCache(node, typeResult, flags, inferenceContext, allowSpeculativeCaching = false) {
|
|
70566
70828
|
const typeCacheToUse = returnTypeInferenceTypeCache && isNodeInReturnTypeInferenceContext(node) ? returnTypeInferenceTypeCache : typeCache;
|
|
70567
70829
|
if (!typeResult.isIncomplete) {
|
|
70568
|
-
|
|
70830
|
+
incompleteGenCount++;
|
|
70569
70831
|
} else {
|
|
70570
70832
|
const oldValue = typeCacheToUse.get(node.id);
|
|
70571
70833
|
if (oldValue !== void 0 && !(0, types_1.isTypeSame)(typeResult.type, oldValue.typeResult.type)) {
|
|
70572
|
-
|
|
70834
|
+
incompleteGenCount++;
|
|
70573
70835
|
}
|
|
70574
70836
|
}
|
|
70575
|
-
typeCacheToUse.set(node.id, { typeResult, flags,
|
|
70837
|
+
typeCacheToUse.set(node.id, { typeResult, flags, incompleteGenCount });
|
|
70576
70838
|
if (isSpeculativeModeInUse(node)) {
|
|
70577
70839
|
speculativeTypeTracker.trackEntry(typeCacheToUse, node.id);
|
|
70578
70840
|
if (allowSpeculativeCaching) {
|
|
70579
|
-
speculativeTypeTracker.addSpeculativeType(node, typeResult,
|
|
70841
|
+
speculativeTypeTracker.addSpeculativeType(node, typeResult, incompleteGenCount, inferenceContext == null ? void 0 : inferenceContext.expectedType);
|
|
70580
70842
|
}
|
|
70581
70843
|
}
|
|
70582
70844
|
}
|
|
@@ -70790,18 +71052,21 @@ var require_typeEvaluator = __commonJS({
|
|
|
70790
71052
|
}
|
|
70791
71053
|
function getTypeOfExpression(node, flags = 0, inferenceContext) {
|
|
70792
71054
|
const cacheEntry = readTypeCacheEntry(node);
|
|
70793
|
-
if (cacheEntry
|
|
70794
|
-
if (
|
|
70795
|
-
|
|
71055
|
+
if (cacheEntry) {
|
|
71056
|
+
if (!cacheEntry.typeResult.isIncomplete || cacheEntry.incompleteGenCount === incompleteGenCount) {
|
|
71057
|
+
if (printExpressionTypes) {
|
|
71058
|
+
console.log(`${getPrintExpressionTypesSpaces()}${ParseTreeUtils.printExpression(node)} (${getLineNum(node)}): Cached ${printType(cacheEntry.typeResult.type)} ${cacheEntry.typeResult.typeErrors ? " Errors" : ""}`);
|
|
71059
|
+
}
|
|
71060
|
+
return cacheEntry.typeResult;
|
|
70796
71061
|
}
|
|
70797
|
-
|
|
70798
|
-
|
|
70799
|
-
|
|
70800
|
-
if (
|
|
71062
|
+
}
|
|
71063
|
+
const specCacheEntry = speculativeTypeTracker.getSpeculativeType(node, inferenceContext == null ? void 0 : inferenceContext.expectedType);
|
|
71064
|
+
if (specCacheEntry) {
|
|
71065
|
+
if (!specCacheEntry.typeResult.isIncomplete || specCacheEntry.incompleteGenerationCount === incompleteGenCount) {
|
|
70801
71066
|
if (printExpressionTypes) {
|
|
70802
|
-
console.log(`${getPrintExpressionTypesSpaces()}${ParseTreeUtils.printExpression(node)} (${getLineNum(node)}): Speculative ${printType(
|
|
71067
|
+
console.log(`${getPrintExpressionTypesSpaces()}${ParseTreeUtils.printExpression(node)} (${getLineNum(node)}): Speculative ${printType(specCacheEntry.typeResult.type)}`);
|
|
70803
71068
|
}
|
|
70804
|
-
return
|
|
71069
|
+
return specCacheEntry.typeResult;
|
|
70805
71070
|
}
|
|
70806
71071
|
}
|
|
70807
71072
|
if (printExpressionTypes) {
|
|
@@ -71083,9 +71348,10 @@ var require_typeEvaluator = __commonJS({
|
|
|
71083
71348
|
false
|
|
71084
71349
|
) : void 0;
|
|
71085
71350
|
const exprTypeResult = getTypeOfExpression(node.d.expr, flags, (0, typeUtils_1.makeInferenceContext)(expectedType));
|
|
71351
|
+
const awaitableResult = getTypeOfAwaitable(exprTypeResult, node.d.expr);
|
|
71086
71352
|
const typeResult = {
|
|
71087
|
-
type:
|
|
71088
|
-
isIncomplete: exprTypeResult.isIncomplete,
|
|
71353
|
+
type: awaitableResult.type,
|
|
71354
|
+
isIncomplete: exprTypeResult.isIncomplete || awaitableResult.isIncomplete,
|
|
71089
71355
|
typeErrors: exprTypeResult.typeErrors
|
|
71090
71356
|
};
|
|
71091
71357
|
if (exprTypeResult.isIncomplete) {
|
|
@@ -71718,7 +71984,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
71718
71984
|
if (!boundMethodResult || boundMethodResult.typeErrors) {
|
|
71719
71985
|
return void 0;
|
|
71720
71986
|
}
|
|
71721
|
-
if ((0, types_1.
|
|
71987
|
+
if ((0, types_1.isFunctionOrOverloaded)(boundMethodResult.type)) {
|
|
71722
71988
|
return boundMethodResult.type;
|
|
71723
71989
|
}
|
|
71724
71990
|
if ((0, types_1.isClassInstance)(boundMethodResult.type)) {
|
|
@@ -71818,7 +72084,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
71818
72084
|
const constructorType = (0, constructors_1.createFunctionFromConstructor)(evaluatorInterface, subtype);
|
|
71819
72085
|
if (constructorType) {
|
|
71820
72086
|
(0, typeUtils_1.doForEachSubtype)(constructorType, (subtype2) => {
|
|
71821
|
-
if ((0, types_1.
|
|
72087
|
+
if ((0, types_1.isFunctionOrOverloaded)(subtype2)) {
|
|
71822
72088
|
addFunctionToSignature(subtype2);
|
|
71823
72089
|
}
|
|
71824
72090
|
});
|
|
@@ -71943,29 +72209,36 @@ var require_typeEvaluator = __commonJS({
|
|
|
71943
72209
|
).type;
|
|
71944
72210
|
const baseTypeConcrete = makeTopLevelTypeVarsConcrete(baseType);
|
|
71945
72211
|
let classMemberInfo;
|
|
71946
|
-
|
|
71947
|
-
|
|
71948
|
-
|
|
71949
|
-
|
|
71950
|
-
|
|
71951
|
-
|
|
71952
|
-
|
|
71953
|
-
|
|
71954
|
-
|
|
71955
|
-
|
|
71956
|
-
|
|
71957
|
-
|
|
71958
|
-
|
|
71959
|
-
|
|
71960
|
-
|
|
71961
|
-
|
|
71962
|
-
|
|
71963
|
-
|
|
71964
|
-
|
|
71965
|
-
|
|
71966
|
-
|
|
71967
|
-
|
|
71968
|
-
|
|
72212
|
+
(0, typeUtils_1.doForEachSubtype)(
|
|
72213
|
+
baseTypeConcrete,
|
|
72214
|
+
(baseSubtype) => {
|
|
72215
|
+
if ((0, types_1.isClassInstance)(baseSubtype)) {
|
|
72216
|
+
classMemberInfo = (0, typeUtils_1.lookUpObjectMember)(
|
|
72217
|
+
baseSubtype,
|
|
72218
|
+
expression.d.member.d.value,
|
|
72219
|
+
64
|
|
72220
|
+
/* MemberAccessFlags.DeclaredTypesOnly */
|
|
72221
|
+
);
|
|
72222
|
+
classOrObjectBase = baseSubtype;
|
|
72223
|
+
memberAccessClass = classMemberInfo == null ? void 0 : classMemberInfo.classType;
|
|
72224
|
+
if (classMemberInfo == null ? void 0 : classMemberInfo.isInstanceMember) {
|
|
72225
|
+
bindFunction = false;
|
|
72226
|
+
}
|
|
72227
|
+
useDescriptorSetterType = true;
|
|
72228
|
+
} else if ((0, types_1.isInstantiableClass)(baseSubtype)) {
|
|
72229
|
+
classMemberInfo = (0, typeUtils_1.lookUpClassMember)(
|
|
72230
|
+
baseSubtype,
|
|
72231
|
+
expression.d.member.d.value,
|
|
72232
|
+
16 | 64
|
|
72233
|
+
/* MemberAccessFlags.DeclaredTypesOnly */
|
|
72234
|
+
);
|
|
72235
|
+
classOrObjectBase = baseSubtype;
|
|
72236
|
+
memberAccessClass = classMemberInfo == null ? void 0 : classMemberInfo.classType;
|
|
72237
|
+
}
|
|
72238
|
+
},
|
|
72239
|
+
/* sortSubtypes */
|
|
72240
|
+
true
|
|
72241
|
+
);
|
|
71969
72242
|
if ((0, types_1.isTypeVar)(baseType)) {
|
|
71970
72243
|
selfType = baseType;
|
|
71971
72244
|
}
|
|
@@ -72032,7 +72305,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
72032
72305
|
if (memberAccessClass && (0, types_1.isInstantiableClass)(memberAccessClass)) {
|
|
72033
72306
|
declaredType = (0, typeUtils_1.partiallySpecializeType)(declaredType, memberAccessClass, getTypeClassType(), selfType);
|
|
72034
72307
|
}
|
|
72035
|
-
if ((0, types_1.
|
|
72308
|
+
if ((0, types_1.isFunctionOrOverloaded)(declaredType)) {
|
|
72036
72309
|
if (bindFunction) {
|
|
72037
72310
|
declaredType = bindFunctionToClassOrObject(
|
|
72038
72311
|
classOrObjectBase,
|
|
@@ -72051,12 +72324,13 @@ var require_typeEvaluator = __commonJS({
|
|
|
72051
72324
|
}
|
|
72052
72325
|
return void 0;
|
|
72053
72326
|
}
|
|
72054
|
-
function getTypeOfAwaitable(
|
|
72327
|
+
function getTypeOfAwaitable(typeResult, errorNode) {
|
|
72055
72328
|
if (!(prefetched == null ? void 0 : prefetched.awaitableClass) || !(0, types_1.isInstantiableClass)(prefetched.awaitableClass) || prefetched.awaitableClass.shared.typeParams.length !== 1) {
|
|
72056
|
-
return types_1.UnknownType.create();
|
|
72329
|
+
return { type: types_1.UnknownType.create(), isIncomplete: typeResult.isIncomplete };
|
|
72057
72330
|
}
|
|
72058
72331
|
const awaitableProtocolObj = types_1.ClassType.cloneAsInstance(prefetched.awaitableClass);
|
|
72059
|
-
|
|
72332
|
+
const isIncomplete = !!typeResult.isIncomplete;
|
|
72333
|
+
const type = (0, typeUtils_1.mapSubtypes)(typeResult.type, (subtype) => {
|
|
72060
72334
|
subtype = makeTopLevelTypeVarsConcrete(subtype);
|
|
72061
72335
|
if ((0, types_1.isAnyOrUnknown)(subtype)) {
|
|
72062
72336
|
return subtype;
|
|
@@ -72072,16 +72346,18 @@ var require_typeEvaluator = __commonJS({
|
|
|
72072
72346
|
return types_1.UnknownType.create();
|
|
72073
72347
|
}
|
|
72074
72348
|
}
|
|
72075
|
-
if (errorNode) {
|
|
72349
|
+
if (errorNode && !typeResult.isIncomplete) {
|
|
72076
72350
|
addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.typeNotAwaitable().format({ type: printType(subtype) }) + (diag == null ? void 0 : diag.getString()), errorNode);
|
|
72077
72351
|
}
|
|
72078
72352
|
return types_1.UnknownType.create();
|
|
72079
72353
|
});
|
|
72354
|
+
return { type, isIncomplete };
|
|
72080
72355
|
}
|
|
72081
72356
|
function getTypeOfIterator(typeResult, isAsync, errorNode, emitNotIterableError = true) {
|
|
72082
72357
|
const iterMethodName = isAsync ? "__aiter__" : "__iter__";
|
|
72083
72358
|
const nextMethodName = isAsync ? "__anext__" : "__next__";
|
|
72084
72359
|
let isValidIterator = true;
|
|
72360
|
+
let isIncomplete = typeResult.isIncomplete;
|
|
72085
72361
|
let type = (0, typeUtils_1.transformPossibleRecursiveTypeAlias)(typeResult.type);
|
|
72086
72362
|
type = makeTopLevelTypeVarsConcrete(type);
|
|
72087
72363
|
type = (0, types_1.removeUnbound)(type);
|
|
@@ -72142,7 +72418,11 @@ var require_typeEvaluator = __commonJS({
|
|
|
72142
72418
|
if (!isAsync) {
|
|
72143
72419
|
return nextReturnType;
|
|
72144
72420
|
}
|
|
72145
|
-
|
|
72421
|
+
const awaitableResult = getTypeOfAwaitable({ type: nextReturnType, isIncomplete: typeResult.isIncomplete }, errorNode);
|
|
72422
|
+
if (awaitableResult.isIncomplete) {
|
|
72423
|
+
isIncomplete = true;
|
|
72424
|
+
}
|
|
72425
|
+
return awaitableResult.type;
|
|
72146
72426
|
}
|
|
72147
72427
|
return void 0;
|
|
72148
72428
|
}
|
|
@@ -72153,13 +72433,13 @@ var require_typeEvaluator = __commonJS({
|
|
|
72153
72433
|
diag.addAddendum(iterReturnTypeDiag);
|
|
72154
72434
|
}
|
|
72155
72435
|
}
|
|
72156
|
-
if (!
|
|
72436
|
+
if (!isIncomplete && emitNotIterableError) {
|
|
72157
72437
|
addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.typeNotIterable().format({ type: printType(subtype) }) + diag.getString(), errorNode);
|
|
72158
72438
|
}
|
|
72159
72439
|
isValidIterator = false;
|
|
72160
72440
|
return void 0;
|
|
72161
72441
|
});
|
|
72162
|
-
return isValidIterator ? { type: iterableType, isIncomplete
|
|
72442
|
+
return isValidIterator ? { type: iterableType, isIncomplete } : void 0;
|
|
72163
72443
|
}
|
|
72164
72444
|
function getTypeOfIterable(typeResult, isAsync, errorNode, emitNotIterableError = true) {
|
|
72165
72445
|
const iterMethodName = isAsync ? "__aiter__" : "__iter__";
|
|
@@ -72519,7 +72799,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
72519
72799
|
}
|
|
72520
72800
|
destType = declaredType;
|
|
72521
72801
|
} else {
|
|
72522
|
-
destType = narrowTypeBasedOnAssignment(
|
|
72802
|
+
destType = narrowTypeBasedOnAssignment(declaredType, typeResult).type;
|
|
72523
72803
|
}
|
|
72524
72804
|
} else {
|
|
72525
72805
|
const scope = ScopeUtils.getScopeForNode(nameNode);
|
|
@@ -72548,7 +72828,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
72548
72828
|
}
|
|
72549
72829
|
}
|
|
72550
72830
|
if (!typeResult.isIncomplete) {
|
|
72551
|
-
reportPossibleUnknownAssignment(fileInfo.diagnosticRuleSet.reportUnknownVariableType, diagnosticRules_1.DiagnosticRule.reportUnknownVariableType, nameNode,
|
|
72831
|
+
reportPossibleUnknownAssignment(fileInfo.diagnosticRuleSet.reportUnknownVariableType, diagnosticRules_1.DiagnosticRule.reportUnknownVariableType, nameNode, typeResult.type, nameNode, ignoreEmptyContainers);
|
|
72552
72832
|
}
|
|
72553
72833
|
writeTypeCache(
|
|
72554
72834
|
nameNode,
|
|
@@ -73095,26 +73375,11 @@ var require_typeEvaluator = __commonJS({
|
|
|
73095
73375
|
break;
|
|
73096
73376
|
}
|
|
73097
73377
|
case 54: {
|
|
73098
|
-
|
|
73378
|
+
getTypeOfAnnotation(target.d.annotation, {
|
|
73099
73379
|
varTypeAnnotation: true,
|
|
73100
73380
|
allowFinal: isFinalAllowedForAssignmentTarget(target.d.valueExpr),
|
|
73101
73381
|
allowClassVar: isClassVarAllowedForAssignmentTarget(target.d.valueExpr)
|
|
73102
73382
|
});
|
|
73103
|
-
if (annotationType) {
|
|
73104
|
-
const liveScopeIds = ParseTreeUtils.getTypeVarScopesForNode(target);
|
|
73105
|
-
annotationType = (0, typeUtils_1.makeTypeVarsBound)(annotationType, liveScopeIds);
|
|
73106
|
-
}
|
|
73107
|
-
const isBareFinalOrClassVar = (0, types_1.isClassInstance)(annotationType) && (types_1.ClassType.isBuiltIn(annotationType, "Final") || types_1.ClassType.isBuiltIn(annotationType, "ClassVar"));
|
|
73108
|
-
if (!isBareFinalOrClassVar) {
|
|
73109
|
-
const isTypeAliasAnnotation = (0, types_1.isClassInstance)(annotationType) && types_1.ClassType.isBuiltIn(annotationType, "TypeAlias");
|
|
73110
|
-
if (!isTypeAliasAnnotation) {
|
|
73111
|
-
if (assignType(annotationType, typeResult.type)) {
|
|
73112
|
-
if (!(0, types_1.isClassInstance)(typeResult.type) || !types_1.ClassType.isEnumClass(typeResult.type)) {
|
|
73113
|
-
typeResult = narrowTypeBasedOnAssignment(target, annotationType, typeResult);
|
|
73114
|
-
}
|
|
73115
|
-
}
|
|
73116
|
-
}
|
|
73117
|
-
}
|
|
73118
73383
|
assignTypeToExpression(target.d.valueExpr, typeResult, srcExpr, ignoreEmptyContainers, allowAssignmentToFinalVar, expectedTypeDiagAddendum);
|
|
73119
73384
|
break;
|
|
73120
73385
|
}
|
|
@@ -74118,8 +74383,9 @@ var require_typeEvaluator = __commonJS({
|
|
|
74118
74383
|
if (isModuleGetAttrSupported) {
|
|
74119
74384
|
const getAttrTypeResult = getEffectiveTypeOfSymbolForUsage(getAttrSymbol);
|
|
74120
74385
|
if ((0, types_1.isFunction)(getAttrTypeResult.type)) {
|
|
74121
|
-
|
|
74122
|
-
|
|
74386
|
+
const returnTypeResult = getEffectiveReturnTypeResult(getAttrTypeResult.type);
|
|
74387
|
+
type = returnTypeResult.type;
|
|
74388
|
+
if (getAttrTypeResult.isIncomplete || returnTypeResult.isIncomplete) {
|
|
74123
74389
|
isIncomplete = true;
|
|
74124
74390
|
}
|
|
74125
74391
|
}
|
|
@@ -74212,7 +74478,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
74212
74478
|
(0, debug_1.assertNever)(baseType);
|
|
74213
74479
|
}
|
|
74214
74480
|
if (!type) {
|
|
74215
|
-
const isFunctionRule = (0, types_1.
|
|
74481
|
+
const isFunctionRule = (0, types_1.isFunctionOrOverloaded)(baseType) || (0, types_1.isClassInstance)(baseType) && types_1.ClassType.isBuiltIn(baseType, "function");
|
|
74216
74482
|
if (!baseTypeResult.isIncomplete) {
|
|
74217
74483
|
let diagMessage = localize_1.LocMessage.memberAccess();
|
|
74218
74484
|
if (usage.method === "set") {
|
|
@@ -74220,7 +74486,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
74220
74486
|
} else if (usage.method === "del") {
|
|
74221
74487
|
diagMessage = localize_1.LocMessage.memberDelete();
|
|
74222
74488
|
}
|
|
74223
|
-
if (usage.setExpectedTypeDiag) {
|
|
74489
|
+
if (usage.setExpectedTypeDiag && !usage.setExpectedTypeDiag.isEmpty()) {
|
|
74224
74490
|
diag = usage.setExpectedTypeDiag;
|
|
74225
74491
|
}
|
|
74226
74492
|
if ((0, types_1.isClass)(baseType) && baseType.shared.typedDictEntries) {
|
|
@@ -74382,7 +74648,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
74382
74648
|
isDescriptorApplied = true;
|
|
74383
74649
|
}
|
|
74384
74650
|
resultType = descResult.type;
|
|
74385
|
-
} else if ((0, types_1.
|
|
74651
|
+
} else if ((0, types_1.isFunctionOrOverloaded)(concreteSubtype) && types_1.TypeBase.isInstance(concreteSubtype)) {
|
|
74386
74652
|
const typeResult = bindMethodForMemberAccess(subtype, concreteSubtype, memberInfo, classType, selfType, flags, memberName, usage, diag, recursionCount);
|
|
74387
74653
|
resultType = typeResult.type;
|
|
74388
74654
|
if (typeResult.typeErrors) {
|
|
@@ -74411,10 +74677,10 @@ var require_typeEvaluator = __commonJS({
|
|
|
74411
74677
|
isDescriptorError = true;
|
|
74412
74678
|
}
|
|
74413
74679
|
return resultType;
|
|
74414
|
-
});
|
|
74680
|
+
}, { retainTypeAlias: true });
|
|
74415
74681
|
if (!isDescriptorError && usage.method === "set" && usage.setType) {
|
|
74416
74682
|
if (errorNode && memberInfo.symbol.hasTypedDeclarations()) {
|
|
74417
|
-
narrowedTypeForSet = isDescriptorApplied ? usage.setType.type : narrowTypeBasedOnAssignment(
|
|
74683
|
+
narrowedTypeForSet = isDescriptorApplied ? usage.setType.type : narrowTypeBasedOnAssignment(type, usage.setType).type;
|
|
74418
74684
|
}
|
|
74419
74685
|
if (!assignType(type, usage.setType.type, diag == null ? void 0 : diag.createAddendum())) {
|
|
74420
74686
|
if (!usage.setType.isIncomplete) {
|
|
@@ -74488,7 +74754,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
74488
74754
|
}
|
|
74489
74755
|
return { type: types_1.UnknownType.create(), typeErrors: true };
|
|
74490
74756
|
}
|
|
74491
|
-
if (!(0, types_1.
|
|
74757
|
+
if (!(0, types_1.isFunctionOrOverloaded)(methodType)) {
|
|
74492
74758
|
if ((0, types_1.isAnyOrUnknown)(methodType)) {
|
|
74493
74759
|
return { type: methodType };
|
|
74494
74760
|
}
|
|
@@ -74520,7 +74786,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
74520
74786
|
);
|
|
74521
74787
|
accessMethodClass = solveAndApplyConstraints(accessMethodClass, constraints);
|
|
74522
74788
|
const specializedType = (0, typeUtils_1.partiallySpecializeType)(methodType, accessMethodClass, getTypeClassType(), selfType ? (0, typeUtils_1.convertToInstantiable)(selfType) : classType);
|
|
74523
|
-
if ((0, types_1.
|
|
74789
|
+
if ((0, types_1.isFunctionOrOverloaded)(specializedType)) {
|
|
74524
74790
|
methodType = specializedType;
|
|
74525
74791
|
}
|
|
74526
74792
|
}
|
|
@@ -74773,7 +75039,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
74773
75039
|
}
|
|
74774
75040
|
});
|
|
74775
75041
|
}
|
|
74776
|
-
if (!(0, types_1.
|
|
75042
|
+
if (!(0, types_1.isFunctionOrOverloaded)(accessMemberType)) {
|
|
74777
75043
|
if ((0, types_1.isAnyOrUnknown)(accessMemberType)) {
|
|
74778
75044
|
return { type: accessMemberType };
|
|
74779
75045
|
}
|
|
@@ -74876,13 +75142,25 @@ var require_typeEvaluator = __commonJS({
|
|
|
74876
75142
|
function adjustTypeArgsForTypeVarTuple(typeArgs, typeParams, errorNode) {
|
|
74877
75143
|
const variadicIndex = typeParams.findIndex((param) => (0, types_1.isTypeVarTuple)(param));
|
|
74878
75144
|
let srcUnboundedTupleType;
|
|
74879
|
-
|
|
74880
|
-
|
|
74881
|
-
|
|
74882
|
-
|
|
75145
|
+
const findUnboundedTupleIndex = (startArgIndex) => {
|
|
75146
|
+
return typeArgs.findIndex((arg, index) => {
|
|
75147
|
+
if (index < startArgIndex) {
|
|
75148
|
+
return false;
|
|
75149
|
+
}
|
|
75150
|
+
if ((0, types_1.isUnpackedClass)(arg.type) && arg.type.priv.tupleTypeArgs && arg.type.priv.tupleTypeArgs.length === 1 && arg.type.priv.tupleTypeArgs[0].isUnbounded) {
|
|
75151
|
+
srcUnboundedTupleType = arg.type.priv.tupleTypeArgs[0].type;
|
|
75152
|
+
return true;
|
|
75153
|
+
}
|
|
75154
|
+
return false;
|
|
75155
|
+
});
|
|
75156
|
+
};
|
|
75157
|
+
let srcUnboundedTupleIndex = findUnboundedTupleIndex(0);
|
|
75158
|
+
if (srcUnboundedTupleIndex >= 0) {
|
|
75159
|
+
const secondUnboundedTupleIndex = findUnboundedTupleIndex(srcUnboundedTupleIndex + 1);
|
|
75160
|
+
if (secondUnboundedTupleIndex >= 0) {
|
|
75161
|
+
addDiagnostic(diagnosticRules_1.DiagnosticRule.reportInvalidTypeForm, localize_1.LocMessage.variadicTypeArgsTooMany(), typeArgs[secondUnboundedTupleIndex].node);
|
|
74883
75162
|
}
|
|
74884
|
-
|
|
74885
|
-
});
|
|
75163
|
+
}
|
|
74886
75164
|
if (srcUnboundedTupleType && srcUnboundedTupleIndex >= 0 && variadicIndex >= 0 && typeArgs.length < typeParams.length) {
|
|
74887
75165
|
while (variadicIndex > srcUnboundedTupleIndex) {
|
|
74888
75166
|
typeArgs = [
|
|
@@ -75811,7 +76089,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
75811
76089
|
}
|
|
75812
76090
|
return typeResult;
|
|
75813
76091
|
}
|
|
75814
|
-
function buildTupleTypesList(entryTypeResults, stripLiterals) {
|
|
76092
|
+
function buildTupleTypesList(entryTypeResults, stripLiterals, convertModule) {
|
|
75815
76093
|
const entryTypes = [];
|
|
75816
76094
|
for (const typeResult of entryTypeResults) {
|
|
75817
76095
|
let possibleUnpackedTuple;
|
|
@@ -75833,12 +76111,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
75833
76111
|
true
|
|
75834
76112
|
), isUnbounded: false });
|
|
75835
76113
|
} else {
|
|
75836
|
-
let entryType = convertSpecialFormToRuntimeValue(
|
|
75837
|
-
typeResult.type,
|
|
75838
|
-
0,
|
|
75839
|
-
/* convertModule */
|
|
75840
|
-
true
|
|
75841
|
-
);
|
|
76114
|
+
let entryType = convertSpecialFormToRuntimeValue(typeResult.type, 0, convertModule);
|
|
75842
76115
|
entryType = stripLiterals ? (0, typeUtils_1.stripTypeForm)(stripLiteralValue(entryType)) : entryType;
|
|
75843
76116
|
entryTypes.push({ type: entryType, isUnbounded: !!typeResult.unpackedType });
|
|
75844
76117
|
}
|
|
@@ -76336,7 +76609,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
76336
76609
|
}
|
|
76337
76610
|
function validateOverloadsWithExpandedTypes(errorNode, expandedArgTypes, argParamMatches, constraints, skipUnknownArgCheck, inferenceContext) {
|
|
76338
76611
|
const returnTypes = [];
|
|
76339
|
-
|
|
76612
|
+
let matchedOverloads = [];
|
|
76340
76613
|
let isTypeIncomplete = false;
|
|
76341
76614
|
let overloadsUsedForCall = [];
|
|
76342
76615
|
let isDefinitiveMatchFound = false;
|
|
@@ -76387,10 +76660,12 @@ var require_typeEvaluator = __commonJS({
|
|
|
76387
76660
|
argResults: callResult.argResults ?? []
|
|
76388
76661
|
};
|
|
76389
76662
|
matchedOverloads.push(matchedOverloadInfo);
|
|
76390
|
-
if (callResult.anyOrUnknownArg) {
|
|
76663
|
+
if (callResult.anyOrUnknownArg || matchResults.unpackedArgOfUnknownLength) {
|
|
76391
76664
|
possibleMatchResults.push(matchedOverloadInfo);
|
|
76392
|
-
if (
|
|
76393
|
-
|
|
76665
|
+
if (callResult.anyOrUnknownArg) {
|
|
76666
|
+
if ((0, typeUtils_1.isIncompleteUnknown)(callResult.anyOrUnknownArg)) {
|
|
76667
|
+
possibleMatchInvolvesIncompleteUnknown = true;
|
|
76668
|
+
}
|
|
76394
76669
|
}
|
|
76395
76670
|
} else {
|
|
76396
76671
|
returnTypes.push(callResult.returnType);
|
|
@@ -76400,10 +76675,12 @@ var require_typeEvaluator = __commonJS({
|
|
|
76400
76675
|
}
|
|
76401
76676
|
}
|
|
76402
76677
|
if (!isDefinitiveMatchFound && possibleMatchResults.length > 0) {
|
|
76678
|
+
possibleMatchResults = filterOverloadMatchesForUnpackedArgs(possibleMatchResults);
|
|
76403
76679
|
possibleMatchResults = filterOverloadMatchesForAnyArgs(possibleMatchResults);
|
|
76404
76680
|
if (possibleMatchResults.length === 1) {
|
|
76405
76681
|
overloadsUsedForCall = [possibleMatchResults[0].overload];
|
|
76406
76682
|
returnTypes.push(possibleMatchResults[0].returnType);
|
|
76683
|
+
matchedOverloads = [possibleMatchResults[0]];
|
|
76407
76684
|
} else {
|
|
76408
76685
|
let dedupedMatchResults = [];
|
|
76409
76686
|
let dedupedResultsIncludeAny = false;
|
|
@@ -76474,15 +76751,19 @@ var require_typeEvaluator = __commonJS({
|
|
|
76474
76751
|
overloadsUsedForCall
|
|
76475
76752
|
};
|
|
76476
76753
|
}
|
|
76477
|
-
function
|
|
76754
|
+
function filterOverloadMatchesForUnpackedArgs(matches) {
|
|
76478
76755
|
if (matches.length < 2) {
|
|
76479
76756
|
return matches;
|
|
76480
76757
|
}
|
|
76481
|
-
|
|
76482
|
-
|
|
76483
|
-
|
|
76484
|
-
|
|
76485
|
-
|
|
76758
|
+
const unpackedArgsOverloads = matches.filter((match2) => match2.matchResults.unpackedArgMapsToVariadic);
|
|
76759
|
+
if (unpackedArgsOverloads.length === matches.length || unpackedArgsOverloads.length === 0) {
|
|
76760
|
+
return matches;
|
|
76761
|
+
}
|
|
76762
|
+
return unpackedArgsOverloads;
|
|
76763
|
+
}
|
|
76764
|
+
function filterOverloadMatchesForAnyArgs(matches) {
|
|
76765
|
+
if (matches.length < 2) {
|
|
76766
|
+
return matches;
|
|
76486
76767
|
}
|
|
76487
76768
|
if ((0, typeUtils_1.areTypesSame)(matches.map((match2) => match2.returnType), { treatAnySameAsUnknown: true })) {
|
|
76488
76769
|
return [matches[0]];
|
|
@@ -76507,7 +76788,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
76507
76788
|
}
|
|
76508
76789
|
function getBestOverloadForArgs(errorNode, typeResult, argList) {
|
|
76509
76790
|
let overloadIndex = 0;
|
|
76510
|
-
|
|
76791
|
+
const matches = [];
|
|
76511
76792
|
const speculativeNode = getSpeculativeNodeForCall(errorNode);
|
|
76512
76793
|
useSignatureTracker(errorNode, () => {
|
|
76513
76794
|
types_1.OverloadedType.getOverloads(typeResult.type).forEach((overload) => {
|
|
@@ -76520,7 +76801,6 @@ var require_typeEvaluator = __commonJS({
|
|
|
76520
76801
|
});
|
|
76521
76802
|
});
|
|
76522
76803
|
});
|
|
76523
|
-
matches = sortOverloadsByBestMatch(matches);
|
|
76524
76804
|
let winningOverloadIndex;
|
|
76525
76805
|
matches.forEach((match2, matchIndex) => {
|
|
76526
76806
|
if (winningOverloadIndex === void 0) {
|
|
@@ -76540,16 +76820,8 @@ var require_typeEvaluator = __commonJS({
|
|
|
76540
76820
|
});
|
|
76541
76821
|
return winningOverloadIndex === void 0 ? void 0 : matches[winningOverloadIndex].overload;
|
|
76542
76822
|
}
|
|
76543
|
-
function sortOverloadsByBestMatch(matches) {
|
|
76544
|
-
return matches.sort((a, b) => {
|
|
76545
|
-
if (a.relevance !== b.relevance) {
|
|
76546
|
-
return b.relevance - a.relevance;
|
|
76547
|
-
}
|
|
76548
|
-
return a.overloadIndex - b.overloadIndex;
|
|
76549
|
-
});
|
|
76550
|
-
}
|
|
76551
76823
|
function validateOverloadedArgTypes(errorNode, argList, typeResult, constraints, skipUnknownArgCheck, inferenceContext) {
|
|
76552
|
-
|
|
76824
|
+
const filteredMatchResults = [];
|
|
76553
76825
|
let contextFreeArgTypes;
|
|
76554
76826
|
let isTypeIncomplete = !!typeResult.isIncomplete;
|
|
76555
76827
|
const type = typeResult.type;
|
|
@@ -76564,7 +76836,6 @@ var require_typeEvaluator = __commonJS({
|
|
|
76564
76836
|
overloadIndex++;
|
|
76565
76837
|
});
|
|
76566
76838
|
});
|
|
76567
|
-
filteredMatchResults = sortOverloadsByBestMatch(filteredMatchResults);
|
|
76568
76839
|
if (filteredMatchResults.length === 0) {
|
|
76569
76840
|
if (!canSkipDiagnosticForNode(errorNode)) {
|
|
76570
76841
|
const overloads = types_1.OverloadedType.getOverloads(type);
|
|
@@ -76755,22 +77026,33 @@ var require_typeEvaluator = __commonJS({
|
|
|
76755
77026
|
};
|
|
76756
77027
|
}
|
|
76757
77028
|
function validateCallArgsForSubtype(errorNode, argList, expandedCallType, unexpandedCallType, isCallTypeIncomplete, constraints, skipUnknownArgCheck, inferenceContext, recursionCount) {
|
|
77029
|
+
function touchArgTypes() {
|
|
77030
|
+
if (!isCallTypeIncomplete) {
|
|
77031
|
+
argList.forEach((arg) => {
|
|
77032
|
+
if (arg.valueExpression && !isSpeculativeModeInUse(arg.valueExpression)) {
|
|
77033
|
+
getTypeOfArg(
|
|
77034
|
+
arg,
|
|
77035
|
+
/* inferenceContext */
|
|
77036
|
+
void 0
|
|
77037
|
+
);
|
|
77038
|
+
}
|
|
77039
|
+
});
|
|
77040
|
+
}
|
|
77041
|
+
}
|
|
76758
77042
|
switch (expandedCallType.category) {
|
|
76759
77043
|
case 3:
|
|
76760
77044
|
case 1:
|
|
76761
77045
|
case 2: {
|
|
76762
|
-
|
|
76763
|
-
|
|
76764
|
-
|
|
76765
|
-
|
|
76766
|
-
|
|
76767
|
-
|
|
76768
|
-
|
|
76769
|
-
|
|
76770
|
-
|
|
76771
|
-
|
|
76772
|
-
}
|
|
76773
|
-
return { returnType: expandedCallType };
|
|
77046
|
+
const dummyFunctionType = types_1.FunctionType.createInstance(
|
|
77047
|
+
"",
|
|
77048
|
+
"",
|
|
77049
|
+
"",
|
|
77050
|
+
0
|
|
77051
|
+
/* FunctionTypeFlags.None */
|
|
77052
|
+
);
|
|
77053
|
+
types_1.FunctionType.addDefaultParams(dummyFunctionType);
|
|
77054
|
+
const dummyCallResult = validateCallForFunction(errorNode, argList, dummyFunctionType, isCallTypeIncomplete, constraints, skipUnknownArgCheck, inferenceContext);
|
|
77055
|
+
return { ...dummyCallResult, returnType: expandedCallType };
|
|
76774
77056
|
}
|
|
76775
77057
|
case 4: {
|
|
76776
77058
|
return validateCallForFunction(errorNode, argList, expandedCallType, isCallTypeIncomplete, constraints, skipUnknownArgCheck, inferenceContext);
|
|
@@ -76781,6 +77063,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
76781
77063
|
case 6: {
|
|
76782
77064
|
if ((0, typeUtils_1.isNoneInstance)(expandedCallType)) {
|
|
76783
77065
|
addDiagnostic(diagnosticRules_1.DiagnosticRule.reportOptionalCall, localize_1.LocMessage.noneNotCallable(), errorNode);
|
|
77066
|
+
touchArgTypes();
|
|
76784
77067
|
return { argumentErrors: true };
|
|
76785
77068
|
}
|
|
76786
77069
|
if (types_1.TypeBase.isInstantiable(expandedCallType)) {
|
|
@@ -76797,9 +77080,11 @@ var require_typeEvaluator = __commonJS({
|
|
|
76797
77080
|
}
|
|
76798
77081
|
case 7: {
|
|
76799
77082
|
addDiagnostic(diagnosticRules_1.DiagnosticRule.reportCallIssue, localize_1.LocMessage.moduleNotCallable(), errorNode);
|
|
77083
|
+
touchArgTypes();
|
|
76800
77084
|
return { argumentErrors: true };
|
|
76801
77085
|
}
|
|
76802
77086
|
}
|
|
77087
|
+
touchArgTypes();
|
|
76803
77088
|
return { argumentErrors: true };
|
|
76804
77089
|
}
|
|
76805
77090
|
function validateCallForFunction(errorNode, argList, type, isCallTypeIncomplete, constraints, skipUnknownArgCheck, inferenceContext) {
|
|
@@ -77238,24 +77523,13 @@ var require_typeEvaluator = __commonJS({
|
|
|
77238
77523
|
const paramDetails = (0, parameterUtils_1.getParamListDetails)(overload, { disallowExtraKwargsForTd: true });
|
|
77239
77524
|
const paramSpec = types_1.FunctionType.getParamSpecFromArgsKwargs(overload);
|
|
77240
77525
|
let argIndex = 0;
|
|
77241
|
-
let
|
|
77526
|
+
let unpackedArgOfUnknownLength = false;
|
|
77527
|
+
let unpackedArgMapsToVariadic = false;
|
|
77242
77528
|
let reportedArgError = false;
|
|
77243
77529
|
let isTypeIncomplete = !!typeResult.isIncomplete;
|
|
77244
77530
|
let isTypeVarTupleFullyMatched = false;
|
|
77245
77531
|
argList = expandArgList(argList);
|
|
77246
|
-
const
|
|
77247
|
-
paramDetails.params.forEach((paramInfo) => {
|
|
77248
|
-
var _a2;
|
|
77249
|
-
(0, debug_1.assert)(paramInfo !== void 0, "paramInfo is undefined for param name map");
|
|
77250
|
-
const param = paramInfo.param;
|
|
77251
|
-
if (param.name && param.category === 0 && paramInfo.kind !== parameterUtils_1.ParamKind.Positional) {
|
|
77252
|
-
let argsNeeded = ((_a2 = paramMap.get(param.name)) == null ? void 0 : _a2.argsNeeded) ?? 0;
|
|
77253
|
-
if (param.category === 0 && !paramInfo.defaultType) {
|
|
77254
|
-
argsNeeded += 1;
|
|
77255
|
-
}
|
|
77256
|
-
paramMap.set(param.name, { argsNeeded, argsReceived: 0 });
|
|
77257
|
-
}
|
|
77258
|
-
});
|
|
77532
|
+
const paramTracker = new parameterUtils_1.ParamAssignmentTracker(paramDetails.params);
|
|
77259
77533
|
let positionalOnlyLimitIndex = paramDetails.positionOnlyParamCount;
|
|
77260
77534
|
let positionParamLimitIndex = paramDetails.firstKeywordOnlyIndex ?? paramDetails.params.length;
|
|
77261
77535
|
const varArgListParamIndex = paramDetails.argsIndex;
|
|
@@ -77354,6 +77628,8 @@ var require_typeEvaluator = __commonJS({
|
|
|
77354
77628
|
).type;
|
|
77355
77629
|
if ((0, types_1.isClassInstance)(argType) && (0, typeUtils_1.isTupleClass)(argType) && !(0, typeUtils_1.isUnboundedTupleClass)(argType) && argType.priv.tupleTypeArgs !== void 0 && argType.priv.tupleTypeArgs.length > 0) {
|
|
77356
77630
|
tooManyPositionals = true;
|
|
77631
|
+
} else {
|
|
77632
|
+
unpackedArgOfUnknownLength = true;
|
|
77357
77633
|
}
|
|
77358
77634
|
} else {
|
|
77359
77635
|
tooManyPositionals = true;
|
|
@@ -77385,6 +77661,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
77385
77661
|
void 0
|
|
77386
77662
|
);
|
|
77387
77663
|
let listElementType;
|
|
77664
|
+
let enforceIterable = false;
|
|
77388
77665
|
let advanceToNextArg = false;
|
|
77389
77666
|
if (paramIndex < positionParamLimitIndex) {
|
|
77390
77667
|
if ((0, types_1.isParamSpec)(argTypeResult.type) && argTypeResult.type.priv.paramSpecAccess === "args" && paramInfo.param.category !== 1) {
|
|
@@ -77425,14 +77702,27 @@ var require_typeEvaluator = __commonJS({
|
|
|
77425
77702
|
/* emitNotIterableError */
|
|
77426
77703
|
false
|
|
77427
77704
|
)) == null ? void 0 : _a.type;
|
|
77705
|
+
if (!listElementType) {
|
|
77706
|
+
enforceIterable = true;
|
|
77707
|
+
}
|
|
77708
|
+
unpackedArgOfUnknownLength = true;
|
|
77428
77709
|
if (paramInfo.param.category === 1) {
|
|
77429
|
-
|
|
77710
|
+
unpackedArgMapsToVariadic = true;
|
|
77711
|
+
}
|
|
77712
|
+
if (isParamVariadic && listElementType) {
|
|
77713
|
+
isArgCompatibleWithVariadic = true;
|
|
77714
|
+
listElementType = (0, tuples_1.makeTupleObject)(
|
|
77715
|
+
evaluatorInterface,
|
|
77716
|
+
[{ type: listElementType, isUnbounded: true }],
|
|
77717
|
+
/* isUnpacked */
|
|
77718
|
+
true
|
|
77719
|
+
);
|
|
77430
77720
|
}
|
|
77431
77721
|
}
|
|
77432
77722
|
const funcArg = listElementType ? {
|
|
77433
77723
|
argCategory: 0,
|
|
77434
77724
|
typeResult: { type: listElementType, isIncomplete: argTypeResult.isIncomplete }
|
|
77435
|
-
} : { ...argList[argIndex] };
|
|
77725
|
+
} : { ...argList[argIndex], enforceIterable };
|
|
77436
77726
|
if (argTypeResult.isIncomplete) {
|
|
77437
77727
|
isTypeIncomplete = true;
|
|
77438
77728
|
}
|
|
@@ -77459,8 +77749,8 @@ var require_typeEvaluator = __commonJS({
|
|
|
77459
77749
|
}
|
|
77460
77750
|
}
|
|
77461
77751
|
trySetActive(argList[argIndex], paramDetails.params[paramIndex].param);
|
|
77462
|
-
if (paramName && paramDetails.params[paramIndex].param.category === 0
|
|
77463
|
-
|
|
77752
|
+
if (paramName && paramDetails.params[paramIndex].param.category === 0) {
|
|
77753
|
+
paramTracker.markArgReceived(paramInfo);
|
|
77464
77754
|
}
|
|
77465
77755
|
if (advanceToNextArg || paramDetails.params[paramIndex].param.category === 1) {
|
|
77466
77756
|
argIndex++;
|
|
@@ -77518,9 +77808,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
77518
77808
|
isParamNameSynthesized: types_1.FunctionParam.isNameSynthesized(paramInfo2.param)
|
|
77519
77809
|
});
|
|
77520
77810
|
trySetActive(argList[argIndex], paramInfo2.param);
|
|
77521
|
-
|
|
77522
|
-
paramMap.get(paramName2).argsReceived++;
|
|
77523
|
-
}
|
|
77811
|
+
paramTracker.markArgReceived(paramInfo2);
|
|
77524
77812
|
argIndex++;
|
|
77525
77813
|
paramIndex++;
|
|
77526
77814
|
}
|
|
@@ -77566,7 +77854,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
77566
77854
|
const tdEntries = (0, typedDicts_1.getTypedDictMembersForClass)(evaluatorInterface, argType);
|
|
77567
77855
|
const diag = new diagnostic_1.DiagnosticAddendum();
|
|
77568
77856
|
tdEntries.knownItems.forEach((entry, name) => {
|
|
77569
|
-
const paramEntry =
|
|
77857
|
+
const paramEntry = paramTracker.lookupName(name);
|
|
77570
77858
|
if (paramEntry) {
|
|
77571
77859
|
if (paramEntry.argsReceived > 0) {
|
|
77572
77860
|
diag.addMessage(localize_1.LocMessage.paramAlreadyAssigned().format({ name }));
|
|
@@ -77600,10 +77888,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
77600
77888
|
errorNode: argList[argIndex].valueExpression ?? errorNode,
|
|
77601
77889
|
paramName: name
|
|
77602
77890
|
});
|
|
77603
|
-
|
|
77604
|
-
argsNeeded: 1,
|
|
77605
|
-
argsReceived: 1
|
|
77606
|
-
});
|
|
77891
|
+
paramTracker.addKeywordParam(name, paramDetails.params[paramDetails.kwargsIndex]);
|
|
77607
77892
|
} else {
|
|
77608
77893
|
if (!paramDetails.hasUnpackedTypedDict) {
|
|
77609
77894
|
diag.addMessage(localize_1.LocMessage.paramNameMissing().format({ name }));
|
|
@@ -77679,6 +77964,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
77679
77964
|
unpackedDictArgType = types_1.UnknownType.create();
|
|
77680
77965
|
}
|
|
77681
77966
|
}
|
|
77967
|
+
unpackedArgOfUnknownLength = true;
|
|
77682
77968
|
if (paramDetails.kwargsIndex !== void 0 && unpackedDictArgType) {
|
|
77683
77969
|
const paramType = paramDetails.params[paramDetails.kwargsIndex].type;
|
|
77684
77970
|
validateArgTypeParams.push({
|
|
@@ -77690,6 +77976,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
77690
77976
|
errorNode: argList[argIndex].valueExpression || errorNode,
|
|
77691
77977
|
paramName: paramDetails.params[paramDetails.kwargsIndex].param.name
|
|
77692
77978
|
});
|
|
77979
|
+
unpackedArgMapsToVariadic = true;
|
|
77693
77980
|
}
|
|
77694
77981
|
if (!isValidMappingType) {
|
|
77695
77982
|
if (!canSkipDiagnosticForNode(errorNode) && !isTypeIncomplete) {
|
|
@@ -77706,7 +77993,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
77706
77993
|
const paramName = argList[argIndex].name;
|
|
77707
77994
|
if (paramName) {
|
|
77708
77995
|
const paramNameValue = paramName.d.value;
|
|
77709
|
-
const paramEntry =
|
|
77996
|
+
const paramEntry = paramTracker.lookupName(paramNameValue);
|
|
77710
77997
|
if (paramEntry) {
|
|
77711
77998
|
if (paramEntry.argsReceived > 0) {
|
|
77712
77999
|
if (!canSkipDiagnosticForNode(errorNode) && !isTypeIncomplete) {
|
|
@@ -77746,11 +78033,8 @@ var require_typeEvaluator = __commonJS({
|
|
|
77746
78033
|
errorNode: argList[argIndex].valueExpression ?? errorNode,
|
|
77747
78034
|
paramName: paramNameValue
|
|
77748
78035
|
});
|
|
77749
|
-
paramMap.set(paramNameValue, {
|
|
77750
|
-
argsNeeded: 1,
|
|
77751
|
-
argsReceived: 1
|
|
77752
|
-
});
|
|
77753
78036
|
(0, debug_1.assert)(paramDetails.params[paramDetails.kwargsIndex], "paramDetails.kwargsIndex params entry is undefined");
|
|
78037
|
+
paramTracker.addKeywordParam(paramNameValue, paramDetails.params[paramDetails.kwargsIndex]);
|
|
77754
78038
|
}
|
|
77755
78039
|
trySetActive(argList[argIndex], paramDetails.params[paramDetails.kwargsIndex].param);
|
|
77756
78040
|
} else {
|
|
@@ -77800,7 +78084,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
77800
78084
|
paramDetails.params.forEach((paramInfo, paramIndex2) => {
|
|
77801
78085
|
var _a2;
|
|
77802
78086
|
const param = paramInfo.param;
|
|
77803
|
-
if (paramIndex2 >= paramDetails.firstPositionOrKeywordIndex && param.category === 0 && param.name &&
|
|
78087
|
+
if (paramIndex2 >= paramDetails.firstPositionOrKeywordIndex && param.category === 0 && param.name && paramTracker.lookupDetails(paramInfo).argsReceived === 0) {
|
|
77804
78088
|
const paramType = paramDetails.params[paramIndex2].type;
|
|
77805
78089
|
if (!unpackedDictKeyNames || unpackedDictKeyNames.includes(param.name)) {
|
|
77806
78090
|
validateArgTypeParams.push({
|
|
@@ -77818,16 +78102,13 @@ var require_typeEvaluator = __commonJS({
|
|
|
77818
78102
|
paramName: param.name,
|
|
77819
78103
|
isParamNameSynthesized: types_1.FunctionParam.isNameSynthesized(param)
|
|
77820
78104
|
});
|
|
77821
|
-
|
|
78105
|
+
paramTracker.markArgReceived(paramDetails.params[paramIndex2]);
|
|
77822
78106
|
}
|
|
77823
78107
|
}
|
|
77824
78108
|
});
|
|
77825
78109
|
}
|
|
77826
78110
|
if (!unpackedDictArgType && !types_1.FunctionType.isDefaultParamCheckDisabled(overload)) {
|
|
77827
|
-
const unassignedParams =
|
|
77828
|
-
const entry = paramMap.get(name);
|
|
77829
|
-
return !entry || entry.argsReceived < entry.argsNeeded;
|
|
77830
|
-
});
|
|
78111
|
+
const unassignedParams = paramTracker.getUnassignedParams();
|
|
77831
78112
|
if (unassignedParams.length > 0) {
|
|
77832
78113
|
if (!canSkipDiagnosticForNode(errorNode)) {
|
|
77833
78114
|
const missingParamNames = unassignedParams.map((p) => `"${p}"`).join(", ");
|
|
@@ -77840,21 +78121,24 @@ var require_typeEvaluator = __commonJS({
|
|
|
77840
78121
|
paramDetails.params.forEach((paramInfo) => {
|
|
77841
78122
|
const param = paramInfo.param;
|
|
77842
78123
|
if (param.category === 0 && param.name) {
|
|
77843
|
-
const entry =
|
|
77844
|
-
if (entry
|
|
77845
|
-
|
|
77846
|
-
|
|
77847
|
-
|
|
77848
|
-
|
|
77849
|
-
|
|
77850
|
-
|
|
77851
|
-
|
|
77852
|
-
|
|
77853
|
-
|
|
77854
|
-
|
|
77855
|
-
|
|
77856
|
-
|
|
77857
|
-
|
|
78124
|
+
const entry = paramTracker.lookupDetails(paramInfo);
|
|
78125
|
+
if (entry.argsNeeded === 0 && entry.argsReceived === 0) {
|
|
78126
|
+
const defaultArgType = paramInfo.defaultType;
|
|
78127
|
+
if (defaultArgType && !(0, typeUtils_1.isEllipsisType)(defaultArgType) && (0, typeUtils_1.requiresSpecialization)(paramInfo.declaredType, { ignorePseudoGeneric: true })) {
|
|
78128
|
+
validateArgTypeParams.push({
|
|
78129
|
+
paramCategory: param.category,
|
|
78130
|
+
paramType: paramInfo.type,
|
|
78131
|
+
requiresTypeVarMatching: true,
|
|
78132
|
+
argument: {
|
|
78133
|
+
argCategory: 0,
|
|
78134
|
+
typeResult: { type: defaultArgType }
|
|
78135
|
+
},
|
|
78136
|
+
isDefaultArg: true,
|
|
78137
|
+
errorNode,
|
|
78138
|
+
paramName: param.name,
|
|
78139
|
+
isParamNameSynthesized: types_1.FunctionParam.isNameSynthesized(param)
|
|
78140
|
+
});
|
|
78141
|
+
}
|
|
77858
78142
|
}
|
|
77859
78143
|
}
|
|
77860
78144
|
});
|
|
@@ -77919,10 +78203,6 @@ var require_typeEvaluator = __commonJS({
|
|
|
77919
78203
|
}
|
|
77920
78204
|
}
|
|
77921
78205
|
}
|
|
77922
|
-
let relevance = 0;
|
|
77923
|
-
if (matchedUnpackedListOfUnknownLength) {
|
|
77924
|
-
relevance++;
|
|
77925
|
-
}
|
|
77926
78206
|
if (types_1.FunctionType.isBuiltIn(overload, ["isinstance", "issubclass"]) && validateArgTypeParams.length === 2) {
|
|
77927
78207
|
validateArgTypeParams[1].isinstanceParam = true;
|
|
77928
78208
|
}
|
|
@@ -77935,7 +78215,8 @@ var require_typeEvaluator = __commonJS({
|
|
|
77935
78215
|
paramSpecTarget,
|
|
77936
78216
|
paramSpecArgList,
|
|
77937
78217
|
activeParam,
|
|
77938
|
-
|
|
78218
|
+
unpackedArgOfUnknownLength,
|
|
78219
|
+
unpackedArgMapsToVariadic,
|
|
77939
78220
|
argumentMatchScore: 0
|
|
77940
78221
|
};
|
|
77941
78222
|
}
|
|
@@ -78175,14 +78456,18 @@ var require_typeEvaluator = __commonJS({
|
|
|
78175
78456
|
argumentMatchScore += 1;
|
|
78176
78457
|
}
|
|
78177
78458
|
}
|
|
78178
|
-
|
|
78459
|
+
const returnTypeResult = getEffectiveReturnTypeResult(type, {
|
|
78179
78460
|
callSiteInfo: { args: matchResults.argParams, errorNode }
|
|
78180
78461
|
});
|
|
78462
|
+
let returnType = returnTypeResult.type;
|
|
78463
|
+
if (returnTypeResult.isIncomplete) {
|
|
78464
|
+
isTypeIncomplete = true;
|
|
78465
|
+
}
|
|
78181
78466
|
if (condition.length > 0) {
|
|
78182
78467
|
returnType = types_1.TypeBase.cloneForCondition(returnType, condition);
|
|
78183
78468
|
}
|
|
78184
78469
|
let eliminateUnsolvedInUnions = true;
|
|
78185
|
-
if ((0, types_1.
|
|
78470
|
+
if ((0, types_1.isFunctionOrOverloaded)(returnType)) {
|
|
78186
78471
|
eliminateUnsolvedInUnions = false;
|
|
78187
78472
|
}
|
|
78188
78473
|
let specializedReturnType = solveAndApplyConstraints(returnType, constraints, {
|
|
@@ -78276,7 +78561,13 @@ var require_typeEvaluator = __commonJS({
|
|
|
78276
78561
|
getTypeOfExpression(arg.valueExpression);
|
|
78277
78562
|
}
|
|
78278
78563
|
});
|
|
78564
|
+
const possibleType = types_1.FunctionType.getEffectiveReturnType(typeResult.type);
|
|
78279
78565
|
return {
|
|
78566
|
+
returnType: possibleType && !(0, types_1.isAnyOrUnknown)(possibleType) ? types_1.UnknownType.createPossibleType(
|
|
78567
|
+
possibleType,
|
|
78568
|
+
/* isIncomplete */
|
|
78569
|
+
false
|
|
78570
|
+
) : void 0,
|
|
78280
78571
|
argumentErrors: true,
|
|
78281
78572
|
activeParam: matchResults.activeParam,
|
|
78282
78573
|
overloadsUsedForCall: []
|
|
@@ -78410,12 +78701,19 @@ var require_typeEvaluator = __commonJS({
|
|
|
78410
78701
|
const flags = argParam.isinstanceParam ? 536871546 : 16 | 2;
|
|
78411
78702
|
const exprTypeResult = getTypeOfExpression(argParam.argument.valueExpression, flags, (0, typeUtils_1.makeInferenceContext)(expectedType, !!(typeResult == null ? void 0 : typeResult.isIncomplete)));
|
|
78412
78703
|
argType = exprTypeResult.type;
|
|
78704
|
+
if (argParam.argument.argCategory === 1 && argParam.argument.enforceIterable) {
|
|
78705
|
+
const iteratorType = getTypeOfIterator(
|
|
78706
|
+
exprTypeResult,
|
|
78707
|
+
/* isAsync */
|
|
78708
|
+
false,
|
|
78709
|
+
argParam.argument.valueExpression
|
|
78710
|
+
);
|
|
78711
|
+
argType = (iteratorType == null ? void 0 : iteratorType.type) ?? types_1.UnknownType.create();
|
|
78712
|
+
}
|
|
78413
78713
|
if (exprTypeResult.isIncomplete) {
|
|
78414
78714
|
isTypeIncomplete = true;
|
|
78415
78715
|
}
|
|
78416
|
-
if (
|
|
78417
|
-
isCompatible = false;
|
|
78418
|
-
} else if (expectedType && (0, typeUtils_1.requiresSpecialization)(expectedType)) {
|
|
78716
|
+
if (expectedType && (0, typeUtils_1.requiresSpecialization)(expectedType)) {
|
|
78419
78717
|
const clonedConstraints = constraints.clone();
|
|
78420
78718
|
if (assignType(
|
|
78421
78719
|
expectedType,
|
|
@@ -79382,18 +79680,8 @@ var require_typeEvaluator = __commonJS({
|
|
|
79382
79680
|
if (keyValueResult.typeErrors) {
|
|
79383
79681
|
typeErrors = true;
|
|
79384
79682
|
}
|
|
79385
|
-
const keyTypes = keyTypeResults.map((t) => (0, typeUtils_1.stripTypeForm)(convertSpecialFormToRuntimeValue(
|
|
79386
|
-
|
|
79387
|
-
flags,
|
|
79388
|
-
/* convertModule */
|
|
79389
|
-
true
|
|
79390
|
-
)));
|
|
79391
|
-
const valueTypes = valueTypeResults.map((t) => (0, typeUtils_1.stripTypeForm)(convertSpecialFormToRuntimeValue(
|
|
79392
|
-
stripLiteralValue(t.type),
|
|
79393
|
-
flags,
|
|
79394
|
-
/* convertModule */
|
|
79395
|
-
true
|
|
79396
|
-
)));
|
|
79683
|
+
const keyTypes = keyTypeResults.map((t) => (0, typeUtils_1.stripTypeForm)(convertSpecialFormToRuntimeValue(stripLiteralValue(t.type), flags, !hasExpectedType)));
|
|
79684
|
+
const valueTypes = valueTypeResults.map((t) => (0, typeUtils_1.stripTypeForm)(convertSpecialFormToRuntimeValue(stripLiteralValue(t.type), flags, !hasExpectedType)));
|
|
79397
79685
|
if (keyTypes.length > 0) {
|
|
79398
79686
|
if (AnalyzerNodeInfo.getFileInfo(node).diagnosticRuleSet.strictDictionaryInference || hasExpectedType) {
|
|
79399
79687
|
keyType = (0, types_1.combineTypes)(keyTypes);
|
|
@@ -79767,12 +80055,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
79767
80055
|
/* EvalFlags.StripTupleLiterals */
|
|
79768
80056
|
);
|
|
79769
80057
|
}
|
|
79770
|
-
entryTypeResult.type = (0, typeUtils_1.stripTypeForm)(convertSpecialFormToRuntimeValue(
|
|
79771
|
-
entryTypeResult.type,
|
|
79772
|
-
flags,
|
|
79773
|
-
/* convertModule */
|
|
79774
|
-
true
|
|
79775
|
-
));
|
|
80058
|
+
entryTypeResult.type = (0, typeUtils_1.stripTypeForm)(convertSpecialFormToRuntimeValue(entryTypeResult.type, flags, !hasExpectedType));
|
|
79776
80059
|
if (entryTypeResult.isIncomplete) {
|
|
79777
80060
|
isIncomplete = true;
|
|
79778
80061
|
}
|
|
@@ -80064,7 +80347,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
80064
80347
|
void 0,
|
|
80065
80348
|
(0, typeUtils_1.makeInferenceContext)(expectedReturnType)
|
|
80066
80349
|
);
|
|
80067
|
-
functionType.
|
|
80350
|
+
functionType.shared.inferredReturnType = {
|
|
80068
80351
|
type: returnTypeResult.type
|
|
80069
80352
|
};
|
|
80070
80353
|
if (returnTypeResult.isIncomplete) {
|
|
@@ -80883,7 +81166,6 @@ var require_typeEvaluator = __commonJS({
|
|
|
80883
81166
|
};
|
|
80884
81167
|
let reportedUnpackedError = false;
|
|
80885
81168
|
typeArgs.forEach((typeArg, index) => {
|
|
80886
|
-
var _a;
|
|
80887
81169
|
(0, debug_1.assert)(typeArgs !== void 0);
|
|
80888
81170
|
if ((0, typeUtils_1.isEllipsisType)(typeArg.type)) {
|
|
80889
81171
|
if (!isTupleTypeParam) {
|
|
@@ -80906,7 +81188,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
80906
81188
|
}
|
|
80907
81189
|
validateTypeVarTupleIsUnpacked(typeArg.type, typeArg.node);
|
|
80908
81190
|
} else if (paramLimit === void 0 && (0, types_1.isUnpackedClass)(typeArg.type)) {
|
|
80909
|
-
if ((
|
|
81191
|
+
if ((0, typeUtils_1.isUnboundedTupleClass)(typeArg.type)) {
|
|
80910
81192
|
noteSawUnpacked(typeArg);
|
|
80911
81193
|
}
|
|
80912
81194
|
validateTypeArg(typeArg, { allowUnpackedTuples: true });
|
|
@@ -82115,6 +82397,9 @@ var require_typeEvaluator = __commonJS({
|
|
|
82115
82397
|
}
|
|
82116
82398
|
}
|
|
82117
82399
|
};
|
|
82400
|
+
if (node.d.name.d.value === "Any" && fileInfo.isTypingStubFile) {
|
|
82401
|
+
decoratedType = types_1.AnyType.createSpecialForm();
|
|
82402
|
+
}
|
|
82118
82403
|
writeTypeCache(
|
|
82119
82404
|
node.d.name,
|
|
82120
82405
|
{ type: classType },
|
|
@@ -82788,15 +83073,6 @@ var require_typeEvaluator = __commonJS({
|
|
|
82788
83073
|
if (functionType.shared.declaredReturnType && returnTypeAnnotationNode) {
|
|
82789
83074
|
(0, typeUtils_1.addTypeVarsToListIfUnique)(typeParamsSeen, (0, typeUtils_1.getTypeVarArgsRecursive)(functionType.shared.declaredReturnType), functionType.shared.typeVarScopeId);
|
|
82790
83075
|
}
|
|
82791
|
-
if (fileInfo.isStubFile || ParseTreeUtils.isSuiteEmpty(node.d.suite)) {
|
|
82792
|
-
if (functionType.shared.declaredReturnType && (0, types_1.isClassInstance)(functionType.shared.declaredReturnType) && types_1.ClassType.isBuiltIn(functionType.shared.declaredReturnType, [
|
|
82793
|
-
"Generator",
|
|
82794
|
-
"AsyncGenerator",
|
|
82795
|
-
"AwaitableGenerator"
|
|
82796
|
-
])) {
|
|
82797
|
-
functionType.shared.flags |= 16;
|
|
82798
|
-
}
|
|
82799
|
-
}
|
|
82800
83076
|
functionType.shared.typeParams.forEach((typeParam, index) => {
|
|
82801
83077
|
let bestErrorNode = node.d.name;
|
|
82802
83078
|
if (node.d.typeParams && index < node.d.typeParams.d.params.length) {
|
|
@@ -82901,7 +83177,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
82901
83177
|
inferredParamType = (0, types_1.combineTypes)([defaultValueType, types_1.UnknownType.create()]);
|
|
82902
83178
|
} else {
|
|
82903
83179
|
let skipInference = false;
|
|
82904
|
-
if ((0, types_1.
|
|
83180
|
+
if ((0, types_1.isFunctionOrOverloaded)(defaultValueType)) {
|
|
82905
83181
|
skipInference = true;
|
|
82906
83182
|
} else if ((0, types_1.isClassInstance)(defaultValueType) && types_1.ClassType.isBuiltIn(defaultValueType, ["tuple", "list", "set", "dict"])) {
|
|
82907
83183
|
skipInference = true;
|
|
@@ -82961,7 +83237,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
82961
83237
|
if (functionType.shared.declaredReturnType) {
|
|
82962
83238
|
awaitableFunctionType.shared.declaredReturnType = createAwaitableReturnType(node, functionType.shared.declaredReturnType, types_1.FunctionType.isGenerator(functionType));
|
|
82963
83239
|
} else {
|
|
82964
|
-
awaitableFunctionType.
|
|
83240
|
+
awaitableFunctionType.shared.inferredReturnType = {
|
|
82965
83241
|
type: createAwaitableReturnType(node, getInferredReturnType(functionType), types_1.FunctionType.isGenerator(functionType))
|
|
82966
83242
|
};
|
|
82967
83243
|
}
|
|
@@ -82984,8 +83260,12 @@ var require_typeEvaluator = __commonJS({
|
|
|
82984
83260
|
}
|
|
82985
83261
|
awaitableReturnType = types_1.ClassType.cloneAsInstance(types_1.ClassType.specialize(asyncGeneratorType, typeArgs));
|
|
82986
83262
|
}
|
|
82987
|
-
} else if (["
|
|
83263
|
+
} else if (["AsyncIterator", "AsyncIterable"].some((name) => name === returnType.shared.name)) {
|
|
82988
83264
|
awaitableReturnType = returnType;
|
|
83265
|
+
} else if (returnType.shared.name === "AsyncGenerator") {
|
|
83266
|
+
if (isGenerator) {
|
|
83267
|
+
awaitableReturnType = returnType;
|
|
83268
|
+
}
|
|
82989
83269
|
}
|
|
82990
83270
|
}
|
|
82991
83271
|
}
|
|
@@ -83265,6 +83545,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
83265
83545
|
return;
|
|
83266
83546
|
}
|
|
83267
83547
|
const exprTypeResult = getTypeOfExpression(node.d.expr);
|
|
83548
|
+
let isIncomplete = exprTypeResult.isIncomplete;
|
|
83268
83549
|
let exprType = exprTypeResult.type;
|
|
83269
83550
|
const isAsync = node.parent && node.parent.nodeType === 58 && !!node.parent.d.isAsync;
|
|
83270
83551
|
if ((0, typeUtils_1.isOptionalType)(exprType)) {
|
|
@@ -83290,7 +83571,17 @@ var require_typeEvaluator = __commonJS({
|
|
|
83290
83571
|
enterDiag.createAddendum()
|
|
83291
83572
|
);
|
|
83292
83573
|
if (enterTypeResult) {
|
|
83293
|
-
|
|
83574
|
+
if (isAsync) {
|
|
83575
|
+
if (enterTypeResult.isIncomplete) {
|
|
83576
|
+
isIncomplete = true;
|
|
83577
|
+
}
|
|
83578
|
+
const asyncResult = getTypeOfAwaitable({ type: enterTypeResult.type }, node.d.expr);
|
|
83579
|
+
if (asyncResult.isIncomplete) {
|
|
83580
|
+
isIncomplete = true;
|
|
83581
|
+
}
|
|
83582
|
+
return asyncResult.type;
|
|
83583
|
+
}
|
|
83584
|
+
return enterTypeResult.type;
|
|
83294
83585
|
}
|
|
83295
83586
|
if (!isAsync) {
|
|
83296
83587
|
if ((_a = getTypeOfMagicMethodCall(
|
|
@@ -83328,18 +83619,28 @@ var require_typeEvaluator = __commonJS({
|
|
|
83328
83619
|
exitDiag
|
|
83329
83620
|
);
|
|
83330
83621
|
if (exitTypeResult) {
|
|
83331
|
-
|
|
83622
|
+
if (exitTypeResult.isIncomplete) {
|
|
83623
|
+
isIncomplete = true;
|
|
83624
|
+
}
|
|
83625
|
+
if (isAsync) {
|
|
83626
|
+
const asyncResult = getTypeOfAwaitable({ type: exitTypeResult.type }, node.d.expr);
|
|
83627
|
+
if (asyncResult.isIncomplete) {
|
|
83628
|
+
isIncomplete = true;
|
|
83629
|
+
}
|
|
83630
|
+
return asyncResult.type;
|
|
83631
|
+
}
|
|
83632
|
+
return exitTypeResult.type;
|
|
83332
83633
|
}
|
|
83333
83634
|
}
|
|
83334
83635
|
addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.typeNotUsableWith().format({ type: printType(subtype), method: exitMethodName }) + exitDiag.getString(), node.d.expr);
|
|
83335
83636
|
return types_1.UnknownType.create();
|
|
83336
83637
|
});
|
|
83337
83638
|
if (node.d.target) {
|
|
83338
|
-
assignTypeToExpression(node.d.target, { type: scopedType, isIncomplete
|
|
83639
|
+
assignTypeToExpression(node.d.target, { type: scopedType, isIncomplete }, node.d.target);
|
|
83339
83640
|
}
|
|
83340
83641
|
writeTypeCache(
|
|
83341
83642
|
node,
|
|
83342
|
-
{ type: scopedType, isIncomplete
|
|
83643
|
+
{ type: scopedType, isIncomplete },
|
|
83343
83644
|
0
|
|
83344
83645
|
/* EvalFlags.None */
|
|
83345
83646
|
);
|
|
@@ -84285,7 +84586,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
84285
84586
|
if (fileInfo.isStubFile || pythonVersion_1.PythonVersion.isGreaterOrEqualTo(fileInfo.executionEnvironment.pythonVersion, pythonVersion_1.pythonVersion3_9) || (0, analyzerFileInfo_1.isAnnotationEvaluationPostponed)(AnalyzerNodeInfo.getFileInfo(errorNode)) || (flags & 4) !== 0) {
|
|
84286
84587
|
if (types_1.ClassType.isBuiltIn(classType, "type") && typeArgs) {
|
|
84287
84588
|
if (typeArgs.length >= 1) {
|
|
84288
|
-
if ((0, types_1.
|
|
84589
|
+
if ((0, types_1.isFunctionOrOverloaded)(typeArgs[0].type)) {
|
|
84289
84590
|
addDiagnostic(diagnosticRules_1.DiagnosticRule.reportInvalidTypeForm, localize_1.LocMessage.typeAnnotationWithCallable(), typeArgs[0].node);
|
|
84290
84591
|
return { type: types_1.UnknownType.create() };
|
|
84291
84592
|
}
|
|
@@ -84786,7 +85087,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
84786
85087
|
if (!tracker) {
|
|
84787
85088
|
return type;
|
|
84788
85089
|
}
|
|
84789
|
-
if ((0, types_1.
|
|
85090
|
+
if ((0, types_1.isFunctionOrOverloaded)(type)) {
|
|
84790
85091
|
return (0, typeUtils_1.ensureSignaturesAreUnique)(type, tracker, node.start);
|
|
84791
85092
|
}
|
|
84792
85093
|
return type;
|
|
@@ -85058,11 +85359,11 @@ var require_typeEvaluator = __commonJS({
|
|
|
85058
85359
|
if (declaration.intrinsicType === "int") {
|
|
85059
85360
|
return { type: intType };
|
|
85060
85361
|
}
|
|
85061
|
-
if (declaration.intrinsicType === "
|
|
85062
|
-
const
|
|
85063
|
-
if ((0, types_1.isInstantiableClass)(
|
|
85362
|
+
if (declaration.intrinsicType === "MutableSequence[str]") {
|
|
85363
|
+
const sequenceType = getBuiltInType(declaration.node, "MutableSequence");
|
|
85364
|
+
if ((0, types_1.isInstantiableClass)(sequenceType)) {
|
|
85064
85365
|
return {
|
|
85065
|
-
type: types_1.ClassType.cloneAsInstance(types_1.ClassType.specialize(
|
|
85366
|
+
type: types_1.ClassType.cloneAsInstance(types_1.ClassType.specialize(sequenceType, [strType]))
|
|
85066
85367
|
};
|
|
85067
85368
|
}
|
|
85068
85369
|
}
|
|
@@ -85331,27 +85632,53 @@ var require_typeEvaluator = __commonJS({
|
|
|
85331
85632
|
}
|
|
85332
85633
|
if (loaderActions.implicitImports) {
|
|
85333
85634
|
loaderActions.implicitImports.forEach((implicitImport, name) => {
|
|
85635
|
+
const existingLoaderField = moduleType.priv.loaderFields.get(name);
|
|
85334
85636
|
let symbolType;
|
|
85335
85637
|
if (implicitImport.isUnresolved) {
|
|
85336
85638
|
symbolType = types_1.UnknownType.create();
|
|
85337
85639
|
} else {
|
|
85338
|
-
|
|
85339
|
-
const
|
|
85640
|
+
let importedModuleType;
|
|
85641
|
+
const existingType = existingLoaderField == null ? void 0 : existingLoaderField.getSynthesizedType();
|
|
85642
|
+
if ((existingType == null ? void 0 : existingType.type) && (0, types_1.isModule)(existingType.type)) {
|
|
85643
|
+
importedModuleType = existingType.type;
|
|
85644
|
+
} else {
|
|
85645
|
+
const moduleName = moduleType.priv.moduleName ? moduleType.priv.moduleName + "." + name : "";
|
|
85646
|
+
importedModuleType = types_1.ModuleType.create(moduleName, implicitImport.uri);
|
|
85647
|
+
}
|
|
85340
85648
|
symbolType = applyLoaderActionsToModuleType(importedModuleType, implicitImport, importLookup2);
|
|
85341
85649
|
}
|
|
85342
|
-
|
|
85343
|
-
|
|
85650
|
+
if (!existingLoaderField) {
|
|
85651
|
+
const importedModuleSymbol = symbol_1.Symbol.createWithType(0, symbolType);
|
|
85652
|
+
moduleType.priv.loaderFields.set(name, importedModuleSymbol);
|
|
85653
|
+
}
|
|
85344
85654
|
});
|
|
85345
85655
|
}
|
|
85346
85656
|
return moduleType;
|
|
85347
85657
|
}
|
|
85348
85658
|
if (resolvedDecl.type === 8) {
|
|
85349
|
-
|
|
85350
|
-
if (resolvedDecl.
|
|
85351
|
-
|
|
85352
|
-
|
|
85353
|
-
|
|
85659
|
+
let moduleType;
|
|
85660
|
+
if (resolvedDecl.node.nodeType === 24) {
|
|
85661
|
+
const cachedType = readTypeCache(
|
|
85662
|
+
resolvedDecl.node.d.module,
|
|
85663
|
+
0
|
|
85664
|
+
/* EvalFlags.None */
|
|
85665
|
+
);
|
|
85666
|
+
if (cachedType && (0, types_1.isModule)(cachedType)) {
|
|
85667
|
+
moduleType = cachedType;
|
|
85668
|
+
}
|
|
85669
|
+
}
|
|
85670
|
+
if (!moduleType) {
|
|
85671
|
+
moduleType = types_1.ModuleType.create(resolvedDecl.moduleName, resolvedDecl.uri);
|
|
85672
|
+
if (resolvedDecl.node.nodeType === 24) {
|
|
85673
|
+
writeTypeCache(
|
|
85674
|
+
resolvedDecl.node.d.module,
|
|
85675
|
+
{ type: moduleType },
|
|
85676
|
+
0
|
|
85677
|
+
/* EvalFlags.None */
|
|
85678
|
+
);
|
|
85679
|
+
}
|
|
85354
85680
|
}
|
|
85681
|
+
return applyLoaderActionsToModuleType(moduleType, resolvedDecl.symbolName && resolvedDecl.submoduleFallback ? resolvedDecl.submoduleFallback : resolvedDecl, importLookup);
|
|
85355
85682
|
}
|
|
85356
85683
|
const declaredType = getTypeForDeclaration(resolvedDecl);
|
|
85357
85684
|
if (declaredType.type) {
|
|
@@ -85802,33 +86129,42 @@ var require_typeEvaluator = __commonJS({
|
|
|
85802
86129
|
}
|
|
85803
86130
|
}
|
|
85804
86131
|
}
|
|
85805
|
-
function getEffectiveReturnType(type
|
|
86132
|
+
function getEffectiveReturnType(type) {
|
|
86133
|
+
return getEffectiveReturnTypeResult(type).type;
|
|
86134
|
+
}
|
|
86135
|
+
function getInferredReturnType(type) {
|
|
86136
|
+
return getInferredReturnTypeResult(type).type;
|
|
86137
|
+
}
|
|
86138
|
+
function getEffectiveReturnTypeResult(type, options) {
|
|
85806
86139
|
const specializedReturnType = types_1.FunctionType.getEffectiveReturnType(
|
|
85807
86140
|
type,
|
|
85808
86141
|
/* includeInferred */
|
|
85809
86142
|
false
|
|
85810
86143
|
);
|
|
85811
86144
|
if (specializedReturnType && !(0, types_1.isUnknown)(specializedReturnType)) {
|
|
85812
|
-
return specializedReturnType;
|
|
86145
|
+
return { type: specializedReturnType };
|
|
85813
86146
|
}
|
|
85814
|
-
return
|
|
86147
|
+
return getInferredReturnTypeResult(type, options == null ? void 0 : options.callSiteInfo);
|
|
85815
86148
|
}
|
|
85816
|
-
function
|
|
85817
|
-
var _a, _b, _c;
|
|
86149
|
+
function _getInferredReturnTypeResult(type, callSiteInfo) {
|
|
86150
|
+
var _a, _b, _c, _d;
|
|
85818
86151
|
let returnType;
|
|
85819
86152
|
let isIncomplete = false;
|
|
85820
86153
|
const analyzeUnannotatedFunctions = true;
|
|
85821
86154
|
if (types_1.FunctionType.isStubDefinition(type)) {
|
|
85822
|
-
return types_1.UnknownType.create();
|
|
86155
|
+
return { type: types_1.UnknownType.create() };
|
|
85823
86156
|
}
|
|
85824
86157
|
if (types_1.FunctionType.isParamSpecValue(type)) {
|
|
85825
|
-
return types_1.UnknownType.create();
|
|
86158
|
+
return { type: types_1.UnknownType.create() };
|
|
85826
86159
|
}
|
|
85827
86160
|
if (types_1.FunctionType.isOverloaded(type) && !types_1.FunctionType.isSynthesizedMethod(type)) {
|
|
85828
|
-
return types_1.UnknownType.create();
|
|
86161
|
+
return { type: types_1.UnknownType.create() };
|
|
85829
86162
|
}
|
|
85830
|
-
|
|
85831
|
-
|
|
86163
|
+
const evalCount = ((_a = type.shared.inferredReturnType) == null ? void 0 : _a.evaluationCount) ?? 0;
|
|
86164
|
+
if (type.shared.inferredReturnType && !type.shared.inferredReturnType.isIncomplete) {
|
|
86165
|
+
returnType = type.shared.inferredReturnType.type;
|
|
86166
|
+
} else if (evalCount > maxReturnTypeInferenceAttempts) {
|
|
86167
|
+
returnType = types_1.UnknownType.create();
|
|
85832
86168
|
} else {
|
|
85833
86169
|
if (types_1.FunctionType.isInstanceMethod(type) && type.shared.name === "__init__") {
|
|
85834
86170
|
returnType = getNoneType();
|
|
@@ -85857,16 +86193,16 @@ var require_typeEvaluator = __commonJS({
|
|
|
85857
86193
|
if (type.shared.typeVarScopeId) {
|
|
85858
86194
|
typeVarScopes.push(type.shared.typeVarScopeId);
|
|
85859
86195
|
}
|
|
85860
|
-
if ((
|
|
86196
|
+
if ((_b = type.shared.methodClass) == null ? void 0 : _b.shared.typeVarScopeId) {
|
|
85861
86197
|
typeVarScopes.push(type.shared.methodClass.shared.typeVarScopeId);
|
|
85862
86198
|
}
|
|
85863
86199
|
returnType = (0, typeUtils_1.makeTypeVarsFree)(returnType, typeVarScopes);
|
|
85864
|
-
type.
|
|
86200
|
+
type.shared.inferredReturnType = { type: returnType, isIncomplete, evaluationCount: evalCount + 1 };
|
|
85865
86201
|
}
|
|
85866
86202
|
if (!isIncomplete && analyzeUnannotatedFunctions && (0, typeUtils_1.isPartlyUnknown)(returnType) && types_1.FunctionType.hasUnannotatedParams(type) && !types_1.FunctionType.isStubDefinition(type) && !types_1.FunctionType.isPyTypedDefinition(type) && callSiteInfo) {
|
|
85867
86203
|
let hasDecorators = false;
|
|
85868
86204
|
let isAsync = false;
|
|
85869
|
-
const declNode = (
|
|
86205
|
+
const declNode = (_c = type.shared.declaration) == null ? void 0 : _c.node;
|
|
85870
86206
|
if (declNode) {
|
|
85871
86207
|
if (declNode.d.decorators.length > 0) {
|
|
85872
86208
|
hasDecorators = true;
|
|
@@ -85879,14 +86215,14 @@ var require_typeEvaluator = __commonJS({
|
|
|
85879
86215
|
const contextualReturnType = inferReturnTypeForCallSite(type, callSiteInfo);
|
|
85880
86216
|
if (contextualReturnType) {
|
|
85881
86217
|
returnType = contextualReturnType;
|
|
85882
|
-
if ((
|
|
86218
|
+
if ((_d = type.shared.declaration) == null ? void 0 : _d.node) {
|
|
85883
86219
|
const liveScopeIds = ParseTreeUtils.getTypeVarScopesForNode(type.shared.declaration.node);
|
|
85884
86220
|
returnType = (0, typeUtils_1.makeTypeVarsFree)(returnType, liveScopeIds);
|
|
85885
86221
|
}
|
|
85886
86222
|
}
|
|
85887
86223
|
}
|
|
85888
86224
|
}
|
|
85889
|
-
return returnType;
|
|
86225
|
+
return { type: returnType, isIncomplete };
|
|
85890
86226
|
}
|
|
85891
86227
|
function inferReturnTypeForCallSite(type, callSiteInfo) {
|
|
85892
86228
|
const args = callSiteInfo.args;
|
|
@@ -86046,9 +86382,9 @@ var require_typeEvaluator = __commonJS({
|
|
|
86046
86382
|
typeResult.type = validateSymbolIsTypeExpression(errorNode, typeResult.type, !!typeResult.includesVariableDecl);
|
|
86047
86383
|
}
|
|
86048
86384
|
inferReturnTypeIfNecessary(typeResult.type);
|
|
86049
|
-
if (errorNode && selfClass && (0, types_1.isClass)(selfClass) && member.isInstanceMember && (0, types_1.isClass)(member.unspecializedClassType) && (flags & 1024) !== 0 && (0, typeUtils_1.requiresSpecialization)(typeResult.type, { ignoreSelf: true, ignoreImplicitTypeArgs: true })) {
|
|
86385
|
+
if (errorNode && selfClass && (0, types_1.isClass)(selfClass) && !selfClass.priv.includeSubclasses && member.isInstanceMember && (0, types_1.isClass)(member.unspecializedClassType) && (flags & 1024) !== 0 && (0, typeUtils_1.requiresSpecialization)(typeResult.type, { ignoreSelf: true, ignoreImplicitTypeArgs: true })) {
|
|
86050
86386
|
const specializedType = (0, typeUtils_1.partiallySpecializeType)(typeResult.type, member.unspecializedClassType, getTypeClassType(), (0, typeUtils_1.selfSpecializeClass)(selfClass, { overrideTypeArgs: true }));
|
|
86051
|
-
if ((0, types_1.findSubtype)(specializedType, (subtype) => !(0, types_1.
|
|
86387
|
+
if ((0, types_1.findSubtype)(specializedType, (subtype) => !(0, types_1.isFunctionOrOverloaded)(subtype) && (0, typeUtils_1.requiresSpecialization)(subtype, { ignoreSelf: true, ignoreImplicitTypeArgs: true }))) {
|
|
86052
86388
|
addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.genericInstanceVariableAccess(), errorNode);
|
|
86053
86389
|
}
|
|
86054
86390
|
}
|
|
@@ -86735,7 +87071,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
86735
87071
|
return false;
|
|
86736
87072
|
}
|
|
86737
87073
|
return true;
|
|
86738
|
-
} else if ((0, types_1.
|
|
87074
|
+
} else if ((0, types_1.isFunctionOrOverloaded)(concreteSrcType)) {
|
|
86739
87075
|
const destCallbackType = getCallbackProtocolType(destType, recursionCount);
|
|
86740
87076
|
if (destCallbackType) {
|
|
86741
87077
|
return assignType(destCallbackType, concreteSrcType, diag, constraints, flags, recursionCount);
|
|
@@ -86760,21 +87096,20 @@ var require_typeEvaluator = __commonJS({
|
|
|
86760
87096
|
}
|
|
86761
87097
|
const metaclass = concreteSrcType.shared.effectiveMetaclass;
|
|
86762
87098
|
if (metaclass) {
|
|
86763
|
-
if ((0, types_1.isAnyOrUnknown)(metaclass)) {
|
|
86764
|
-
|
|
86765
|
-
|
|
86766
|
-
|
|
86767
|
-
|
|
86768
|
-
|
|
86769
|
-
|
|
86770
|
-
|
|
86771
|
-
|
|
86772
|
-
|
|
86773
|
-
|
|
86774
|
-
|
|
86775
|
-
|
|
86776
|
-
|
|
86777
|
-
return true;
|
|
87099
|
+
if (!(0, types_1.isAnyOrUnknown)(metaclass)) {
|
|
87100
|
+
if (assignClass(
|
|
87101
|
+
types_1.ClassType.cloneAsInstantiable(destType),
|
|
87102
|
+
metaclass,
|
|
87103
|
+
/* diag */
|
|
87104
|
+
void 0,
|
|
87105
|
+
constraints,
|
|
87106
|
+
flags,
|
|
87107
|
+
recursionCount,
|
|
87108
|
+
/* reportErrorsUsingObjType */
|
|
87109
|
+
true
|
|
87110
|
+
)) {
|
|
87111
|
+
return true;
|
|
87112
|
+
}
|
|
86778
87113
|
}
|
|
86779
87114
|
}
|
|
86780
87115
|
} else if ((0, types_1.isAnyOrUnknown)(concreteSrcType) && !((_j = concreteSrcType.props) == null ? void 0 : _j.specialForm)) {
|
|
@@ -87031,10 +87366,8 @@ var require_typeEvaluator = __commonJS({
|
|
|
87031
87366
|
}
|
|
87032
87367
|
}
|
|
87033
87368
|
}
|
|
87034
|
-
if ((0, types_1.
|
|
87035
|
-
|
|
87036
|
-
return true;
|
|
87037
|
-
}
|
|
87369
|
+
if ((0, types_1.isFunctionOrOverloaded)(srcSubtype) && (0, types_1.isFunctionOrOverloaded)(destSubtype)) {
|
|
87370
|
+
return true;
|
|
87038
87371
|
}
|
|
87039
87372
|
return false;
|
|
87040
87373
|
});
|
|
@@ -87225,7 +87558,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
87225
87558
|
recursionCount
|
|
87226
87559
|
);
|
|
87227
87560
|
}
|
|
87228
|
-
function isTypeComparable(leftType, rightType) {
|
|
87561
|
+
function isTypeComparable(leftType, rightType, assumeIsOperator = false) {
|
|
87229
87562
|
var _a, _b;
|
|
87230
87563
|
if ((0, types_1.isAnyOrUnknown)(leftType) || (0, types_1.isAnyOrUnknown)(rightType)) {
|
|
87231
87564
|
return true;
|
|
@@ -87236,10 +87569,10 @@ var require_typeEvaluator = __commonJS({
|
|
|
87236
87569
|
if ((0, types_1.isModule)(leftType) || (0, types_1.isModule)(rightType)) {
|
|
87237
87570
|
return (0, types_1.isTypeSame)(leftType, rightType, { ignoreConditions: true });
|
|
87238
87571
|
}
|
|
87239
|
-
const isLeftCallable = (0, types_1.
|
|
87240
|
-
const isRightCallable = (0, types_1.
|
|
87241
|
-
if (isLeftCallable
|
|
87242
|
-
return
|
|
87572
|
+
const isLeftCallable = (0, types_1.isFunctionOrOverloaded)(leftType);
|
|
87573
|
+
const isRightCallable = (0, types_1.isFunctionOrOverloaded)(rightType);
|
|
87574
|
+
if (isLeftCallable || isRightCallable) {
|
|
87575
|
+
return true;
|
|
87243
87576
|
}
|
|
87244
87577
|
if ((0, types_1.isInstantiableClass)(leftType) || (0, types_1.isClassInstance)(leftType) && types_1.ClassType.isBuiltIn(leftType, "type")) {
|
|
87245
87578
|
if ((0, types_1.isInstantiableClass)(rightType) || (0, types_1.isClassInstance)(rightType) && types_1.ClassType.isBuiltIn(rightType, "type")) {
|
|
@@ -87285,6 +87618,12 @@ var require_typeEvaluator = __commonJS({
|
|
|
87285
87618
|
if (assignType(genericLeftType, genericRightType) || assignType(genericRightType, genericLeftType)) {
|
|
87286
87619
|
return true;
|
|
87287
87620
|
}
|
|
87621
|
+
if (assumeIsOperator && (0, typeUtils_1.isNoneInstance)(rightType)) {
|
|
87622
|
+
if ((0, typeUtils_1.isNoneInstance)(leftType)) {
|
|
87623
|
+
return true;
|
|
87624
|
+
}
|
|
87625
|
+
return assignType(leftType, rightType);
|
|
87626
|
+
}
|
|
87288
87627
|
if (types_1.ClassType.isBuiltIn(leftType) && types_1.ClassType.isBuiltIn(rightType) && types_1.TypeBase.isInstance(rightType)) {
|
|
87289
87628
|
let boolType;
|
|
87290
87629
|
let intType;
|
|
@@ -88095,58 +88434,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
88095
88434
|
}
|
|
88096
88435
|
return canAssign;
|
|
88097
88436
|
}
|
|
88098
|
-
function
|
|
88099
|
-
if (recursionCount > types_1.maxTypeRecursionCount) {
|
|
88100
|
-
return void 0;
|
|
88101
|
-
}
|
|
88102
|
-
recursionCount++;
|
|
88103
|
-
if (assignedType.shared.typeParams.length > 0 && assignedType.priv.typeArgs && assignedType.priv.typeArgs.length <= assignedType.shared.typeParams.length && !assignedType.priv.tupleTypeArgs) {
|
|
88104
|
-
const constraints = new constraintTracker_1.ConstraintTracker();
|
|
88105
|
-
(0, constraintSolver_1.addConstraintsForExpectedType)(evaluatorInterface, types_1.ClassType.specialize(
|
|
88106
|
-
assignedType,
|
|
88107
|
-
/* typeArgs */
|
|
88108
|
-
void 0
|
|
88109
|
-
), declaredType, constraints, ParseTreeUtils.getTypeVarScopesForNode(node), node.start);
|
|
88110
|
-
let replacedTypeArg = false;
|
|
88111
|
-
const solution = (0, constraintSolver_1.solveConstraints)(evaluatorInterface, constraints).getMainSolutionSet();
|
|
88112
|
-
const newTypeArgs = assignedType.priv.typeArgs.map((typeArg, index) => {
|
|
88113
|
-
const typeParam = assignedType.shared.typeParams[index];
|
|
88114
|
-
const expectedTypeArgType = solution.getType(typeParam);
|
|
88115
|
-
if (expectedTypeArgType) {
|
|
88116
|
-
if ((0, types_1.isAnyOrUnknown)(expectedTypeArgType) || (0, types_1.isAnyOrUnknown)(typeArg)) {
|
|
88117
|
-
replacedTypeArg = true;
|
|
88118
|
-
return expectedTypeArgType;
|
|
88119
|
-
}
|
|
88120
|
-
if ((0, types_1.isClassInstance)(expectedTypeArgType) && (0, types_1.isClassInstance)(typeArg)) {
|
|
88121
|
-
const recursiveReplacement = replaceTypeArgsWithAny(node, expectedTypeArgType, typeArg, recursionCount);
|
|
88122
|
-
if (recursiveReplacement) {
|
|
88123
|
-
replacedTypeArg = true;
|
|
88124
|
-
return recursiveReplacement;
|
|
88125
|
-
}
|
|
88126
|
-
} else if ((0, typeUtils_1.containsAnyRecursive)(expectedTypeArgType)) {
|
|
88127
|
-
const variance = types_1.TypeVarType.getVariance(typeParam);
|
|
88128
|
-
const isSubtype = assignType(expectedTypeArgType, typeArg);
|
|
88129
|
-
const isSupertype = assignType(typeArg, expectedTypeArgType);
|
|
88130
|
-
if ((variance === 4 || isSubtype) && (variance === 3 || isSupertype)) {
|
|
88131
|
-
replacedTypeArg = true;
|
|
88132
|
-
return expectedTypeArgType;
|
|
88133
|
-
}
|
|
88134
|
-
}
|
|
88135
|
-
}
|
|
88136
|
-
return typeArg;
|
|
88137
|
-
});
|
|
88138
|
-
if (replacedTypeArg) {
|
|
88139
|
-
return types_1.ClassType.specialize(assignedType, newTypeArgs);
|
|
88140
|
-
}
|
|
88141
|
-
}
|
|
88142
|
-
if (types_1.ClassType.isSameGenericClass(declaredType, assignedType)) {
|
|
88143
|
-
if ((0, typeUtils_1.containsAnyRecursive)(assignedType) && !(0, typeUtils_1.containsAnyRecursive)(declaredType)) {
|
|
88144
|
-
return declaredType;
|
|
88145
|
-
}
|
|
88146
|
-
}
|
|
88147
|
-
return void 0;
|
|
88148
|
-
}
|
|
88149
|
-
function narrowTypeBasedOnAssignment(node, declaredType, assignedTypeResult) {
|
|
88437
|
+
function narrowTypeBasedOnAssignment(declaredType, assignedTypeResult) {
|
|
88150
88438
|
const narrowedType = (0, typeUtils_1.mapSubtypes)(assignedTypeResult.type, (assignedSubtype) => {
|
|
88151
88439
|
if ((0, types_1.isClass)(assignedSubtype) && (0, typeUtils_1.isLiteralType)(assignedSubtype)) {
|
|
88152
88440
|
if ((0, types_1.isUnion)(declaredType) && types_1.UnionType.containsType(declaredType, assignedSubtype)) {
|
|
@@ -88154,33 +88442,24 @@ var require_typeEvaluator = __commonJS({
|
|
|
88154
88442
|
}
|
|
88155
88443
|
}
|
|
88156
88444
|
const narrowedSubtype = (0, typeUtils_1.mapSubtypes)(declaredType, (declaredSubtype) => {
|
|
88157
|
-
if ((
|
|
88158
|
-
return
|
|
88445
|
+
if (!assignType(declaredSubtype, assignedSubtype)) {
|
|
88446
|
+
return void 0;
|
|
88159
88447
|
}
|
|
88160
|
-
if (
|
|
88161
|
-
|
|
88162
|
-
|
|
88163
|
-
|
|
88164
|
-
if ((0, types_1.isClass)(
|
|
88165
|
-
const result = replaceTypeArgsWithAny(node, declaredSubtype, assignedSubtype);
|
|
88166
|
-
if (result) {
|
|
88167
|
-
assignedSubtype = result;
|
|
88168
|
-
}
|
|
88448
|
+
if ((0, types_1.isUnknown)(assignedSubtype)) {
|
|
88449
|
+
return assignedSubtype;
|
|
88450
|
+
}
|
|
88451
|
+
if (assignType(assignedSubtype, declaredSubtype)) {
|
|
88452
|
+
if ((0, types_1.isClass)(assignedSubtype) && assignedSubtype.priv.typedDictNarrowedEntries && (0, types_1.isTypeSame)(assignedSubtype, declaredSubtype, { ignoreTypedDictNarrowEntries: true })) {
|
|
88169
88453
|
return assignedSubtype;
|
|
88170
88454
|
}
|
|
88171
|
-
if (
|
|
88172
|
-
|
|
88173
|
-
|
|
88174
|
-
|
|
88175
|
-
assignedSubtype,
|
|
88176
|
-
/* includeUnknown */
|
|
88177
|
-
false
|
|
88178
|
-
) && !(0, typeUtils_1.containsAnyRecursive)(declaredSubtype)) {
|
|
88179
|
-
return declaredSubtype;
|
|
88455
|
+
if ((0, types_1.isClassInstance)(declaredSubtype) && types_1.ClassType.isProtocolClass(declaredSubtype)) {
|
|
88456
|
+
if ((0, types_1.isFunctionOrOverloaded)(assignedSubtype)) {
|
|
88457
|
+
return assignedSubtype;
|
|
88458
|
+
}
|
|
88180
88459
|
}
|
|
88181
|
-
return
|
|
88460
|
+
return declaredSubtype;
|
|
88182
88461
|
}
|
|
88183
|
-
return
|
|
88462
|
+
return assignedSubtype;
|
|
88184
88463
|
});
|
|
88185
88464
|
if ((0, types_1.isNever)(narrowedSubtype)) {
|
|
88186
88465
|
return assignedSubtype;
|
|
@@ -88188,14 +88467,14 @@ var require_typeEvaluator = __commonJS({
|
|
|
88188
88467
|
return narrowedSubtype;
|
|
88189
88468
|
});
|
|
88190
88469
|
if ((0, typeUtils_1.isIncompleteUnknown)(narrowedType)) {
|
|
88191
|
-
return { type: narrowedType };
|
|
88470
|
+
return { type: narrowedType, isIncomplete: assignedTypeResult.isIncomplete };
|
|
88192
88471
|
} else if ((0, types_1.isUnknown)(narrowedType)) {
|
|
88193
|
-
return { type: (0, types_1.combineTypes)([narrowedType, declaredType]) };
|
|
88472
|
+
return { type: (0, types_1.combineTypes)([narrowedType, declaredType]), isIncomplete: assignedTypeResult.isIncomplete };
|
|
88194
88473
|
}
|
|
88195
|
-
return { type: narrowedType };
|
|
88474
|
+
return { type: narrowedType, isIncomplete: assignedTypeResult.isIncomplete };
|
|
88196
88475
|
}
|
|
88197
88476
|
function validateOverrideMethod(baseMethod, overrideMethod, baseClass, diag, enforceParamNames = true) {
|
|
88198
|
-
if (!(0, types_1.
|
|
88477
|
+
if (!(0, types_1.isFunctionOrOverloaded)(baseMethod)) {
|
|
88199
88478
|
diag.addMessage(localize_1.LocAddendum.overrideType().format({ type: printType(baseMethod) }));
|
|
88200
88479
|
return false;
|
|
88201
88480
|
}
|
|
@@ -88243,9 +88522,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
88243
88522
|
overrideOverload,
|
|
88244
88523
|
/* diag */
|
|
88245
88524
|
void 0,
|
|
88246
|
-
enforceParamNames
|
|
88247
|
-
/* exemptSelfClsParam */
|
|
88248
|
-
false
|
|
88525
|
+
enforceParamNames
|
|
88249
88526
|
);
|
|
88250
88527
|
if (isCompatible && index <= previousMatchIndex && possibleMatchIndex === void 0) {
|
|
88251
88528
|
possibleMatchIndex = index;
|
|
@@ -88300,7 +88577,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
88300
88577
|
/* AssignTypeFlags.Default */
|
|
88301
88578
|
);
|
|
88302
88579
|
}
|
|
88303
|
-
function validateOverrideMethodInternal(baseMethod, overrideMethod, diag, enforceParamNames
|
|
88580
|
+
function validateOverrideMethodInternal(baseMethod, overrideMethod, diag, enforceParamNames) {
|
|
88304
88581
|
const baseParamDetails = (0, parameterUtils_1.getParamListDetails)(baseMethod);
|
|
88305
88582
|
const overrideParamDetails = (0, parameterUtils_1.getParamListDetails)(overrideMethod);
|
|
88306
88583
|
const constraints = new constraintTracker_1.ConstraintTracker();
|
|
@@ -88334,8 +88611,8 @@ var require_typeEvaluator = __commonJS({
|
|
|
88334
88611
|
baseParamDetails.params[i].type,
|
|
88335
88612
|
diag == null ? void 0 : diag.createAddendum(),
|
|
88336
88613
|
constraints,
|
|
88337
|
-
|
|
88338
|
-
/* AssignTypeFlags.
|
|
88614
|
+
0
|
|
88615
|
+
/* AssignTypeFlags.Default */
|
|
88339
88616
|
)) {
|
|
88340
88617
|
localize_1.LocAddendum.overrideParamType().format({
|
|
88341
88618
|
index: i + 1,
|
|
@@ -88363,7 +88640,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
88363
88640
|
}
|
|
88364
88641
|
const positionalParamCount = Math.min(baseParamDetails.positionParamCount, overrideParamDetails.positionParamCount);
|
|
88365
88642
|
for (let i = 0; i < positionalParamCount; i++) {
|
|
88366
|
-
if (i === 0
|
|
88643
|
+
if (i === 0) {
|
|
88367
88644
|
if (types_1.FunctionType.isInstanceMethod(overrideMethod) || types_1.FunctionType.isClassMethod(overrideMethod) || types_1.FunctionType.isConstructorMethod(overrideMethod)) {
|
|
88368
88645
|
continue;
|
|
88369
88646
|
}
|
|
@@ -88401,14 +88678,14 @@ var require_typeEvaluator = __commonJS({
|
|
|
88401
88678
|
const overrideParamType = overrideParamDetails.params[i].type;
|
|
88402
88679
|
const baseIsSynthesizedTypeVar = (0, types_1.isTypeVar)(baseParamType) && baseParamType.shared.isSynthesized;
|
|
88403
88680
|
const overrideIsSynthesizedTypeVar = (0, types_1.isTypeVar)(overrideParamType) && overrideParamType.shared.isSynthesized;
|
|
88404
|
-
if (!
|
|
88681
|
+
if (!baseIsSynthesizedTypeVar && !overrideIsSynthesizedTypeVar) {
|
|
88405
88682
|
if (baseParam.category !== overrideParam.category || !assignType(
|
|
88406
88683
|
overrideParamType,
|
|
88407
88684
|
baseParamType,
|
|
88408
88685
|
diag == null ? void 0 : diag.createAddendum(),
|
|
88409
88686
|
constraints,
|
|
88410
|
-
|
|
88411
|
-
/* AssignTypeFlags.
|
|
88687
|
+
0
|
|
88688
|
+
/* AssignTypeFlags.Default */
|
|
88412
88689
|
)) {
|
|
88413
88690
|
diag == null ? void 0 : diag.addMessage(localize_1.LocAddendum.overrideParamType().format({
|
|
88414
88691
|
index: i + 1,
|
|
@@ -88452,8 +88729,8 @@ var require_typeEvaluator = __commonJS({
|
|
|
88452
88729
|
baseParamType,
|
|
88453
88730
|
diag == null ? void 0 : diag.createAddendum(),
|
|
88454
88731
|
constraints,
|
|
88455
|
-
|
|
88456
|
-
/* AssignTypeFlags.
|
|
88732
|
+
0
|
|
88733
|
+
/* AssignTypeFlags.Default */
|
|
88457
88734
|
)) {
|
|
88458
88735
|
diag == null ? void 0 : diag.addMessage(localize_1.LocAddendum.overrideParamKeywordType().format({
|
|
88459
88736
|
name: overrideParamDetails.params[overrideParamDetails.argsIndex].param.name ?? "?",
|
|
@@ -88489,8 +88766,8 @@ var require_typeEvaluator = __commonJS({
|
|
|
88489
88766
|
paramInfo.type,
|
|
88490
88767
|
diag == null ? void 0 : diag.createAddendum(),
|
|
88491
88768
|
constraints,
|
|
88492
|
-
|
|
88493
|
-
/* AssignTypeFlags.
|
|
88769
|
+
0
|
|
88770
|
+
/* AssignTypeFlags.Default */
|
|
88494
88771
|
)) {
|
|
88495
88772
|
diag == null ? void 0 : diag.addMessage(localize_1.LocAddendum.overrideParamKeywordType().format({
|
|
88496
88773
|
name: paramInfo.param.name ?? "?",
|
|
@@ -88669,6 +88946,9 @@ var require_typeEvaluator = __commonJS({
|
|
|
88669
88946
|
true
|
|
88670
88947
|
);
|
|
88671
88948
|
}
|
|
88949
|
+
if (functionType.priv.strippedFirstParamType) {
|
|
88950
|
+
return functionType;
|
|
88951
|
+
}
|
|
88672
88952
|
if (types_1.FunctionType.isInstanceMethod(functionType)) {
|
|
88673
88953
|
if ((0, typeUtils_1.isInstantiableMetaclass)(baseType)) {
|
|
88674
88954
|
return functionType;
|
|
@@ -88721,6 +89001,18 @@ var require_typeEvaluator = __commonJS({
|
|
|
88721
89001
|
constraints.setBounds(memberTypeFirstParamType, types_1.TypeBase.isInstantiable(memberTypeFirstParamType) ? (0, typeUtils_1.convertToInstance)(firstParamType) : firstParamType);
|
|
88722
89002
|
} else {
|
|
88723
89003
|
const subDiag = diag == null ? void 0 : diag.createAddendum();
|
|
89004
|
+
if ((0, types_1.isFunctionOrOverloaded)(memberTypeFirstParamType)) {
|
|
89005
|
+
if ((0, types_1.isClassInstance)(firstParamType) && types_1.ClassType.isProtocolClass(firstParamType)) {
|
|
89006
|
+
if (subDiag) {
|
|
89007
|
+
subDiag.addMessage(localize_1.LocMessage.bindTypeMismatch().format({
|
|
89008
|
+
type: printType(firstParamType),
|
|
89009
|
+
methodName: memberType.shared.name || "<anonymous>",
|
|
89010
|
+
paramName: memberTypeFirstParam.name || "__p0"
|
|
89011
|
+
}));
|
|
89012
|
+
}
|
|
89013
|
+
return void 0;
|
|
89014
|
+
}
|
|
89015
|
+
}
|
|
88724
89016
|
if (!assignType(memberTypeFirstParamType, firstParamType, subDiag == null ? void 0 : subDiag.createAddendum(), constraints, 8192, recursionCount)) {
|
|
88725
89017
|
if (memberTypeFirstParam.name && !types_1.FunctionParam.isNameSynthesized(memberTypeFirstParam) && types_1.FunctionParam.isTypeDeclared(memberTypeFirstParam)) {
|
|
88726
89018
|
if (subDiag) {
|
|
@@ -88973,7 +89265,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
88973
89265
|
function printControlFlowGraph(flowNode, reference, callName, logger) {
|
|
88974
89266
|
return codeFlowEngine.printControlFlowGraph(flowNode, reference, callName, logger);
|
|
88975
89267
|
}
|
|
88976
|
-
const
|
|
89268
|
+
const getInferredReturnTypeResult = wrapWithLogger(_getInferredReturnTypeResult);
|
|
88977
89269
|
const evaluatorInterface = {
|
|
88978
89270
|
runWithCancellationToken,
|
|
88979
89271
|
getType,
|
|
@@ -89175,6 +89467,7 @@ var require_checker = __commonJS({
|
|
|
89175
89467
|
this._isUnboundCheckSuppressed = false;
|
|
89176
89468
|
this._scopedNodes = [];
|
|
89177
89469
|
this._typeParamLists = [];
|
|
89470
|
+
this._multipartImports = [];
|
|
89178
89471
|
this._moduleNode = parseResults.parseTree;
|
|
89179
89472
|
this._fileInfo = AnalyzerNodeInfo.getFileInfo(this._moduleNode);
|
|
89180
89473
|
}
|
|
@@ -89195,6 +89488,7 @@ var require_checker = __commonJS({
|
|
|
89195
89488
|
this._reportUnusedDunderAllSymbols(dunderAllInfo.stringNodes);
|
|
89196
89489
|
}
|
|
89197
89490
|
this._validateSymbolTables();
|
|
89491
|
+
this._reportUnusedMultipartImports();
|
|
89198
89492
|
this._reportDuplicateImports();
|
|
89199
89493
|
}
|
|
89200
89494
|
walk(node) {
|
|
@@ -89948,7 +90242,9 @@ var require_checker = __commonJS({
|
|
|
89948
90242
|
const typeResult = this._evaluator.getTypeResult(node.d.member);
|
|
89949
90243
|
const type = (typeResult == null ? void 0 : typeResult.type) ?? types_1.UnknownType.create();
|
|
89950
90244
|
const leftExprType = this._evaluator.getType(node.d.leftExpr);
|
|
89951
|
-
|
|
90245
|
+
const moduleName = leftExprType && (0, types_1.isModule)(leftExprType) ? leftExprType.priv.moduleName : void 0;
|
|
90246
|
+
const isImportedFromTyping = moduleName === "typing" || moduleName === "typing_extensions";
|
|
90247
|
+
this._reportDeprecatedUseForType(node.d.member, type, isImportedFromTyping);
|
|
89952
90248
|
if (typeResult == null ? void 0 : typeResult.memberAccessDeprecationInfo) {
|
|
89953
90249
|
this._reportDeprecatedUseForMemberAccess(node.d.member, typeResult.memberAccessDeprecationInfo);
|
|
89954
90250
|
}
|
|
@@ -89959,6 +90255,10 @@ var require_checker = __commonJS({
|
|
|
89959
90255
|
visitImportAs(node) {
|
|
89960
90256
|
this._conditionallyReportShadowedImport(node);
|
|
89961
90257
|
this._evaluator.evaluateTypesForStatement(node);
|
|
90258
|
+
const nameParts = node.d.module.d.nameParts;
|
|
90259
|
+
if (nameParts.length > 1 && !node.d.alias) {
|
|
90260
|
+
this._multipartImports.push(node);
|
|
90261
|
+
}
|
|
89962
90262
|
return true;
|
|
89963
90263
|
}
|
|
89964
90264
|
visitImportFrom(node) {
|
|
@@ -90013,7 +90313,8 @@ var require_checker = __commonJS({
|
|
|
90013
90313
|
let isImportFromTyping = false;
|
|
90014
90314
|
if (((_b = node.parent) == null ? void 0 : _b.nodeType) === 25) {
|
|
90015
90315
|
if (node.parent.d.module.d.leadingDots === 0 && node.parent.d.module.d.nameParts.length === 1) {
|
|
90016
|
-
|
|
90316
|
+
const namePart = node.parent.d.module.d.nameParts[0].d.value;
|
|
90317
|
+
if (namePart === "typing" || namePart === "typing_extensions") {
|
|
90017
90318
|
isImportFromTyping = true;
|
|
90018
90319
|
}
|
|
90019
90320
|
}
|
|
@@ -90103,6 +90404,49 @@ var require_checker = __commonJS({
|
|
|
90103
90404
|
}
|
|
90104
90405
|
return false;
|
|
90105
90406
|
}
|
|
90407
|
+
_reportUnusedMultipartImports() {
|
|
90408
|
+
this._multipartImports.forEach((node) => {
|
|
90409
|
+
const nameParts = node.d.module.d.nameParts;
|
|
90410
|
+
if (this._isMultipartImportUnused(node)) {
|
|
90411
|
+
const multipartName = nameParts.map((np) => np.d.value).join(".");
|
|
90412
|
+
let textRange = { start: nameParts[0].start, length: nameParts[0].length };
|
|
90413
|
+
textRange = textRange_1.TextRange.extend(textRange, nameParts[nameParts.length - 1]);
|
|
90414
|
+
this._fileInfo.diagnosticSink.addUnusedCodeWithTextRange(localize_1.LocMessage.unaccessedSymbol().format({ name: multipartName }), textRange, {
|
|
90415
|
+
action: "pyright.unusedImport"
|
|
90416
|
+
/* Commands.unusedImport */
|
|
90417
|
+
});
|
|
90418
|
+
this._evaluator.addDiagnosticForTextRange(this._fileInfo, diagnosticRules_1.DiagnosticRule.reportUnusedImport, localize_1.LocMessage.unaccessedImport().format({ name: multipartName }), textRange);
|
|
90419
|
+
}
|
|
90420
|
+
});
|
|
90421
|
+
}
|
|
90422
|
+
_isMultipartImportUnused(node) {
|
|
90423
|
+
var _a;
|
|
90424
|
+
const nameParts = node.d.module.d.nameParts;
|
|
90425
|
+
(0, debug_1.assert)(nameParts.length > 1);
|
|
90426
|
+
let moduleType = (_a = this._evaluator.evaluateTypeForSubnode(node, () => {
|
|
90427
|
+
this._evaluator.evaluateTypesForStatement(node);
|
|
90428
|
+
})) == null ? void 0 : _a.type;
|
|
90429
|
+
if (!moduleType || !(0, types_1.isModule)(moduleType)) {
|
|
90430
|
+
return false;
|
|
90431
|
+
}
|
|
90432
|
+
for (let i = 1; i < nameParts.length - 1; i++) {
|
|
90433
|
+
const symbol2 = types_1.ModuleType.getField(moduleType, nameParts[i].d.value);
|
|
90434
|
+
if (!symbol2) {
|
|
90435
|
+
return false;
|
|
90436
|
+
}
|
|
90437
|
+
const submoduleType = symbol2.getSynthesizedType();
|
|
90438
|
+
if (!submoduleType || !(0, types_1.isModule)(submoduleType.type)) {
|
|
90439
|
+
return false;
|
|
90440
|
+
}
|
|
90441
|
+
moduleType = submoduleType.type;
|
|
90442
|
+
}
|
|
90443
|
+
const lastPartName = nameParts[nameParts.length - 1].d.value;
|
|
90444
|
+
const symbol = types_1.ModuleType.getField(moduleType, lastPartName);
|
|
90445
|
+
if (!symbol) {
|
|
90446
|
+
return false;
|
|
90447
|
+
}
|
|
90448
|
+
return !this._fileInfo.accessedSymbolSet.has(symbol.id);
|
|
90449
|
+
}
|
|
90106
90450
|
_getImportResult(node, uri) {
|
|
90107
90451
|
const execEnv = this._importResolver.getConfigOptions().findExecEnvironment(uri);
|
|
90108
90452
|
const moduleNameNode = node.parent.d.module;
|
|
@@ -90186,7 +90530,7 @@ var require_checker = __commonJS({
|
|
|
90186
90530
|
let isCoroutine = true;
|
|
90187
90531
|
(0, typeUtils_1.doForEachSubtype)(exprTypeResult.type, (subtype) => {
|
|
90188
90532
|
subtype = this._evaluator.makeTopLevelTypeVarsConcrete(subtype);
|
|
90189
|
-
if (!(0, types_1.
|
|
90533
|
+
if (!(0, types_1.isFunctionOrOverloaded)(subtype)) {
|
|
90190
90534
|
isExprFunction = false;
|
|
90191
90535
|
}
|
|
90192
90536
|
if (!(0, types_1.isClassInstance)(subtype) || !types_1.ClassType.isBuiltIn(subtype, ["Coroutine", "CoroutineType"])) {
|
|
@@ -90317,6 +90661,7 @@ var require_checker = __commonJS({
|
|
|
90317
90661
|
// have overlapping types.
|
|
90318
90662
|
_validateComparisonTypes(node) {
|
|
90319
90663
|
let rightExpression = node.d.rightExpr;
|
|
90664
|
+
const assumeIsOperator = node.d.operator === 39 || node.d.operator === 40;
|
|
90320
90665
|
if (rightExpression.nodeType === 7 && !rightExpression.d.hasParens && ParseTreeUtils.operatorSupportsChaining(rightExpression.d.operator)) {
|
|
90321
90666
|
rightExpression = rightExpression.d.leftExpr;
|
|
90322
90667
|
}
|
|
@@ -90361,7 +90706,7 @@ var require_checker = __commonJS({
|
|
|
90361
90706
|
if (isComparable) {
|
|
90362
90707
|
return;
|
|
90363
90708
|
}
|
|
90364
|
-
if (this._evaluator.isTypeComparable(leftSubtype, rightSubtype)) {
|
|
90709
|
+
if (this._evaluator.isTypeComparable(leftSubtype, rightSubtype, assumeIsOperator)) {
|
|
90365
90710
|
isComparable = true;
|
|
90366
90711
|
}
|
|
90367
90712
|
return rightSubtype;
|
|
@@ -91372,16 +91717,10 @@ var require_checker = __commonJS({
|
|
|
91372
91717
|
}
|
|
91373
91718
|
} else {
|
|
91374
91719
|
const nameParts = decl.node.d.module.d.nameParts;
|
|
91375
|
-
if (nameParts.length
|
|
91376
|
-
|
|
91377
|
-
|
|
91378
|
-
|
|
91379
|
-
this._fileInfo.diagnosticSink.addUnusedCodeWithTextRange(localize_1.LocMessage.unaccessedSymbol().format({ name: multipartName }), textRange, {
|
|
91380
|
-
action: "pyright.unusedImport"
|
|
91381
|
-
/* Commands.unusedImport */
|
|
91382
|
-
});
|
|
91383
|
-
this._evaluator.addDiagnosticForTextRange(this._fileInfo, diagnosticRules_1.DiagnosticRule.reportUnusedImport, localize_1.LocMessage.unaccessedImport().format({ name: multipartName }), textRange);
|
|
91384
|
-
return;
|
|
91720
|
+
if (nameParts.length === 1) {
|
|
91721
|
+
nameNode = nameParts[0];
|
|
91722
|
+
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportUnusedImport, localize_1.LocMessage.unaccessedImport().format({ name: nameNode.d.value }), nameNode);
|
|
91723
|
+
message = localize_1.LocMessage.unaccessedImport().format({ name: nameNode.d.value });
|
|
91385
91724
|
}
|
|
91386
91725
|
}
|
|
91387
91726
|
} else if (decl.node.nodeType === 26) {
|
|
@@ -91594,7 +91933,7 @@ var require_checker = __commonJS({
|
|
|
91594
91933
|
_isTypeSupportedTypeForIsInstance(type, isInstanceCheck, diag) {
|
|
91595
91934
|
let isSupported = true;
|
|
91596
91935
|
(0, typeUtils_1.doForEachSubtype)(type, (subtype) => {
|
|
91597
|
-
var _a, _b;
|
|
91936
|
+
var _a, _b, _c;
|
|
91598
91937
|
subtype = this._evaluator.makeTopLevelTypeVarsConcrete(subtype);
|
|
91599
91938
|
subtype = (0, typeUtils_1.transformPossibleRecursiveTypeAlias)(subtype);
|
|
91600
91939
|
if (((_a = subtype.props) == null ? void 0 : _a.specialForm) && types_1.ClassType.isBuiltIn(subtype.props.specialForm, "TypeAliasType")) {
|
|
@@ -91635,6 +91974,9 @@ var require_checker = __commonJS({
|
|
|
91635
91974
|
} else if (((_b = subtype.props) == null ? void 0 : _b.specialForm) && (0, types_1.isClassInstance)(subtype.props.specialForm) && types_1.ClassType.isBuiltIn(subtype.props.specialForm, "Annotated")) {
|
|
91636
91975
|
diag.addMessage(localize_1.LocAddendum.annotatedNotAllowed());
|
|
91637
91976
|
isSupported = false;
|
|
91977
|
+
} else if (((_c = subtype.props) == null ? void 0 : _c.specialForm) && (0, types_1.isInstantiableClass)(subtype.props.specialForm) && types_1.ClassType.isBuiltIn(subtype.props.specialForm, "Literal")) {
|
|
91978
|
+
diag.addMessage(localize_1.LocAddendum.literalNotAllowed());
|
|
91979
|
+
isSupported = false;
|
|
91638
91980
|
}
|
|
91639
91981
|
break;
|
|
91640
91982
|
case 4:
|
|
@@ -92102,7 +92444,7 @@ var require_checker = __commonJS({
|
|
|
92102
92444
|
}
|
|
92103
92445
|
if (declaredReturnType && !functionNeverReturns && implicitlyReturnsNone) {
|
|
92104
92446
|
if ((0, types_1.isNever)(declaredReturnType)) {
|
|
92105
|
-
if (!ParseTreeUtils.isSuiteEmpty(node.d.suite) && !types_1.FunctionType.isOverloaded(functionType)
|
|
92447
|
+
if (!ParseTreeUtils.isSuiteEmpty(node.d.suite) && !types_1.FunctionType.isOverloaded(functionType)) {
|
|
92106
92448
|
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportReturnType, localize_1.LocMessage.noReturnReturnsNone(), returnAnnotation);
|
|
92107
92449
|
}
|
|
92108
92450
|
} else if (!types_1.FunctionType.isAbstractMethod(functionType)) {
|
|
@@ -92615,7 +92957,7 @@ var require_checker = __commonJS({
|
|
|
92615
92957
|
return;
|
|
92616
92958
|
}
|
|
92617
92959
|
let newMemberType = newMethodResult.type;
|
|
92618
|
-
if (!(0, types_1.
|
|
92960
|
+
if (!(0, types_1.isFunctionOrOverloaded)(newMemberType)) {
|
|
92619
92961
|
return;
|
|
92620
92962
|
}
|
|
92621
92963
|
if ((0, types_1.isOverloaded)(newMemberType)) {
|
|
@@ -92625,7 +92967,7 @@ var require_checker = __commonJS({
|
|
|
92625
92967
|
}
|
|
92626
92968
|
}
|
|
92627
92969
|
let initMemberType = initMethodResult.type;
|
|
92628
|
-
if (!(0, types_1.
|
|
92970
|
+
if (!(0, types_1.isFunctionOrOverloaded)(initMemberType)) {
|
|
92629
92971
|
return;
|
|
92630
92972
|
}
|
|
92631
92973
|
if ((0, types_1.isOverloaded)(initMemberType)) {
|
|
@@ -92796,9 +93138,9 @@ var require_checker = __commonJS({
|
|
|
92796
93138
|
let diag;
|
|
92797
93139
|
const overrideDecl = (0, symbolUtils_1.getLastTypedDeclarationForSymbol)(overrideClassAndSymbol.symbol);
|
|
92798
93140
|
const overriddenDecl = (0, symbolUtils_1.getLastTypedDeclarationForSymbol)(overriddenClassAndSymbol.symbol);
|
|
92799
|
-
if ((0, types_1.
|
|
93141
|
+
if ((0, types_1.isFunctionOrOverloaded)(overriddenType)) {
|
|
92800
93142
|
const diagAddendum = new diagnostic_1.DiagnosticAddendum();
|
|
92801
|
-
if ((0, types_1.
|
|
93143
|
+
if ((0, types_1.isFunctionOrOverloaded)(overrideType)) {
|
|
92802
93144
|
if (!this._evaluator.validateOverrideMethod(
|
|
92803
93145
|
overriddenType,
|
|
92804
93146
|
overrideType,
|
|
@@ -93254,13 +93596,14 @@ var require_checker = __commonJS({
|
|
|
93254
93596
|
}
|
|
93255
93597
|
const baseClass = baseClassAndSymbol.classType;
|
|
93256
93598
|
const childClassSelf = types_1.ClassType.cloneAsInstance((0, typeUtils_1.selfSpecializeClass)(childClassType, { useBoundTypeVars: true }));
|
|
93257
|
-
|
|
93599
|
+
const baseClassSelf = types_1.ClassType.isProtocolClass(baseClass) ? childClassSelf : types_1.ClassType.cloneAsInstance((0, typeUtils_1.selfSpecializeClass)(baseClass, { useBoundTypeVars: true }));
|
|
93600
|
+
let baseType = (0, typeUtils_1.partiallySpecializeType)(this._evaluator.getEffectiveTypeOfSymbol(baseClassAndSymbol.symbol), baseClass, this._evaluator.getTypeClassType(), baseClassSelf);
|
|
93258
93601
|
overrideType = (0, typeUtils_1.partiallySpecializeType)(overrideType, childClassType, this._evaluator.getTypeClassType(), childClassSelf);
|
|
93259
93602
|
if (childClassType.shared.typeVarScopeId) {
|
|
93260
93603
|
overrideType = (0, typeUtils_1.makeTypeVarsBound)(overrideType, [childClassType.shared.typeVarScopeId]);
|
|
93261
93604
|
baseType = (0, typeUtils_1.makeTypeVarsBound)(baseType, [childClassType.shared.typeVarScopeId]);
|
|
93262
93605
|
}
|
|
93263
|
-
if ((0, types_1.
|
|
93606
|
+
if ((0, types_1.isFunctionOrOverloaded)(baseType)) {
|
|
93264
93607
|
const diagAddendum = new diagnostic_1.DiagnosticAddendum();
|
|
93265
93608
|
if (this._isFinalFunction(memberName, baseType)) {
|
|
93266
93609
|
const decl = (0, symbolUtils_1.getLastTypedDeclarationForSymbol)(overrideSymbol);
|
|
@@ -93278,7 +93621,7 @@ var require_checker = __commonJS({
|
|
|
93278
93621
|
if (this._isMethodExemptFromLsp(memberName) || SymbolNameUtils.isPrivateName(memberName) || types_1.ClassType.isTypedDictClass(childClassType)) {
|
|
93279
93622
|
return;
|
|
93280
93623
|
}
|
|
93281
|
-
if ((0, types_1.
|
|
93624
|
+
if ((0, types_1.isFunctionOrOverloaded)(overrideType)) {
|
|
93282
93625
|
const enforceParamNameMatch = !SymbolNameUtils.isDunderName(memberName);
|
|
93283
93626
|
if (this._evaluator.validateOverrideMethod(baseType, overrideType, childClassType, diagAddendum, enforceParamNameMatch)) {
|
|
93284
93627
|
return;
|
|
@@ -94702,7 +95045,8 @@ var require_sourceFile = __commonJS({
|
|
|
94702
95045
|
importedModules: [],
|
|
94703
95046
|
futureImports: /* @__PURE__ */ new Set(),
|
|
94704
95047
|
containsWildcardImport: false,
|
|
94705
|
-
typingSymbolAliases: /* @__PURE__ */ new Map()
|
|
95048
|
+
typingSymbolAliases: /* @__PURE__ */ new Map(),
|
|
95049
|
+
hasTypeAnnotations: false
|
|
94706
95050
|
};
|
|
94707
95051
|
this._writableData.tokenizerLines = new textRangeCollection_1.TextRangeCollection([]);
|
|
94708
95052
|
this._writableData.tokenizerOutput = {
|
|
@@ -95238,6 +95582,8 @@ var require_parser = __commonJS({
|
|
|
95238
95582
|
this._isParsingTypeAnnotation = false;
|
|
95239
95583
|
this._isParsingIndexTrailer = false;
|
|
95240
95584
|
this._isParsingQuotedText = false;
|
|
95585
|
+
this._isInFinallyBlock = false;
|
|
95586
|
+
this._isInFinallyLoop = false;
|
|
95241
95587
|
this._futureImports = /* @__PURE__ */ new Set();
|
|
95242
95588
|
this._importedModules = [];
|
|
95243
95589
|
this._containsWildcardImport = false;
|
|
@@ -95245,8 +95591,10 @@ var require_parser = __commonJS({
|
|
|
95245
95591
|
this._typingImportAliases = [];
|
|
95246
95592
|
this._typingSymbolAliases = /* @__PURE__ */ new Map();
|
|
95247
95593
|
this._maxChildDepthMap = /* @__PURE__ */ new Map();
|
|
95594
|
+
this._hasTypeAnnotations = false;
|
|
95248
95595
|
}
|
|
95249
95596
|
parseSourceFile(fileContents, parseOptions, diagSink) {
|
|
95597
|
+
this._hasTypeAnnotations = false;
|
|
95250
95598
|
timing_1.timingStats.tokenizeFileTime.timeOperation(() => {
|
|
95251
95599
|
this._startNewParse(fileContents, 0, fileContents.length, parseOptions, diagSink);
|
|
95252
95600
|
});
|
|
@@ -95288,7 +95636,8 @@ var require_parser = __commonJS({
|
|
|
95288
95636
|
importedModules: this._importedModules,
|
|
95289
95637
|
futureImports: this._futureImports,
|
|
95290
95638
|
containsWildcardImport: this._containsWildcardImport,
|
|
95291
|
-
typingSymbolAliases: this._typingSymbolAliases
|
|
95639
|
+
typingSymbolAliases: this._typingSymbolAliases,
|
|
95640
|
+
hasTypeAnnotations: this._hasTypeAnnotations
|
|
95292
95641
|
},
|
|
95293
95642
|
tokenizerOutput: this._tokenizerOutput
|
|
95294
95643
|
};
|
|
@@ -96296,6 +96645,8 @@ var require_parser = __commonJS({
|
|
|
96296
96645
|
_parseLoopSuite() {
|
|
96297
96646
|
const wasInLoop = this._isInLoop;
|
|
96298
96647
|
this._isInLoop = true;
|
|
96648
|
+
const wasInFinallyLoop = this._isInFinallyLoop;
|
|
96649
|
+
this._isInFinallyLoop = false;
|
|
96299
96650
|
let typeComment;
|
|
96300
96651
|
const suite = this._parseSuite(
|
|
96301
96652
|
this._isInFunction,
|
|
@@ -96309,6 +96660,7 @@ var require_parser = __commonJS({
|
|
|
96309
96660
|
}
|
|
96310
96661
|
);
|
|
96311
96662
|
this._isInLoop = wasInLoop;
|
|
96663
|
+
this._isInFinallyLoop = wasInFinallyLoop;
|
|
96312
96664
|
if (typeComment) {
|
|
96313
96665
|
suite.d.typeComment = typeComment;
|
|
96314
96666
|
}
|
|
@@ -96736,7 +97088,13 @@ var require_parser = __commonJS({
|
|
|
96736
97088
|
16
|
|
96737
97089
|
/* KeywordType.Finally */
|
|
96738
97090
|
)) {
|
|
97091
|
+
const wasInFinallyBlock = this._isInFinallyBlock;
|
|
97092
|
+
const wasInFinallyLoop = this._isInFinallyLoop;
|
|
97093
|
+
this._isInFinallyBlock = true;
|
|
97094
|
+
this._isInFinallyLoop = this._isInLoop;
|
|
96739
97095
|
tryNode.d.finallySuite = this._parseSuite(this._isInFunction);
|
|
97096
|
+
this._isInFinallyBlock = wasInFinallyBlock;
|
|
97097
|
+
this._isInFinallyLoop = wasInFinallyLoop;
|
|
96740
97098
|
tryNode.d.finallySuite.parent = tryNode;
|
|
96741
97099
|
(0, parseNodes_1.extendRange)(tryNode, tryNode.d.finallySuite);
|
|
96742
97100
|
}
|
|
@@ -96798,6 +97156,10 @@ var require_parser = __commonJS({
|
|
|
96798
97156
|
let functionTypeAnnotationToken;
|
|
96799
97157
|
const wasInExceptionGroup = this._isInExceptionGroup;
|
|
96800
97158
|
this._isInExceptionGroup = false;
|
|
97159
|
+
const wasInFinallyBlock = this._isInFinallyBlock;
|
|
97160
|
+
const wasInFinallyLoop = this._isInFinallyLoop;
|
|
97161
|
+
this._isInFinallyBlock = false;
|
|
97162
|
+
this._isInFinallyLoop = false;
|
|
96801
97163
|
const suite = this._parseSuite(
|
|
96802
97164
|
/* isFunction */
|
|
96803
97165
|
true,
|
|
@@ -96809,6 +97171,8 @@ var require_parser = __commonJS({
|
|
|
96809
97171
|
}
|
|
96810
97172
|
);
|
|
96811
97173
|
this._isInExceptionGroup = wasInExceptionGroup;
|
|
97174
|
+
this._isInFinallyBlock = wasInFinallyBlock;
|
|
97175
|
+
this._isInFinallyLoop = wasInFinallyLoop;
|
|
96812
97176
|
const functionNode = parseNodes_1.FunctionNode.create(defToken, parseNodes_1.NameNode.create(nameToken), suite, typeParameters);
|
|
96813
97177
|
if (asyncToken) {
|
|
96814
97178
|
functionNode.d.isAsync = true;
|
|
@@ -97305,6 +97669,9 @@ var require_parser = __commonJS({
|
|
|
97305
97669
|
} else if (this._isInExceptionGroup) {
|
|
97306
97670
|
this._addSyntaxError(localize_1.LocMessage.breakInExceptionGroup(), breakToken);
|
|
97307
97671
|
}
|
|
97672
|
+
if (this._isInFinallyLoop && pythonVersion_1.PythonVersion.isGreaterOrEqualTo(this._getLanguageVersion(), pythonVersion_1.pythonVersion3_14)) {
|
|
97673
|
+
this._addSyntaxError(localize_1.LocMessage.finallyBreak(), breakToken);
|
|
97674
|
+
}
|
|
97308
97675
|
return parseNodes_1.BreakNode.create(breakToken);
|
|
97309
97676
|
}
|
|
97310
97677
|
_parseContinueStatement() {
|
|
@@ -97317,6 +97684,9 @@ var require_parser = __commonJS({
|
|
|
97317
97684
|
} else if (this._isInExceptionGroup) {
|
|
97318
97685
|
this._addSyntaxError(localize_1.LocMessage.continueInExceptionGroup(), continueToken);
|
|
97319
97686
|
}
|
|
97687
|
+
if (this._isInFinallyLoop && pythonVersion_1.PythonVersion.isGreaterOrEqualTo(this._getLanguageVersion(), pythonVersion_1.pythonVersion3_14)) {
|
|
97688
|
+
this._addSyntaxError(localize_1.LocMessage.finallyContinue(), continueToken);
|
|
97689
|
+
}
|
|
97320
97690
|
return parseNodes_1.ContinueNode.create(continueToken);
|
|
97321
97691
|
}
|
|
97322
97692
|
// return_stmt: 'return' [testlist]
|
|
@@ -97331,6 +97701,9 @@ var require_parser = __commonJS({
|
|
|
97331
97701
|
} else if (this._isInExceptionGroup) {
|
|
97332
97702
|
this._addSyntaxError(localize_1.LocMessage.returnInExceptionGroup(), returnToken);
|
|
97333
97703
|
}
|
|
97704
|
+
if (this._isInFinallyBlock && pythonVersion_1.PythonVersion.isGreaterOrEqualTo(this._getLanguageVersion(), pythonVersion_1.pythonVersion3_14)) {
|
|
97705
|
+
this._addSyntaxError(localize_1.LocMessage.finallyReturn(), returnToken);
|
|
97706
|
+
}
|
|
97334
97707
|
if (!this._isNextTokenNeverExpression()) {
|
|
97335
97708
|
const returnExpr = this._parseTestOrStarListAsExpression(
|
|
97336
97709
|
/* allowAssignmentExpression */
|
|
@@ -99323,6 +99696,7 @@ var require_parser = __commonJS({
|
|
|
99323
99696
|
result = parseNodes_1.UnpackNode.create(startToken, result);
|
|
99324
99697
|
}
|
|
99325
99698
|
this._isParsingTypeAnnotation = wasParsingTypeAnnotation;
|
|
99699
|
+
this._hasTypeAnnotations = true;
|
|
99326
99700
|
return result;
|
|
99327
99701
|
}
|
|
99328
99702
|
_reportStringTokenErrors(stringToken, unescapedResult) {
|
|
@@ -106016,7 +106390,7 @@ var require_AnimationFrameAction = __commonJS({
|
|
|
106016
106390
|
return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
|
|
106017
106391
|
}
|
|
106018
106392
|
var actions = scheduler.actions;
|
|
106019
|
-
if (id != null && ((_a = actions[actions.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== id) {
|
|
106393
|
+
if (id != null && id === scheduler._scheduled && ((_a = actions[actions.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== id) {
|
|
106020
106394
|
animationFrameProvider_1.animationFrameProvider.cancelAnimationFrame(id);
|
|
106021
106395
|
scheduler._scheduled = void 0;
|
|
106022
106396
|
}
|
|
@@ -106061,8 +106435,13 @@ var require_AnimationFrameScheduler = __commonJS({
|
|
|
106061
106435
|
}
|
|
106062
106436
|
AnimationFrameScheduler2.prototype.flush = function(action) {
|
|
106063
106437
|
this._active = true;
|
|
106064
|
-
var flushId
|
|
106065
|
-
|
|
106438
|
+
var flushId;
|
|
106439
|
+
if (action) {
|
|
106440
|
+
flushId = action.id;
|
|
106441
|
+
} else {
|
|
106442
|
+
flushId = this._scheduled;
|
|
106443
|
+
this._scheduled = void 0;
|
|
106444
|
+
}
|
|
106066
106445
|
var actions = this.actions;
|
|
106067
106446
|
var error;
|
|
106068
106447
|
action = action || actions.shift();
|
|
@@ -110546,7 +110925,6 @@ var require_merge2 = __commonJS({
|
|
|
110546
110925
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
110547
110926
|
exports2.merge = void 0;
|
|
110548
110927
|
var lift_1 = require_lift();
|
|
110549
|
-
var argsOrArgArray_1 = require_argsOrArgArray();
|
|
110550
110928
|
var mergeAll_1 = require_mergeAll();
|
|
110551
110929
|
var args_1 = require_args();
|
|
110552
110930
|
var from_1 = require_from();
|
|
@@ -110557,7 +110935,6 @@ var require_merge2 = __commonJS({
|
|
|
110557
110935
|
}
|
|
110558
110936
|
var scheduler = args_1.popScheduler(args);
|
|
110559
110937
|
var concurrent = args_1.popNumber(args, Infinity);
|
|
110560
|
-
args = argsOrArgArray_1.argsOrArgArray(args);
|
|
110561
110938
|
return lift_1.operate(function(source, subscriber) {
|
|
110562
110939
|
mergeAll_1.mergeAll(concurrent)(from_1.from(__spreadArray([source], __read(args)), scheduler)).subscribe(subscriber);
|
|
110563
110940
|
});
|
|
@@ -115805,6 +116182,9 @@ var PythonCodeActionProvider = class {
|
|
|
115805
116182
|
ignoreAction(document, range) {
|
|
115806
116183
|
const ignoreTxt = "# type: ignore";
|
|
115807
116184
|
const doc = import_coc4.workspace.getDocument(document.uri);
|
|
116185
|
+
if (!doc) {
|
|
116186
|
+
return null;
|
|
116187
|
+
}
|
|
115808
116188
|
if (this.wholeRange(document, range)) {
|
|
115809
116189
|
let pos = import_coc4.Position.create(0, 0);
|
|
115810
116190
|
if (doc.getline(0).startsWith("#!")) pos = import_coc4.Position.create(1, 0);
|
|
@@ -116897,7 +117277,7 @@ var TypeInlayHintsProvider = class {
|
|
|
116897
117277
|
});
|
|
116898
117278
|
import_coc11.workspace.onDidChangeTextDocument((e) => {
|
|
116899
117279
|
const doc = import_coc11.workspace.getDocument(e.bufnr);
|
|
116900
|
-
if (doc.languageId === "python") {
|
|
117280
|
+
if ((doc == null ? void 0 : doc.languageId) === "python") {
|
|
116901
117281
|
this._onDidChangeInlayHints.fire();
|
|
116902
117282
|
}
|
|
116903
117283
|
});
|
|
@@ -118911,6 +119291,9 @@ var PyDocStyle = class extends BaseLinter {
|
|
|
118911
119291
|
outputLines.push(oldOutputLines[2 * counter] + oldOutputLines[2 * counter + 1]);
|
|
118912
119292
|
}
|
|
118913
119293
|
const doc = import_coc21.workspace.getDocument(document.uri);
|
|
119294
|
+
if (!doc) {
|
|
119295
|
+
return [];
|
|
119296
|
+
}
|
|
118914
119297
|
return outputLines.filter((value, index) => index < maxLines && value.indexOf(":") >= 0).map((line) => {
|
|
118915
119298
|
if (this.isWindows) {
|
|
118916
119299
|
return line.substring(line.indexOf(`${baseFileName}:`) + baseFileName.length + 1).trim();
|
|
@@ -119304,14 +119687,15 @@ var LintingEngine = class {
|
|
|
119304
119687
|
this.diagnosticCollection.set(document.uri, diagnostics);
|
|
119305
119688
|
}
|
|
119306
119689
|
createDiagnostics(message, document) {
|
|
119690
|
+
var _a;
|
|
119307
119691
|
let start = import_coc27.Position.create(message.line > 0 ? message.line - 1 : 0, message.column);
|
|
119308
119692
|
const endLine = message.endLine ?? message.line;
|
|
119309
119693
|
const endColumn = message.endColumn ?? message.column + 1;
|
|
119310
119694
|
let end = import_coc27.Position.create(endLine > 0 ? endLine - 1 : 0, endColumn);
|
|
119311
119695
|
const ms = /['"](.*?)['"]/g.exec(message.message);
|
|
119312
119696
|
if (ms && ms.length > 0) {
|
|
119313
|
-
const line = import_coc27.workspace.getDocument(document.uri).getline(message.line - 1);
|
|
119314
|
-
if (line.includes(ms[1])) {
|
|
119697
|
+
const line = (_a = import_coc27.workspace.getDocument(document.uri)) == null ? void 0 : _a.getline(message.line - 1);
|
|
119698
|
+
if (line == null ? void 0 : line.includes(ms[1])) {
|
|
119315
119699
|
const s = message.column > line.indexOf(ms[1]) ? message.column : line.indexOf(ms[1]);
|
|
119316
119700
|
start = import_coc27.Position.create(message.line - 1, s);
|
|
119317
119701
|
end = import_coc27.Position.create(message.line - 1, s + ms[1].length);
|
|
@@ -119447,6 +119831,9 @@ var LinterProvider = class {
|
|
|
119447
119831
|
}
|
|
119448
119832
|
onDocumentChanged(e) {
|
|
119449
119833
|
const document = import_coc28.workspace.getDocument(e.textDocument.uri);
|
|
119834
|
+
if (!document) {
|
|
119835
|
+
return;
|
|
119836
|
+
}
|
|
119450
119837
|
this.engine.lintDocument(document.textDocument, true).catch(() => {
|
|
119451
119838
|
});
|
|
119452
119839
|
}
|
|
@@ -119623,6 +120010,9 @@ async function extractVariable(root, document, range, outputChannel) {
|
|
|
119623
120010
|
return;
|
|
119624
120011
|
}
|
|
119625
120012
|
const doc = import_coc29.workspace.getDocument(document.uri);
|
|
120013
|
+
if (!doc) {
|
|
120014
|
+
return;
|
|
120015
|
+
}
|
|
119626
120016
|
const tempFile = await getTempFileWithDocumentContents(document);
|
|
119627
120017
|
const workspaceFolder = import_coc29.workspace.getWorkspaceFolder(doc.uri);
|
|
119628
120018
|
const workspaceRoot = workspaceFolder ? import_coc29.Uri.parse(workspaceFolder.uri).fsPath : import_coc29.workspace.cwd;
|
|
@@ -119644,6 +120034,9 @@ async function extractMethod(root, document, range, outputChannel) {
|
|
|
119644
120034
|
return;
|
|
119645
120035
|
}
|
|
119646
120036
|
const doc = import_coc29.workspace.getDocument(document.uri);
|
|
120037
|
+
if (!doc) {
|
|
120038
|
+
return;
|
|
120039
|
+
}
|
|
119647
120040
|
const tempFile = await getTempFileWithDocumentContents(document);
|
|
119648
120041
|
const workspaceFolder = import_coc29.workspace.getWorkspaceFolder(doc.uri);
|
|
119649
120042
|
const workspaceRoot = workspaceFolder ? import_coc29.Uri.parse(workspaceFolder.uri).fsPath : import_coc29.workspace.cwd;
|
|
@@ -119942,6 +120335,7 @@ async function activate(context) {
|
|
|
119942
120335
|
}
|
|
119943
120336
|
if (pyrightCfg.get("disableDiagnostics")) {
|
|
119944
120337
|
disabledFeatures.push("diagnostics");
|
|
120338
|
+
disabledFeatures.push("pullDiagnostic");
|
|
119945
120339
|
}
|
|
119946
120340
|
if (pyrightCfg.get("disableDocumentation")) {
|
|
119947
120341
|
disabledFeatures.push("hover");
|