Skip to content

Method ::Mail::AttachmentsList#[]= clobbers hash assigned #644

Open
@MarkDBlackwell

Description

@MarkDBlackwell

Mail::AttachmentsList#[]= , given a hash object to assign (instead of a literal hash), clobbers it (by deleting its key-value pairs). (Here is a tiny example gist.)

Clobbering this hash object in this assignment seems to violate POLS (the Principle Of Least Surprise).

This problem IMHO could be avoided best here (on this line) by adding:

value = value.dup

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions