File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -1111,8 +1111,7 @@ export class Compiler extends DiagnosticEmitter {
1111
1111
assert ( instance . is ( CommonFlags . INSTANCE ) ) ;
1112
1112
let classInstance = assert ( instance . parent ) ; assert ( classInstance . kind == ElementKind . CLASS ) ;
1113
1113
1114
- // implicitly return `this` if the constructor doesn't always return on its own
1115
- if ( ! flow . is ( FlowFlags . RETURNS ) ) {
1114
+ if ( ! flow . isAny ( FlowFlags . ANY_TERMINATING ) ) {
1116
1115
1117
1116
// if `this` wasn't accessed before, allocate if necessary and initialize `this`
1118
1117
if ( ! flow . is ( FlowFlags . ALLOCATES ) ) {
@@ -1133,6 +1132,8 @@ export class Compiler extends DiagnosticEmitter {
1133
1132
) ;
1134
1133
this . makeFieldInitialization ( < Class > classInstance , stmts ) ;
1135
1134
}
1135
+
1136
+ // implicitly return `this`
1136
1137
stmts . push (
1137
1138
module . createGetLocal ( 0 , nativeSizeType )
1138
1139
) ;
You can’t perform that action at this time.
0 commit comments