E2051 Syntax Errors
Syntax
nested function declarations are not allowed; define '%s' at the top level
When this occurs
Using #suppress attribute on non-function declarations (except file-level #suppress(ALL))
Example error message
error[E2051]:
#suppress can only be applied to function declarations or at file level with ALL
How to fix
Move the #suppress attribute to a function declaration, or use #suppress(ALL) at the top of the file to suppress all warnings in that file.