File tree 3 files changed +10
-6
lines changed
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 {
6610
6610
let overrideInstance = overrideInstances [ i ] ;
6611
6611
if ( ! overrideInstance . is ( CommonFlags . Compiled ) ) continue ; // errored
6612
6612
6613
- const overrideSignature = overrideInstance . signature ;
6614
- const originalSignature = instance . signature ;
6613
+ let overrideSignature = overrideInstance . signature ;
6614
+ let originalSignature = instance . signature ;
6615
6615
6616
6616
if ( ! overrideSignature . isAssignableTo ( originalSignature , true ) ) {
6617
6617
this . error (
Original file line number Diff line number Diff line change @@ -1053,11 +1053,10 @@ export class Signature {
1053
1053
let targetThisType = target . thisType ;
1054
1054
1055
1055
if ( thisThisType != null && targetThisType != null ) {
1056
- const compatibleThisType = checkCompatibleOverride ? thisThisType . canExtendOrImplement ( targetThisType )
1056
+ const compatibleThisType = checkCompatibleOverride
1057
+ ? thisThisType . canExtendOrImplement ( targetThisType )
1057
1058
: targetThisType . isAssignableTo ( thisThisType ) ;
1058
- if ( ! compatibleThisType ) {
1059
- return false ;
1060
- }
1059
+ if ( ! compatibleThisType ) return false ;
1061
1060
} else if ( thisThisType || targetThisType ) {
1062
1061
return false ;
1063
1062
}
Original file line number Diff line number Diff line change 1
1
class A {
2
2
foo ( ) : void { }
3
3
}
4
+
4
5
class B extends A {
5
6
foo ( ) : void { }
6
7
}
8
+
7
9
function foo ( ) : void { }
10
+
8
11
function consumeA ( callback : ( this : A ) => void ) : void { }
9
12
function consumeB ( callback : ( this : B ) => void ) : void { }
13
+
10
14
const a = new A ( ) ;
11
15
const b = new B ( ) ;
16
+
12
17
consumeB ( a . foo ) ; // shouldn't error
13
18
consumeA ( foo ) ; // should error
14
19
consumeA ( b . foo ) ; // should error
You can’t perform that action at this time.
0 commit comments