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

docs: Mixins can have abstract methods #5043

Merged
merged 1 commit into from
Jul 5, 2023
Merged

Conversation

KyleFin
Copy link
Contributor

@KyleFin KyleFin commented Jul 5, 2023

See #4767 (comment)


  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
  • This PR doesn’t contain automatically generated corrections or text (Grammarly, LLMs, and similar).
  • This PR follows the Google Developer Documentation Style Guidelines — for example, it doesn’t use i.e. or e.g., and it avoids I and we (first person).
  • This PR uses semantic line breaks of 80 characters or fewer.
Contribution guidelines:
  • See our contributor guide for general expectations for PRs.
  • Larger or significant changes should be discussed in an issue before creating a PR.
  • Code changes should generally follow the Dart style guide and use dart format.
  • Updates to code excerpts indicated by <?code-excerpt need to be updated in their source .dart file as well.

@@ -135,7 +135,7 @@ wrapping them with methods, all without changing client code.

Instance, getter, and setter methods can be abstract, defining an
interface but leaving its implementation up to other classes.
Abstract methods can only exist in [abstract classes][].
Abstract methods can only exist in [abstract classes][] or [mixins][].

To make a method abstract, use a semicolon (;) instead of a method body:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

May be useful to add a simple code example of an abstract getter in a mixin, but maybe that could be left to the mixins docs.

Copy link
Member

Choose a reason for hiding this comment

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

Good idea. I think you're right though that it should be on the mixin page. It can potentially be added as part of #4871 :)

Copy link
Member

@parlough parlough left a comment

Choose a reason for hiding this comment

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

Thanks for this, looks good to me!

@@ -135,7 +135,7 @@ wrapping them with methods, all without changing client code.

Instance, getter, and setter methods can be abstract, defining an
interface but leaving its implementation up to other classes.
Abstract methods can only exist in [abstract classes][].
Abstract methods can only exist in [abstract classes][] or [mixins][].

To make a method abstract, use a semicolon (;) instead of a method body:

Copy link
Member

Choose a reason for hiding this comment

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

Good idea. I think you're right though that it should be on the mixin page. It can potentially be added as part of #4871 :)

@parlough parlough merged commit c3f9ea5 into dart-lang:main Jul 5, 2023
9 checks passed
rmacnak-google pushed a commit to rmacnak-google/site-www that referenced this pull request Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants