@@ -1716,19 +1716,15 @@ export class Compiler extends DiagnosticEmitter {
17161716 var type = instance . type ;
17171717 var nativeThisType = this . options . nativeSizeType ;
17181718 var nativeValueType = type . toNativeType ( ) ;
1719- var varTypes : NativeType [ ] | null = null ;
17201719 var module = this . module ;
17211720 var valueExpr = module . load ( type . byteSize , type . is ( TypeFlags . SIGNED ) ,
17221721 module . local_get ( 0 , nativeThisType ) ,
17231722 nativeValueType , instance . memoryOffset
17241723 ) ;
17251724
1726- if ( type . isManaged ) {
1727- valueExpr = this . makeRetain ( valueExpr , type ) ;
1728- varTypes = [ NativeType . I32 ] ;
1729- }
1725+ if ( type . isManaged ) this . makeRetain ( valueExpr , type ) ;
17301726
1731- instance . getterRef = module . addFunction ( instance . internalGetterName , nativeThisType , nativeValueType , varTypes , valueExpr ) ;
1727+ instance . getterRef = module . addFunction ( instance . internalGetterName , nativeThisType , nativeValueType , null , valueExpr ) ;
17321728 if ( instance . setterRef ) {
17331729 instance . set ( CommonFlags . COMPILED ) ;
17341730 } else {
@@ -1748,7 +1744,7 @@ export class Compiler extends DiagnosticEmitter {
17481744 var valueExpr : ExpressionRef ;
17491745 var varTypes : NativeType [ ] | null = null ;
17501746 if ( type . isManaged ) {
1751- // Can't use makeReplace, makeRetain, or makeRelease here since there's no corresponding flow, so
1747+ // Can't use makeReplace here since there's no corresponding flow, so
17521748 // 0: this, 1: value, 2: oldValue (temp)
17531749 valueExpr = module . block ( null , [
17541750 module . if (
@@ -3624,8 +3620,7 @@ export class Compiler extends DiagnosticEmitter {
36243620 var toSignature = toType . signatureReference ;
36253621 var fromSignature = fromType . signatureReference ;
36263622 if ( toSignature !== null && fromSignature !== null && fromSignature . externalEquals ( toSignature ) && fromType . is ( TypeFlags . IN_SCOPE_CLOSURE ) ) {
3627- // When we convert from the closure type into a function pointer, we first
3628- // update the local copy of the scope with the newest values
3623+ // When a closure leaves its initial scope, we copy in the closed over locals one last time
36293624 var tempResult = this . currentFlow . getTempLocal ( fromType ) ;
36303625 var convertExpr = module . block ( null , [
36313626 module . local_set (
0 commit comments