René's URL Explorer Experiment


Title: Duplicate using namespace statements cause all type refs to throw AmbigiousTypeReference · Issue #13525 · PowerShell/PowerShell · GitHub

Open Graph Title: Duplicate using namespace statements cause all type refs to throw AmbigiousTypeReference · Issue #13525 · PowerShell/PowerShell

X Title: Duplicate using namespace statements cause all type refs to throw AmbigiousTypeReference · Issue #13525 · PowerShell/PowerShell

Description: Steps to reproduce using namespace System.Text using namespace System.Text [StringBuilder] Expected behavior Either ignore the second using namespace or throw parse error Actual behavior InvalidArgument: Line | 5 | [StringBuilder] | ~~~~...

Open Graph Description: Steps to reproduce using namespace System.Text using namespace System.Text [StringBuilder] Expected behavior Either ignore the second using namespace or throw parse error Actual behavior InvalidArg...

X Description: Steps to reproduce using namespace System.Text using namespace System.Text [StringBuilder] Expected behavior Either ignore the second using namespace or throw parse error Actual behavior InvalidArg...

Opengraph URL: https://github.com/PowerShell/PowerShell/issues/13525

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Duplicate using namespace statements cause all type refs to throw AmbigiousTypeReference","articleBody":"\u003c!--\r\n\r\nFor Windows PowerShell 5.1 issues, suggestions, or feature requests please use the following link instead:\r\nWindows PowerShell [UserVoice](https://windowsserver.uservoice.com/forums/301869-powershell)\r\n\r\nThis repository is **ONLY** for PowerShell Core 6 and PowerShell 7+ issues.\r\n\r\n- Make sure you are able to repro it on the [latest released version](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://docs.microsoft.com/powershell/scripting/whats-new/known-issues-ps6).\r\n\r\n-->\r\n\r\n## Steps to reproduce\r\n\r\n```powershell\r\nusing namespace System.Text\r\nusing namespace System.Text\r\n\r\n[StringBuilder]\r\n```\r\n\r\n## Expected behavior\r\n\r\nEither ignore the second `using namespace` or throw parse error\r\n\r\n## Actual behavior\r\n\r\n```none\r\nInvalidArgument:\r\nLine |\r\n   5 |  [StringBuilder]\r\n     |  ~~~~~~~~~~~~~~~\r\n     | Type name 'StringBuilder' is ambiguous, it could be 'System.Text.StringBuilder' or 'System.Text.StringBuilder'.\r\n```\r\n\r\n^ is thrown at runtime.\r\n\r\n## Environment data\r\n\r\n\u003c!-- provide the output of $PSVersionTable -->\r\n\r\n```none\r\nName                           Value\r\n----                           -----\r\nPSVersion                      7.1.0-preview.6\r\nPSEdition                      Core\r\nGitCommitId                    7.1.0-preview.6\r\nOS                             Microsoft Windows 10.0.18362\r\nPlatform                       Win32NT\r\nPSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}\r\nPSRemotingProtocolVersion      2.3\r\nSerializationVersion           1.1.0.1\r\nWSManStackVersion              3.0\r\n```\r\n\r\n## Notes\r\n\r\n\u003cdetails>\r\n\r\n\u003csummary>Full Get-Error output (click to expand)\u003c/summary>\r\n\r\n```raw\r\nException             :\r\n    Type           : System.Management.Automation.RuntimeException\r\n    ErrorRecord    :\r\n        Exception             :\r\n            Type    : System.Management.Automation.ParentContainsErrorRecordException\r\n            Message : Type name 'StringBuilder' is ambiguous, it could be 'System.Text.StringBuilder' or 'System.Text.StringBuilder'.\r\n            HResult : -2146233087\r\n        CategoryInfo          : InvalidArgument: (:) [], ParentContainsErrorRecordException\r\n        FullyQualifiedErrorId : AmbiguousTypeReference\r\n        InvocationInfo        :\r\n            ScriptLineNumber : 5\r\n            OffsetInLine     : 1\r\n            HistoryId        : -1\r\n            Line             : [StringBuilder]\r\n            PositionMessage  : At line:5 char:1\r\n                               + [StringBuilder]\r\n                               + ~~~~~~~~~~~~~~~\r\n            CommandOrigin    : Internal\r\n        ScriptStackTrace      : at \u003cScriptBlock>, \u003cNo file>: line 5\r\n    Message        : Type name 'StringBuilder' is ambiguous, it could be 'System.Text.StringBuilder' or 'System.Text.StringBuilder'.\r\n    InnerException :\r\n        Type           : System.Management.Automation.PSInvalidCastException\r\n        ErrorRecord    :\r\n            Exception             :\r\n                Type    : System.Management.Automation.ParentContainsErrorRecordException\r\n                Message : Type name 'StringBuilder' is ambiguous, it could be 'System.Text.StringBuilder' or 'System.Text.StringBuilder'.\r\n                HResult : -2146233087\r\n            CategoryInfo          : InvalidArgument: (:) [], ParentContainsErrorRecordException\r\n            FullyQualifiedErrorId : AmbiguousTypeReference\r\n            InvocationInfo        :\r\n                ScriptLineNumber : 5\r\n                OffsetInLine     : 1\r\n                HistoryId        : -1\r\n                Line             : [StringBuilder]\r\n                PositionMessage  : At line:5 char:1\r\n                                   + [StringBuilder]\r\n                                   + ~~~~~~~~~~~~~~~\r\n                CommandOrigin    : Internal\r\n            ScriptStackTrace      : at \u003cScriptBlock>, \u003cNo file>: line 5\r\n        TargetSite     :\r\n            Name          : ResolveTypeName\r\n            DeclaringType : System.Management.Automation.TypeOps, System.Management.Automation, Version=7.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35\r\n            MemberType    : Method\r\n            Module        : System.Management.Automation.dll\r\n        StackTrace     :\r\n   at System.Management.Automation.TypeOps.ResolveTypeName(ITypeName typeName, IScriptExtent errorPos)\r\n   at System.Management.Automation.Interpreter.FuncCallInstruction`3.Run(InterpretedFrame frame)\r\n   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)\r\n        Message        : Type name 'StringBuilder' is ambiguous, it could be 'System.Text.StringBuilder' or 'System.Text.StringBuilder'.\r\n        Data           : System.Collections.ListDictionaryInternal\r\n        InnerException :\r\n            Type       : System.Management.Automation.Language.TypeResolver+AmbiguousTypeException\r\n            Candidates :\r\n                Length : 25\r\n\r\n                Length : 25\r\n            TypeName   : StringBuilder\r\n            Message    : Specified cast is not valid.\r\n            HResult    : -2147467262\r\n        Source         : System.Management.Automation\r\n        HResult        : -2147467262\r\n    HResult        : -2146233087\r\nCategoryInfo          : InvalidArgument: (:) [], RuntimeException\r\nFullyQualifiedErrorId : AmbiguousTypeReference\r\nInvocationInfo        :\r\n    ScriptLineNumber : 5\r\n    OffsetInLine     : 1\r\n    HistoryId        : -1\r\n    Line             : [StringBuilder]\r\n    PositionMessage  : At line:5 char:1\r\n                       + [StringBuilder]\r\n                       + ~~~~~~~~~~~~~~~\r\n    CommandOrigin    : Internal\r\nScriptStackTrace      : at \u003cScriptBlock>, \u003cNo file>: line 5\r\n```\r\n\r\n\u003c/details>\r\n\r\nSide note, I found this because I had duplicated `using namespace System` in a script I dot sourced.  `System` is a real bad one to do that with since it breaks concise view *for the rest of the session*.  Took me awhile to figure out what was happening, thought I broke `Out-Default` somehow.  Might be a good idea to use the fully qualified name for `Environment` in concise view (/cc @SteveL-MSFT).","author":{"url":"https://github.com/SeeminglyScience","@type":"Person","name":"SeeminglyScience"},"datePublished":"2020-08-26T18:34:03Z","url":"https://github.com/PowerShell/PowerShell/issues/13525"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:31367856-2f4b-3345-2b13-252b6acfcfcd
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8A28:26FF81:2E5A51:418106:6AFDB40E
html-safe-nonce88554d062622efc9c35fe9ebc89139068e59c432ea5d8bf2b69034a6e347d51c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QTI4OjI2RkY4MToyRTVBNTE6NDE4MTA2OjZBRkRCNDBFIiwidmlzaXRvcl9pZCI6IjIwNjAzMDU4NTEwMjQ3ODIzNTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac397cd91f93bf5bcc6abc20ecef71835aaaafff891e450d1c7eb5d9a561213b21
hovercard-subject-tagissue:686530618
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/13525/issue_layout
twitter:imagehttps://opengraph.githubassets.com/9d3b661e6313496e6151f06065703db94ee9d717814f062c4c585e6220024e6b/PowerShell/PowerShell/issues/13525
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/9d3b661e6313496e6151f06065703db94ee9d717814f062c4c585e6220024e6b/PowerShell/PowerShell/issues/13525
og:image:altSteps to reproduce using namespace System.Text using namespace System.Text [StringBuilder] Expected behavior Either ignore the second using namespace or throw parse error Actual behavior InvalidArg...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameSeeminglyScience
hostnamegithub.com
expected-hostnamegithub.com
None3c532f4d069d6fbe9b1837450343d1b9e0619a7d5c4ba0b3b64fd8e0bae67c7e
turbo-cache-controlno-preview
go-importgithub.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git
octolytics-dimension-user_id11524380
octolytics-dimension-user_loginPowerShell
octolytics-dimension-repository_id49609581
octolytics-dimension-repository_nwoPowerShell/PowerShell
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id49609581
octolytics-dimension-repository_network_root_nwoPowerShell/PowerShell
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release5396ad00d1c6d19097aee7fc4d00a2eb03432c8f
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/PowerShell/PowerShell/issues/13525#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fissues%2F13525
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fissues%2F13525
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=PowerShell%2FPowerShell
Reloadhttps://github.com/PowerShell/PowerShell/issues/13525
Reloadhttps://github.com/PowerShell/PowerShell/issues/13525
Reloadhttps://github.com/PowerShell/PowerShell/issues/13525
PowerShellhttps://github.com/PowerShell
PowerShellhttps://github.com/PowerShell/PowerShell
Codehttps://github.com/PowerShell/PowerShell
Issues1.3k (1.3k)https://github.com/PowerShell/PowerShell/issues
Pull requests366 (366)https://github.com/PowerShell/PowerShell/pulls
Discussionshttps://github.com/PowerShell/PowerShell/discussions
Actionshttps://github.com/PowerShell/PowerShell/actions
Projectshttps://github.com/PowerShell/PowerShell/projects
Security and quality3 (3)https://github.com/PowerShell/PowerShell/security
Insightshttps://github.com/PowerShell/PowerShell/insights
https://github.com/PowerShell/PowerShell
New issuehttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/13525
New issuehttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/13525
#16734https://github.com/PowerShell/PowerShell/pull/16734
Duplicate using namespace statements cause all type refs to throw AmbigiousTypeReferencehttps://github.com/PowerShell/PowerShell/issues/13525#top
#16734https://github.com/PowerShell/PowerShell/pull/16734
In-PRIndicates that a PR is out for the issuehttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22In-PR%22
Issue-BugIssue has been identified as a bug in the producthttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Bug%22
Resolution-No ActivityIssue has had no activity for 6 months or morehttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-No%20Activity%22
WG-Languageparser, language semanticshttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Language%22
https://github.com/SeeminglyScience
Patrick Meinecke (SeeminglyScience)https://github.com/SeeminglyScience
on Aug 26, 2020https://github.com/PowerShell/PowerShell/issues/13525#issue-686530618
Steve Lee (@SteveL-MSFT)https://github.com/SteveL-MSFT
Patrick Meinecke (SeeminglyScience)https://github.com/SeeminglyScience
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get ahttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Question%22
on Aug 26, 2020https://github.com/PowerShell/PowerShell/issues/13525#event-3696109996
Rain Sallow (/u/ta11ow) (vexx32)https://github.com/vexx32
WG-Languageparser, language semanticshttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Language%22
Issue-BugIssue has been identified as a bug in the producthttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Bug%22
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get ahttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Question%22
on Aug 27, 2020https://github.com/PowerShell/PowerShell/issues/13525#event-3699307285
https://github.com/echalone
Markus Szumovski (echalone)https://github.com/echalone
on Aug 31, 2020https://github.com/PowerShell/PowerShell/issues/13525#issuecomment-683656990
https://github.com/JustinGrote
Justin Grote (JustinGrote)https://github.com/JustinGrote
on Jan 23, 2021https://github.com/PowerShell/PowerShell/issues/13525#issuecomment-765812095
In-PRIndicates that a PR is out for the issuehttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22In-PR%22
on Jan 31, 2022https://github.com/PowerShell/PowerShell/issues/13525#event-5982854378
https://github.com/apps/microsoft-github-policy-service
microsoft-github-policy-servicehttps://github.com/apps/microsoft-github-policy-service
on Oct 21, 2024https://github.com/PowerShell/PowerShell/issues/13525#issuecomment-2426495724
Microsoft GitHub Policy Servicehttps://aka.ms/1es-gitops
microsoft-github-policy-servicehttps://github.com/apps/microsoft-github-policy-service
Resolution-No ActivityIssue has had no activity for 6 months or morehttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-No%20Activity%22
on Oct 21, 2024https://github.com/PowerShell/PowerShell/issues/13525#event-14763636317
microsoft-github-policy-servicehttps://github.com/apps/microsoft-github-policy-service
completedhttps://github.com/PowerShell/PowerShell/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Oct 28, 2024https://github.com/PowerShell/PowerShell/issues/13525#event-14970667635
https://github.com/JustinGrote
Justin Grote (JustinGrote)https://github.com/JustinGrote
on Oct 28, 2024https://github.com/PowerShell/PowerShell/issues/13525#issuecomment-2442844842
Patrick Meinecke (@SeeminglyScience)https://github.com/SeeminglyScience
Steve Lee (@SteveL-MSFT)https://github.com/SteveL-MSFT
Sign up for freehttps://github.com/signup?return_to=https://github.com/PowerShell/PowerShell/issues/13525
Sign in to commenthttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/13525
In-PRIndicates that a PR is out for the issuehttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22In-PR%22
Issue-BugIssue has been identified as a bug in the producthttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Bug%22
Resolution-No ActivityIssue has had no activity for 6 months or morehttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-No%20Activity%22
WG-Languageparser, language semanticshttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Language%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.