@@ -6531,6 +6531,9 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions
6531
6531
6532
6532
if (isParamSpec(typeArg)) {
6533
6533
functionType.details.paramSpec = typeArg;
6534
+ } else if (isEllipsisType(typeArg)) {
6535
+ FunctionType.addDefaultParameters(functionType);
6536
+ functionType.details.flags |= FunctionTypeFlags.SkipArgsKwargsCompatibilityCheck;
6534
6537
}
6535
6538
} else {
6536
6539
FunctionType.addParameter(functionType, {
@@ -14078,6 +14081,9 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions
14078
14081
14079
14082
if (isParamSpec(typeArg)) {
14080
14083
functionType.details.paramSpec = typeArg;
14084
+ } else if (isEllipsisType(typeArg)) {
14085
+ FunctionType.addDefaultParameters(functionType);
14086
+ functionType.details.flags |= FunctionTypeFlags.SkipArgsKwargsCompatibilityCheck;
14081
14087
}
14082
14088
} else {
14083
14089
FunctionType.addParameter(functionType, {
@@ -14606,7 +14612,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions
14606
14612
} else {
14607
14613
typeArgs.forEach((typeArg, index) => {
14608
14614
if (index === typeArgs.length - 1) {
14609
- if (!isParamSpec(typeArg.type)) {
14615
+ if (!isParamSpec(typeArg.type) && !isEllipsisType(typeArg.type) ) {
14610
14616
addError(Localizer.Diagnostic.concatenateParamSpecMissing(), typeArg.node);
14611
14617
}
14612
14618
} else {
@@ -14673,7 +14679,9 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions
14673
14679
typeArgs.forEach((typeArg, index) => {
14674
14680
if (isEllipsisType(typeArg.type)) {
14675
14681
if (!isTupleTypeParam) {
14676
- addError(Localizer.Diagnostic.ellipsisContext(), typeArg.node);
14682
+ if (!allowParamSpec) {
14683
+ addError(Localizer.Diagnostic.ellipsisContext(), typeArg.node);
14684
+ }
14677
14685
} else if (typeArgs!.length !== 2 || index !== 1) {
14678
14686
addError(Localizer.Diagnostic.ellipsisSecondArg(), typeArg.node);
14679
14687
} else {
@@ -19136,6 +19144,10 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions
19136
19144
if (index === concatTypeArgs.length - 1) {
19137
19145
if (isParamSpec(typeArg)) {
19138
19146
functionType.details.paramSpec = typeArg;
19147
+ } else if (isEllipsisType(typeArg)) {
19148
+ FunctionType.addDefaultParameters(functionType);
19149
+ functionType.details.flags |=
19150
+ FunctionTypeFlags.SkipArgsKwargsCompatibilityCheck;
19139
19151
}
19140
19152
} else {
19141
19153
FunctionType.addParameter(functionType, {
0 commit comments