Skip to content

Commit

Permalink
Merge pull request #160 from onflow/bastian/159-fix-resource-example
Browse files Browse the repository at this point in the history
  • Loading branch information
turbolent authored Sep 27, 2024
2 parents 32de354 + ccf8247 commit 51a56bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/language/resources.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,9 @@ Instead, use a swap statement to replace the resource with another resource.

```cadence
let child <- create Child(name: "Child 1")
let parent <- create Parent(name: "Parent", child: <-child)
child.name // is "Child 1"
let parent <- create Parent(name: "Parent", child: <-child)
parent.child.name // is "Child 1"
// Invalid: Cannot move resource out of variable resource field.
Expand Down

0 comments on commit 51a56bd

Please sign in to comment.