File tree Expand file tree Collapse file tree 3 files changed +18
-4
lines changed Expand file tree Collapse file tree 3 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ under the licensing terms detailed in LICENSE:
1919* jhwgh1968 <jhwgh1968@protonmail.com>
2020* Jeffrey Charles <jeffreycharles@gmail.com>
2121* Vladimir Tikhonov <reg@tikhonov.by>
22+ * Duncan Uszkay <duncan.uszkay@shopify.com>
2223
2324Portions of this software are derived from third-party works licensed under
2425the following terms:
Original file line number Diff line number Diff line change @@ -1084,10 +1084,16 @@ export class Compiler extends DiagnosticEmitter {
10841084 ( < EnumValue > member ) . identifierNode . range . atEnd
10851085 ) ;
10861086 }
1087- initExpr = module . binary ( BinaryOp . AddI32 ,
1088- module . global_get ( previousValue . internalName , NativeType . I32 ) ,
1089- module . i32 ( 1 )
1090- ) ;
1087+ if ( isInline ) {
1088+ let value = i64_add ( previousValue . constantIntegerValue , i64_new ( 1 ) ) ;
1089+ assert ( ! i64_high ( value ) ) ;
1090+ initExpr = module . i32 ( i64_low ( value ) ) ;
1091+ } else {
1092+ initExpr = module . binary ( BinaryOp . AddI32 ,
1093+ module . global_get ( previousValue . internalName , NativeType . I32 ) ,
1094+ module . i32 ( 1 )
1095+ ) ;
1096+ }
10911097 initExpr = module . precomputeExpression ( initExpr ) ;
10921098 if ( getExpressionId ( initExpr ) != ExpressionId . Const ) {
10931099 if ( element . is ( CommonFlags . CONST ) ) {
Original file line number Diff line number Diff line change @@ -12,6 +12,13 @@ export const enum ImplicitConst {
1212 THREE
1313}
1414
15+ const enum ImplicitConstNoExport {
16+ ZERO ,
17+ ONE ,
18+ TWO ,
19+ THREE
20+ }
21+
1522export enum Explicit {
1623 ZERO = 0 ,
1724 ONE = 0 + 1 ,
You can’t perform that action at this time.
0 commit comments