Hello, what's the differences between visitFunctio...
# compiler
a
Hello, what's the differences between visitFunction, visitFunctionNew, visitSimpleFunction and visitFunctionAccess?
t
What I typically do is to check the code of
IrElementTransformerVoidWithContext
to see what they do.
visitSimpleFunction
it restricts the function type you visit to
IrSimpleFunction
, it calls
visitFunction
if not overridden so it is almost the same as
visitFunction
but leaves out non-simple functions such as constructors
visitFunctionAccess
is for function calls, not function definitions, like
IrCall
,
IrConstructorCall
etc. If you check - for example -
visitConstructorCall
you'll see that it goes to
visitFunctionAccess
The
visitFunction
override adds the scope handling while
visitFunctionNew
calls the super method without the scope handling. Hope this helps.
thank you frog 1