Skip to content

Whether add or not #[NoDiscard] on terminal methods for Sequence (and Collection?) #30

Description

@nikophil

Follow up of #29 (comment)

then we cannot share trait with Collection, or we can, but those NoDiscard will have no runtime effect..

here is a solution - maybe a little bit cumbersome but working

https://3v4l.org/mFDBn#v8.5.8

I think another thing to keep in mind is that adding the #[NoDiscard] attribute is a BC break (actually it only triggers a warning, but I guess in Symfony application, in dev/test env the error handler does actually throw) although removing the attribute is not a BC break, so if we're actually undecided, I think the most prudent approach would be to add it first.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions