File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -8477,15 +8477,6 @@ export class Compiler extends DiagnosticEmitter {
8477
8477
if ( localClosureContextOffset > 0 ) {
8478
8478
let contextLocal = assert ( flow . lookupLocal ( CommonNames . this_ ) ) ;
8479
8479
8480
- if ( flow . isLocalFlag ( local . index , LocalFlags . CONSTANT ) ) {
8481
- this . error (
8482
- DiagnosticCode . Not_implemented_0 ,
8483
- expression . range ,
8484
- "Closed Over Constants"
8485
- ) ;
8486
- return module . unreachable ( ) ;
8487
- }
8488
-
8489
8480
// TODO: replace this with a class field access, once we are able to construct the class before
8490
8481
// compiling
8491
8482
return module . load (
Original file line number Diff line number Diff line change @@ -134,7 +134,8 @@ import {
134
134
} from "./resolver" ;
135
135
136
136
import {
137
- Flow
137
+ Flow ,
138
+ LocalFlags
138
139
} from "./flow" ;
139
140
140
141
import {
@@ -3575,6 +3576,10 @@ export class Function extends TypedElement {
3575
3576
}
3576
3577
if ( parentResult . kind == ElementKind . LOCAL ) {
3577
3578
let local = changetype < Local > ( parentResult ) ;
3579
+
3580
+ // We don't need to assign a closure offset for inlined values
3581
+ if ( local . is ( CommonFlags . INLINED ) ) return local ;
3582
+
3578
3583
if ( this . closedLocals . has ( local . name ) ) return assert ( this . closedLocals . get ( local . name ) ) ;
3579
3584
let mask = local . type . byteSize - 1 ;
3580
3585
let memoryOffset = this . nextGlobalClosureOffset ;
You can’t perform that action at this time.
0 commit comments