Skip to content

Allow (some) method names that happen to be keywords #2217

Closed

Description

@vors

This should work:

class MyClass {     
    [object] Filter() {
        return $null
    }
}

Copied from TFS task 1358992

Reminder to close this Connect bug if this work gets done: https://connect.microsoft.com/PowerShell/Feedback/Details/1709557

Activity

  1. rkeithhill commented on Sep 9, 2016

    @rkeithhill
    Collaborator

    C# has that handy @class way to use a keyword as an identifier. I wonder if there is any punctuation left that PowerShell could use for this?

  2. added
    Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributors
    on Nov 2, 2016
  3. msftrncs commented on Mar 10, 2019

    @msftrncs
    Contributor

    I wouldn't think PowerShell needs a special character. I think PowerShell's general concept of context serves better. Pretty much all the useful keywords have no other use in class { }. Only hidden and static would truly be reserved. Even base only has a very specific context it can be used in.

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

    HacktoberfestPotential candidate to participate in HacktoberfestIssue-Enhancementthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Languageparser, language semantics

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions