Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Discuss upper bounds before self types in documentation#17827

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
JukkaL merged 1 commit intomasterfromgenerics-docs-bounds
Sep 26, 2024

Conversation

@JukkaL
Copy link
Collaborator

The explanation of self types uses upper bounds, so it makes sense to discuss them earlier.

I also made some other minor documentation tweaks to improve clarity.

The explanation of self types uses upper bounds, so it makes senseto discuss them earlier.I also made some other minor documentation tweaks to improve clarity.
Type parameters of generic classes may also have upper bounds, which
restrict the valid values for the type parameter in the same way.

.. _type-variable-value-restriction:

Choose a reason for hiding this comment

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

Since value restrictions and bounds are closely related concepts and users are likely to confuse them, would it be better to also move up this section to just below the section on bounds?

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

I don't have a strong opinion. I didn't move it since self types, which are now covered in the following section, are closely related to upper bounds (probably one of the most common use cases for upper bounds), and self types are probably much more common than constraints/value restrictions in practice.

Choose a reason for hiding this comment

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

Sounds good, we can leave this as is.

@JukkaLJukkaL merged commit6336ce1 intomasterSep 26, 2024
@JukkaLJukkaL deleted the generics-docs-bounds branchSeptember 26, 2024 09:07
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@JelleZijlstraJelleZijlstraJelleZijlstra left review comments

@hauntsaninjahauntsaninjahauntsaninja approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@JukkaL@JelleZijlstra@hauntsaninja

[8]ページ先頭

©2009-2025 Movatter.jp