Some tests / semantic analyser diagnostics were disabled in the #127 PR:
doCatchStatementContainsNoExternalCall - this doesn't work if the external call is not a direct descendant of the do catch block, e.g. do { let a: Int = (call a.b()) as! Int } ...
externalCallReturnValueIgnored - this doesn't work if the value is not assigned to a variable; it can still be used in a valid way, e.g. if (((call a.b()) as! Int) == 0) { ... }
The only time a value is actually not used is when it is a .expression() statement e.g. in a Block. Care should be taken with casting – even though casting technically should check if the value is in a given range, it should probably not be treated as "using" the value, especially given that at the moment we can only cast to Int, which does not check range (Int === int256 is the largest integer type).
Some tests / semantic analyser diagnostics were disabled in the #127 PR:
doCatchStatementContainsNoExternalCall
- this doesn't work if the external call is not a direct descendant of the do catch block, e.g.do { let a: Int = (call a.b()) as! Int } ...
externalCallReturnValueIgnored
- this doesn't work if the value is not assigned to a variable; it can still be used in a valid way, e.g.if (((call a.b()) as! Int) == 0) { ... }
The only time a value is actually not used is when it is a
.expression()
statement e.g. in aBlock
. Care should be taken with casting – even though casting technically should check if the value is in a given range, it should probably not be treated as "using" the value, especially given that at the moment we can only cast toInt
, which does not check range (Int === int256
is the largest integer type).