Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

GetReflectionType only returns open generic types once per session #24982

Copy link
Copy link
@MartinGC94

Description

@MartinGC94
Issue body actions

Prerequisites

Steps to reproduce

  1. Open a fresh session of PowerShell
  2. Run the following snippet in the new session and notice the result
  3. Rerun it and notice the result

Snippet:

using namespace System.Management.Automation.Language
$RootAst = [Parser]::ParseInput('[System.Collections.Generic.List[string]]', [ref]$null, [ref]$null)
$TypeAst = $RootAst.Find({param($ast) $ast -is [TypeExpressionAst]}, $true)
$TypeAst.TypeName.TypeName.GetReflectionType()

Expected behavior

The following output every time:

IsPublic IsSerial Name                                     BaseType
-------- -------- ----                                     --------
True     True     List`1                                   System.Object

Actual behavior

The previously shown output once per session.

Error details

Environment data

Name                           Value
----                           -----
PSVersion                      7.6.0-preview.2
PSEdition                      Core
GitCommitId                    7.6.0-preview.2
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    In-PRIndicates that a PR is out for the issueIndicates that a PR is out for the issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.