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
One approach to using nested functions is grouping pieces of code, for instance, configuration of several views in a function called `configureViews`.
In such task, the natural way of looking at it would be to call the functions first, as they serve as a sort of summary, and then define the functions later.
Doing so will result in the following error being displayed:
`Use of local variable `[functionName]` before its declaration`
See attached Playground.
The text was updated successfully, but these errors were encountered:
Then I would understand that variables are defined before the functions are, and that variables are defined before the functions are invoked, but not that definition of functions need to precede its invocation. At least from a Swift `consumer` side.
That's not sufficient when a variable (as opposed to a constant) is captured by value (using a capture list). You have to know when the capture happens to know what the value is.
Attachment: Download
Additional Detail from JIRA
md5: 005ce6eb0b9b937beb33bb4e499a7a2f
Issue Description:
One approach to using nested functions is grouping pieces of code, for instance, configuration of several views in a function called `configureViews`.
In such task, the natural way of looking at it would be to call the functions first, as they serve as a sort of summary, and then define the functions later.
Doing so will result in the following error being displayed:
`Use of local variable `[functionName]` before its declaration`
See attached Playground.
The text was updated successfully, but these errors were encountered: