File tree Expand file tree Collapse file tree 3 files changed +64
-0
lines changed Expand file tree Collapse file tree 3 files changed +64
-0
lines changed Original file line number Diff line number Diff line change
1
+ var __extends = ( this && this . __extends ) || function ( d , b ) {
2
+ for ( var p in b ) if ( b . hasOwnProperty ( p ) ) d [ p ] = b [ p ] ;
3
+ function __ ( ) { this . constructor = d ; }
4
+ d . prototype = b === null ? Object . create ( b ) : ( __ . prototype = b . prototype , new __ ( ) ) ;
5
+ } ;
6
+ var A = ( function ( ) {
7
+ function A ( ) {
8
+ }
9
+ A . prototype . foo = function ( ) {
10
+ return this ;
11
+ } ;
12
+ return A ;
13
+ } ) ( ) ;
14
+ var B = ( function ( _super ) {
15
+ __extends ( B , _super ) ;
16
+ function B ( ) {
17
+ _super . apply ( this , arguments ) ;
18
+ }
19
+ B . prototype . bar = function ( ) {
20
+ return this ;
21
+ } ;
22
+ return B ;
23
+ } ) ( A ) ;
24
+ var b ;
25
+ var x = b . foo ( ) . bar ( ) ;
Original file line number Diff line number Diff line change
1
+ class A {
2
+ foo ( ) {
3
+ return this ;
4
+ }
5
+ }
6
+
7
+ class B extends A {
8
+ bar ( ) {
9
+ return this ;
10
+ }
11
+ }
12
+
13
+ var b : B ;
14
+ var x = b . foo ( ) . bar ( ) ; // Fluent pattern works, type of x is B
Original file line number Diff line number Diff line change
1
+ {
2
+ "compilerOptions" : {
3
+ "target" : " es5" ,
4
+ "module" : " commonjs" ,
5
+ "moduleResolution" : " node" ,
6
+ "isolatedModules" : false ,
7
+ "jsx" : " react" ,
8
+ "experimentalDecorators" : true ,
9
+ "emitDecoratorMetadata" : true ,
10
+ "declaration" : false ,
11
+ "noImplicitAny" : false ,
12
+ "removeComments" : true ,
13
+ "noLib" : false ,
14
+ "preserveConstEnums" : true ,
15
+ "suppressImplicitAnyIndexErrors" : true
16
+ },
17
+ "filesGlob" : [
18
+ " ./**/*.ts" ,
19
+ " ./**/*.tsx" ,
20
+ " !./node_modules/**/*"
21
+ ],
22
+ "files" : [
23
+ " ./polymorphicThis.ts"
24
+ ]
25
+ }
You can’t perform that action at this time.
0 commit comments