@@ -1716,19 +1716,15 @@ export class Compiler extends DiagnosticEmitter {
1716
1716
var type = instance . type ;
1717
1717
var nativeThisType = this . options . nativeSizeType ;
1718
1718
var nativeValueType = type . toNativeType ( ) ;
1719
- var varTypes : NativeType [ ] | null = null ;
1720
1719
var module = this . module ;
1721
1720
var valueExpr = module . load ( type . byteSize , type . is ( TypeFlags . SIGNED ) ,
1722
1721
module . local_get ( 0 , nativeThisType ) ,
1723
1722
nativeValueType , instance . memoryOffset
1724
1723
) ;
1725
1724
1726
- if ( type . isManaged ) {
1727
- valueExpr = this . makeRetain ( valueExpr , type ) ;
1728
- varTypes = [ NativeType . I32 ] ;
1729
- }
1725
+ if ( type . isManaged ) this . makeRetain ( valueExpr , type ) ;
1730
1726
1731
- instance . getterRef = module . addFunction ( instance . internalGetterName , nativeThisType , nativeValueType , varTypes , valueExpr ) ;
1727
+ instance . getterRef = module . addFunction ( instance . internalGetterName , nativeThisType , nativeValueType , null , valueExpr ) ;
1732
1728
if ( instance . setterRef ) {
1733
1729
instance . set ( CommonFlags . COMPILED ) ;
1734
1730
} else {
@@ -1748,7 +1744,7 @@ export class Compiler extends DiagnosticEmitter {
1748
1744
var valueExpr : ExpressionRef ;
1749
1745
var varTypes : NativeType [ ] | null = null ;
1750
1746
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
1752
1748
// 0: this, 1: value, 2: oldValue (temp)
1753
1749
valueExpr = module . block ( null , [
1754
1750
module . if (
@@ -3624,8 +3620,7 @@ export class Compiler extends DiagnosticEmitter {
3624
3620
var toSignature = toType . signatureReference ;
3625
3621
var fromSignature = fromType . signatureReference ;
3626
3622
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
3629
3624
var tempResult = this . currentFlow . getTempLocal ( fromType ) ;
3630
3625
var convertExpr = module . block ( null , [
3631
3626
module . local_set (
0 commit comments