File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
packages/pyright-internal/src/analyzer Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -240,9 +240,9 @@ export class UniqueSignatureTracker {
240240 } ) ;
241241 }
242242
243- addSignature ( signature : FunctionType , offset : number ) {
243+ addSignature ( signature : FunctionType | OverloadedFunctionType , offset : number ) {
244244 // If this function is part of a broader overload, use the overload instead.
245- const effectiveSignature = signature . overloaded ?? signature ;
245+ const effectiveSignature = isFunction ( signature ) ? signature . overloaded ?? signature : signature ;
246246
247247 const existingSignature = this . findSignature ( effectiveSignature ) ;
248248 if ( existingSignature ) {
@@ -3627,8 +3627,6 @@ class UniqueFunctionSignatureTransformer extends TypeVarTransformer {
36273627 let updatedSourceType : Type = sourceType ;
36283628 const existingSignature = this . _signatureTracker . findSignature ( sourceType ) ;
36293629 if ( existingSignature ) {
3630- const typeVarContext = new TypeVarContext ( getTypeVarScopeId ( sourceType ) ) ;
3631-
36323630 let offsetIndex = existingSignature . expressionOffsets . findIndex (
36333631 ( offset ) => offset === this . _expressionOffset
36343632 ) ;
@@ -3637,6 +3635,8 @@ class UniqueFunctionSignatureTransformer extends TypeVarTransformer {
36373635 }
36383636
36393637 if ( offsetIndex > 0 ) {
3638+ const typeVarContext = new TypeVarContext ( getTypeVarScopeIds ( sourceType ) ) ;
3639+
36403640 // Create new type variables with the same scope but with
36413641 // different (unique) names.
36423642 sourceType . details . typeParameters . forEach ( ( typeParam ) => {
You can’t perform that action at this time.
0 commit comments