{"action":"created","issue":{"url":"https://api.github.com/repos/PowerShell/PowerShell/issues/5599","repository_url":"https://api.github.com/repos/PowerShell/PowerShell","labels_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/5599/labels{/name}","comments_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/5599/comments","events_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/5599/events","html_url":"https://github.com/PowerShell/PowerShell/issues/5599","id":278429741,"number":5599,"title":"'ToString' method is case sensitive when getting default rendering of a type","user":{"login":"powercode","id":3505151,"avatar_url":"https://avatars1.githubusercontent.com/u/3505151?v=4","gravatar_id":"","url":"https://api.github.com/users/powercode","html_url":"https://github.com/powercode","followers_url":"https://api.github.com/users/powercode/followers","following_url":"https://api.github.com/users/powercode/following{/other_user}","gists_url":"https://api.github.com/users/powercode/gists{/gist_id}","starred_url":"https://api.github.com/users/powercode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/powercode/subscriptions","organizations_url":"https://api.github.com/users/powercode/orgs","repos_url":"https://api.github.com/users/powercode/repos","events_url":"https://api.github.com/users/powercode/events{/privacy}","received_events_url":"https://api.github.com/users/powercode/received_events","type":"User","site_admin":false},"labels":[{"id":401720735,"url":"https://api.github.com/repos/PowerShell/PowerShell/labels/Area-Engine","name":"Area-Engine","color":"5319e7","default":false},{"id":423526741,"url":"https://api.github.com/repos/PowerShell/PowerShell/labels/Issue-Discussion","name":"Issue-Discussion","color":"fc2929","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-12-01T10:57:29Z","updated_at":"2017-12-05T09:25:08Z","closed_at":null,"author_association":"COLLABORATOR","body":"<!--\r\n\r\nFor Windows PowerShell 5.1 issues, suggestions, or feature requests please use the following link instead:\r\n- Windows PowerShell [UserVoice](https://windowsserver.uservoice.com/forums/301869-powershell)\r\n\r\nIf it is a bug report:\r\n- make sure you are able to repro it on the latest released version. \r\nYou can install the latest version from https://github.com/PowerShell/PowerShell/releases\r\n- Search the existing issues.\r\n- Refer to the [FAQ](https://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md).\r\n- Refer to the [known issues](https://github.com/PowerShell/PowerShell/blob/master/docs/KNOWNISSUES.md).\r\n- Fill out the following repro template:\r\n\r\nIf it's not a bug, please remove the template and elaborate the issue in your own words.\r\n-->\r\n\r\nWhen the definition of `ToString` is spelled `toString`, we get the type name instead of the result of `ToString`. It works when spelled `ToString`.\r\n\r\nSteps to reproduce\r\n------------------\r\n\r\n```powershell\r\nclass X{\r\n    [string] $A\r\n    [string] toString() {return $this.A}\r\n}\r\n\r\n\r\ngci | foreach {[X] @{A = $_.Name}} | group A\r\n\r\n```\r\n\r\nExpected behavior\r\n-----------------\r\n\r\n```none\r\nCount Name                      Group                                                                                                    \r\n----- ----                      -----                                                                                                    \r\n    1 file1                     {file1}                                                 \r\n    1 file2                     {file2}  \r\n```\r\n\r\nActual behavior\r\n---------------\r\n\r\n```none\r\nCount Name                      Group                                                                                                    \r\n----- ----                      -----                                                                                                    \r\n    1 file1                     {X}                                                 \r\n    1 file2                     {X}  \r\n```\r\n\r\n\r\n\r\nEnvironment data\r\n----------------\r\n\r\n<!-- provide the output of $PSVersionTable -->\r\n\r\n```powershell\r\nAll versions\r\n\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/PowerShell/PowerShell/issues/comments/349245290","html_url":"https://github.com/PowerShell/PowerShell/issues/5599#issuecomment-349245290","issue_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/5599","id":349245290,"user":{"login":"markekraus","id":6509955,"avatar_url":"https://avatars3.githubusercontent.com/u/6509955?v=4","gravatar_id":"","url":"https://api.github.com/users/markekraus","html_url":"https://github.com/markekraus","followers_url":"https://api.github.com/users/markekraus/followers","following_url":"https://api.github.com/users/markekraus/following{/other_user}","gists_url":"https://api.github.com/users/markekraus/gists{/gist_id}","starred_url":"https://api.github.com/users/markekraus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markekraus/subscriptions","organizations_url":"https://api.github.com/users/markekraus/orgs","repos_url":"https://api.github.com/users/markekraus/repos","events_url":"https://api.github.com/users/markekraus/events{/privacy}","received_events_url":"https://api.github.com/users/markekraus/received_events","type":"User","site_admin":false},"created_at":"2017-12-05T09:25:07Z","updated_at":"2017-12-05T09:25:07Z","author_association":"COLLABORATOR","body":"@iSazonov Probably not. Arguably, anyone who made mixed cased method is \"doing it wrong\". In the rare instance that they do have mixed case, the class can be inherited by a PowerShell class, and the method can be overridden, then it would be ambiguous as to which methods PowerShell was overriding. While in PowerShell, it would only override the method is available in PowerShell, if that object gets passed to .NET it would not override all cased versions of the method.\r\n\r\nMaybe a PowerShell Method should override all cased versions of an existing method as well as add a new case if it doesn't exist? For example, `toString()` in PowerShell would override `ToString()` as well as create a `toString()` in .NET. \r\n\r\nIf a .NET class had `badMethod()` and `BadMethod()` and the PowerShell class had `badmethod()`, the PowerShell class would override `badMethod()` and `BadMethod()` and add a `badmethod()`."}}
{"actor":{"display_login":"markekraus"}}