Do not mention redundant use case for Label constructor#14609
Closed
fmeum wants to merge 1 commit intobazelbuild:masterfrom
Closed
Do not mention redundant use case for Label constructor#14609fmeum wants to merge 1 commit intobazelbuild:masterfrom
fmeum wants to merge 1 commit intobazelbuild:masterfrom
Conversation
Label strings passed to the `default` argument of `attr.label()` are resolved to a `Label` immediately relative to the call site of `attr.label()`, so wrapping the argument with `Label(...)` is entirely redundant. More context at: bazelbuild/bazel-central-registry#63 (comment)
Collaborator
Author
|
@Wyverald This part of the docs has always confused me. Could you maybe give this particular page a read and verify that everything is up-to-date now that |
Member
|
Thanks, this looks good -- but yeah I should really rewrite this maybe. It took myself a long time to understand all the intricacies of label semantics. |
Collaborator
Author
This could also resolve #14503 in one go. |
Collaborator
Author
|
@Wyverald Do you want to open an issue about updating the docs for |
Member
|
Filed #15821. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Label strings passed to the
defaultargument ofattr.label()are resolved to aLabelimmediately relative to the call site ofattr.label(), so wrapping the argument withLabel(...)is entirely redundant.More context at:
bazelbuild/bazel-central-registry#63 (comment)