@@ -5801,6 +5801,7 @@ export class Compiler extends DiagnosticEmitter {
5801
5801
return module . unreachable ( ) ;
5802
5802
}
5803
5803
assert ( setterInstance . signature . parameterTypes . length == 1 ) ;
5804
+ assert ( setterInstance . signature . returnType == Type . void ) ;
5804
5805
if ( propertyInstance . is ( CommonFlags . Instance ) ) {
5805
5806
let thisType = assert ( setterInstance . signature . thisType ) ;
5806
5807
let thisExpr = this . compileExpression (
@@ -5809,20 +5810,16 @@ export class Compiler extends DiagnosticEmitter {
5809
5810
Constraints . ConvImplicit | Constraints . IsThis
5810
5811
) ;
5811
5812
if ( ! tee ) return this . makeCallDirect ( setterInstance , [ thisExpr , valueExpr ] , valueExpression ) ;
5812
- let getterInstance = assert ( ( < Property > target ) . getterInstance ) ;
5813
- assert ( getterInstance . signature . thisType == thisType ) ;
5814
- let returnType = getterInstance . signature . returnType ;
5815
- let returnTypeRef = returnType . toRef ( ) ;
5816
- let tempThis = flow . getTempLocal ( thisType ) ;
5813
+ let tempLocal = flow . getTempLocal ( valueType ) ;
5814
+ let valueTypeRef = valueType . toRef ( ) ;
5817
5815
let ret = module . block ( null , [
5818
5816
this . makeCallDirect ( setterInstance , [
5819
- module . local_tee ( tempThis . index , thisExpr , /* isManaged=*/ false , thisType . toRef ( ) ) , // thisType is managed but here it must be alive
5820
- valueExpr
5817
+ thisExpr ,
5818
+ module . local_tee ( tempLocal . index , valueExpr , valueType . isManaged , valueTypeRef )
5821
5819
] , valueExpression ) ,
5822
- this . makeCallDirect ( getterInstance , [
5823
- module . local_get ( tempThis . index , thisType . toRef ( ) )
5824
- ] , valueExpression )
5825
- ] , returnTypeRef ) ;
5820
+ module . local_get ( tempLocal . index , valueTypeRef ) ,
5821
+ ] , valueTypeRef ) ;
5822
+ this . currentType = valueType ;
5826
5823
return ret ;
5827
5824
} else {
5828
5825
if ( ! tee ) return this . makeCallDirect ( setterInstance , [ valueExpr ] , valueExpression ) ;
0 commit comments