You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In case 1, the Try statement looks like the following:
fnprint_try(t:Statement){letStatement::Try(loc, func_expr, maybe_return, maybe_catches) = t else{ unreachable!()};println!("{func_expr}");}
it looks like the following:
T(address(1)).t(0, 101)
It is just the function call (this makes sense!)
In case 2 (without a function return specified), it looks like the following:
T(address(1)).t(0, 101){return2;}
i.e. it is a FunctionCallBlock
Additionally this actually seems truly unintended per the docs:
Try(Loc, Expression, Option<(ParameterList, Box<Statement>)>, Vec<CatchClause>)
try <1> [returns (<2.1>,*) <2.2>] <3>*
<1> is either New(FunctionCall) or FunctionCall.
edit: I may have misunderstood the docs, and it may be that it can be a lalrpop FunctionCall not an Expression::FunctionCall, which would make sense because it could be named args function call. Still, its a bit weird to have to special case try blocks that have a function return vs those that dont
To Reproduce
Steps to reproduce the behavior:
See above
Expected behavior Try's first expression should always either be New(FunctionCall) or FunctionCall.
Hyperledger Solang version
Solang-parser v0.3.3
The text was updated successfully, but these errors were encountered:
Describe the bug
Consider the following cases:
try
has a return value:try
does not have a return value:In case 1, the
Try
statement looks like the following:it looks like the following:
It is just the function call (this makes sense!)
In case 2 (without a function return specified), it looks like the following:
i.e. it is a
FunctionCallBlock
Additionally this actually seems truly unintended per the docs:
edit: I may have misunderstood the docs, and it may be that it can be a lalrpop FunctionCall not an
Expression::FunctionCall
, which would make sense because it could be named args function call. Still, its a bit weird to have to special case try blocks that have a function return vs those that dontTo Reproduce
Steps to reproduce the behavior:
See above
Expected behavior
Try
's first expression should always either beNew(FunctionCall)
orFunctionCall
.Hyperledger Solang version
Solang-parser v0.3.3
The text was updated successfully, but these errors were encountered: