Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix code examples and improve documentation in language reference #634

Merged
merged 1 commit into from
Mar 1, 2021

Conversation

jeroenlm
Copy link
Contributor

Description

  • Fix code example in composite-types part
  • Remove false statement in composite-types part
  • Remove typo in the functions part
  • Fix code example in restricted-types part

PS: this is my very first PR. Feel free to give any feedback!


For contributor use:

  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

Copy link
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeroenlm Thank you for the fixes!

Looks good, I just have one question

@@ -79,7 +79,7 @@ of the composite type requires them.

Composite types can only be declared within [contracts](../contracts)
and not locally in functions.
They can also not be nested.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this line removed on purpose? If it doesn't make sense, I think we need to extend it / improve the wording

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this line on purpose indeed. When you scroll up a little bit on that page (composite-types), there is written: "Nesting of resources is only allowed within other resource types, or in data structures like arrays and dictionaries, but not in structures, as that would allow resources to be copied." Since resources are composite types, this means that composite types can be nested in some cases. That's why I removed that line. Does it make sense? Or maybe am I misunderstanding the writer of that sentence?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I guess we can remove that sentence 👍

@turbolent turbolent added the Documentation Improvements or additions to documentation label Feb 28, 2021
@turbolent turbolent self-assigned this Feb 28, 2021
@turbolent turbolent merged commit 774f5a3 into onflow:master Mar 1, 2021
@jeroenlm
Copy link
Contributor Author

jeroenlm commented Mar 2, 2021

Great! Very happy with my first contribution :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants