Title: Improve the error message for when a property-name / hashtable-key token cannot be parsed as such · Issue #6959 · PowerShell/PowerShell · GitHub
Open Graph Title: Improve the error message for when a property-name / hashtable-key token cannot be parsed as such · Issue #6959 · PowerShell/PowerShell
X Title: Improve the error message for when a property-name / hashtable-key token cannot be parsed as such · Issue #6959 · PowerShell/PowerShell
Description: Following up from #6946: A token to the right of . when accessing an object property or hashtable entry is parsed as an expression if it doesn't start with a letter. If that token is ultimately not a valid expression, the error message e...
Open Graph Description: Following up from #6946: A token to the right of . when accessing an object property or hashtable entry is parsed as an expression if it doesn't start with a letter. If that token is ultimately not...
X Description: Following up from #6946: A token to the right of . when accessing an object property or hashtable entry is parsed as an expression if it doesn't start with a letter. If that token is ultimately...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/6959
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Improve the error message for when a property-name / hashtable-key token cannot be parsed as such","articleBody":"Following up from #6946:\r\n\r\nA token to the right of `.` when accessing an object property or hashtable entry is parsed as an _expression_ if it doesn't start with a _letter_.\r\n\r\nIf that token is ultimately not a _valid_ expression, the error message erroneously suggests that _no token_ was specified, which is confusing:\r\n\r\n```powershell\r\n$obj = [pscustomobject] @{ '1a' = 'one A' }\r\nPS> $obj.1a # !! Breaks; must use $obj.'1a', due to property name starting with a *digit*\r\nAt line:1 char:6\r\n+ $obj.1a\r\n+ ~\r\nMissing property name after reference operator.\r\n```\r\n\r\nGiven that the fact that `1a` is _not_ treated as a string - and instead evaluated as an _expression_ that _breaks_ - is not obvious, providing specific guidance in the error message along the following lines would be helpful:\r\n\r\n```none\r\nAt line:1 char:6\r\n+ $obj.1a\r\n+ ~\r\nInvalid property-name expression; use quotes for literal interpretation.\r\n```\r\n\r\n\r\nEnvironment data\r\n----------------\r\n\r\nWritten as of:\r\n\r\n```powershell\r\nPowerShell Core v6.1.0-preview.2\r\n```\r\n","author":{"url":"https://github.com/mklement0","@type":"Person","name":"mklement0"},"datePublished":"2018-05-30T21:12:01Z","url":"https://github.com/PowerShell/PowerShell/issues/6959"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:40206f03-cbf3-3bc1-af54-4272ce8831f5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 94A0:29D01F:1AE187:25C45E:6AFDAF0B |
| html-safe-nonce | 4ce3466955357d5e73fddf6fa4b760c771145c3e208c39af140c6b9bb8723769 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NEEwOjI5RDAxRjoxQUUxODc6MjVDNDVFOjZBRkRBRjBCIiwidmlzaXRvcl9pZCI6IjQ3NzQyMDY1NDc2MTU5MTk4ODMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 707de9a37e7ce2a54445966b9547d3972fce8dcb926976b366821c0e6a5dc3fe |
| hovercard-subject-tag | issue:327901044 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/6959/issue_layout |
| twitter:image | https://opengraph.githubassets.com/08ec87b49a01d4c8aef42a07104ff08c5503158b547cd8a3fe987fba9f03a74a/PowerShell/PowerShell/issues/6959 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/08ec87b49a01d4c8aef42a07104ff08c5503158b547cd8a3fe987fba9f03a74a/PowerShell/PowerShell/issues/6959 |
| og:image:alt | Following up from #6946: A token to the right of . when accessing an object property or hashtable entry is parsed as an expression if it doesn't start with a letter. If that token is ultimately not... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mklement0 |
| hostname | github.com |
| expected-hostname | github.com |
| None | bc86424ef34a73b386237872800e922d149d65ba907f63d6f150a2dcb8433bea |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 0ddf53eb35c87f1f8df13dbf75c3bdadbfc6e969 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width