File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -6610,8 +6610,8 @@ export class Compiler extends DiagnosticEmitter {
66106610        let  overrideInstance  =  overrideInstances [ i ] ; 
66116611        if  ( ! overrideInstance . is ( CommonFlags . Compiled ) )  continue ;  // errored 
66126612
6613-         const  overrideSignature  =  overrideInstance . signature ; 
6614-         const  originalSignature  =  instance . signature ; 
6613+         let  overrideSignature  =  overrideInstance . signature ; 
6614+         let  originalSignature  =  instance . signature ; 
66156615
66166616        if  ( ! overrideSignature . isAssignableTo ( originalSignature ,  true ) )  { 
66176617          this . error ( 
Original file line number Diff line number Diff line change @@ -1053,11 +1053,10 @@ export class Signature {
10531053    let  targetThisType  =  target . thisType ; 
10541054
10551055    if  ( thisThisType  !=  null  &&  targetThisType  !=  null ) { 
1056-       const  compatibleThisType  =  checkCompatibleOverride  ? thisThisType . canExtendOrImplement ( targetThisType ) 
1056+       const  compatibleThisType  =  checkCompatibleOverride  
1057+         ? thisThisType . canExtendOrImplement ( targetThisType ) 
10571058        : targetThisType . isAssignableTo ( thisThisType ) ; 
1058-       if  ( ! compatibleThisType )  { 
1059-         return  false ; 
1060-       } 
1059+       if  ( ! compatibleThisType )  return  false ;  
10611060    } else  if  ( thisThisType  ||  targetThisType ) { 
10621061      return  false ; 
10631062    } 
Original file line number Diff line number Diff line change 11class  A  { 
22  foo ( ) : void   {  } 
33} 
4+ 
45class  B  extends  A  { 
56  foo ( ) : void   {  } 
67} 
8+ 
79function  foo ( ) : void   {  } 
10+ 
811function  consumeA ( callback : ( this : A )  =>  void ) : void   {  } 
912function  consumeB ( callback : ( this : B )  =>  void ) : void   {  } 
13+ 
1014const  a  =  new  A ( ) ; 
1115const  b  =  new  B ( ) ; 
16+ 
1217consumeB ( a . foo ) ;  // shouldn't error 
1318consumeA ( foo ) ;    // should error 
1419consumeA ( b . foo ) ;  // should error 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments