File tree Expand file tree Collapse file tree 3 files changed +43
-0
lines changed
Expand file tree Collapse file tree 3 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ export class CatchClauses extends SlangNode {
1919 super ( ast , true ) ;
2020
2121 this . items = ast . items . map ( ( item ) => new CatchClause ( item , options ) ) ;
22+
23+ this . updateMetadata ( ...this . items ) ;
2224 }
2325
2426 print ( path : AstPath < CatchClauses > , print : PrintFunction ) : Doc {
Original file line number Diff line number Diff line change @@ -101,3 +101,17 @@ contract FeedConsumer {
101101 }
102102 }
103103}
104+
105+ contract Test {
106+ function getAdjustedBalance (IERC20 token ) internal view returns (uint256 ) {
107+ uint256 balance;
108+
109+ try token.balanceOf (address (this )) returns (uint256 result ) {
110+ balance = result;
111+ } catch {
112+ return 0 ;
113+ }
114+
115+ return balance - 100 ;
116+ }
117+ }
Original file line number Diff line number Diff line change @@ -110,6 +110,19 @@ contract FeedConsumer {
110110 }
111111}
112112
113+ contract Test {
114+ function getAdjustedBalance(IERC20 token ) internal view returns (uint256 ) {
115+ uint256 balance ;
116+
117+ try token .balanceOf (address (this )) returns (uint256 result ) {
118+ balance = result ;
119+ } catch {
120+ return 0 ;
121+ }
122+
123+ return balance - 100 ;
124+ }
125+ }
113126=====================================output=====================================
114127pragma solidity ^0.6.0;
115128
@@ -220,5 +233,19 @@ contract FeedConsumer {
220233 }
221234}
222235
236+ contract Test {
237+ function getAdjustedBalance(IERC20 token ) internal view returns (uint256 ) {
238+ uint256 balance ;
239+
240+ try token .balanceOf (address (this )) returns (uint256 result ) {
241+ balance = result ;
242+ } catch {
243+ return 0 ;
244+ }
245+
246+ return balance - 100 ;
247+ }
248+ }
249+
223250================================================================================
224251` ;
You can’t perform that action at this time.
0 commit comments