foundry icon indicating copy to clipboard operation
foundry copied to clipboard

Coverage: Unhandled AST nodes

Open onbjerg opened this issue 3 years ago • 4 comments

There are a few AST nodes that are not handled by the coverage visitor:

Unhandled:

  • YulSwitch
  • YulForLoop
  • YulFunctionDefinition
  • YulVariableDeclaration
  • YulFunctionCall
  • TupleExpression

I'm not sure what this one is:

  • ElementaryTypeNameExpression

I'm not sure how to handle these:

  • MemberAccess
  • NewExpression

onbjerg avatar Jun 14 '22 20:06 onbjerg

cc @seanyoung @jpopesculian @rkrasiuk any ideas on ElementaryTypeNameExpression, MemberAccess, NewExpression?

gakonst avatar Jun 18 '22 22:06 gakonst

NewExpression occurs in these three forms which have different parse trees.

(new D{value: 1})();
(new D){value: 1}();
new D{value: 1}();

MemberAccess occurs here in s.f1:

struct S { int f1; };
function f(S s) returns (int) { return s.f1; }

I don't think ElementaryTypeNameExpression is a thing, that's ethereum solidity.

@LucasSte knows about the yul expressions.

seanyoung avatar Jun 19 '22 08:06 seanyoung

There are a few AST nodes that are not handled by the coverage visitor:

Unhandled:

  • YulSwitch
  • YulForLoop
  • YulFunctionDefinition
  • YulVariableDeclaration
  • YulFunctionCall

Do you need any help with these nodes? I didn't quite understand the context here.

LucasSte avatar Jun 22 '22 13:06 LucasSte

No, I think I know how to handle those, I'm mostly unsure about the new keyword :smile:

onbjerg avatar Jun 22 '22 14:06 onbjerg