Skip to content

Clone() implemented improperly for MatchString.cs? #3994

@Narvey

Description

@Narvey

It looks like the Clone functions in MatchString.cs often reference the clone when they meant to reference "this" (explicitly or implicitly). For example, https://github.com/PowerShell/PowerShell/blob/master/src/Microsoft.PowerShell.Commands.Utility/commands/utility/MatchString.cs#L65 checks the newly-created object to see if it has a PreContext, when it probably should check the current object.

It looks like this mistake occurs in both Clone() functions.

Also, where is the definition of the Match class?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Code Cleanupthe issue is for cleaning up the code with no impact on functionalityResolution-FixedThe issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions