Skip to content

Implement MutatingSlice#1561

Draft
kyouko-taiga wants to merge 3 commits intomainfrom
mutating-slice
Draft

Implement MutatingSlice#1561
kyouko-taiga wants to merge 3 commits intomainfrom
mutating-slice

Conversation

@kyouko-taiga
Copy link
Copy Markdown
Contributor

Everything is in the title.

Name resolution may fail to resolve the right subscript variant if
it is looked up from a generic type conforming to `MutableCollection`
without this change.

See also https://github.com/orgs/hylo-lang/discussions/1553
/// The "past-the-end" position in `self`.
private let upper: Base.Position

/// Creates an instance with the given source.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// Creates an instance with the given source.
/// Creates an instance projecting the elements at `lower..<upper` in `base`.

FWIW, "the given" is usually a mistake.

(self.base == other.base) && (self.lower == other.lower) && (self.upper == other.upper)
}

/// Projects a slice of `base` presenting its elements from `lower` to `upper`.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A little ambiguous as to whether the range is half-open.

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.

2 participants