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. added
    Issue-Enhancement
    WG-Language
    on Sep 9, 2016
  2. 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?

  3. added
    Up-for-Grabs
    on Nov 2, 2016
  4. added
    Hacktoberfest
    on Feb 20, 2018
  5. 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

    HacktoberfestIssue-EnhancementResolution-FixedUp-for-GrabsWG-Language

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions