Void[] breaks the parser before even invoking anything
まだ誰も着手していません。
評価
調査の方向性
Start by reproducing the reported key sequence, void[], and trace the failure at System.Management.Automation.Language.ArrayTypeName.GetReflectionType() through SymbolResolver.VisitArrayTypeName. Check how the parser handles the invalid array type before invocation; done means completing void[] no longer crashes PSReadLine and behaves gracefully.
索引モデルが issue の本文から書いたものです。
説明
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues, especially the pinned issues.
- Similar to #4324
Exception report
Oops, something went wrong.
Please report this bug with ALL the details below, including both the 'Environment' and 'Exception' sections.
Please report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new?template=Bug_Report.yaml
Thank you!
### Environment
PSReadLine: 2.4.5
PowerShell: 7.6.0
OS: Microsoft Windows 10.0.26220
BufferWidth: 291
BufferHeight: 80
Last 7 Keys:
[ v o i d [ ]
### Exception
System.TypeLoadException: Could not create array type 'System.Void[]' from assembly 'System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' because the element type is System.Void.
at System.RuntimeTypeHandle.MakeSZArray()
at System.RuntimeType.MakeArrayType()
at System.Management.Automation.Language.ArrayTypeName.GetReflectionType()
at System.Management.Automation.Language.SymbolResolver.VisitArrayTypeName(ArrayTypeName arrayTypeName)
at System.Management.Automation.Language.SymbolResolver.VisitTypeExpression(TypeExpressionAst typeExpressionAst)
at System.Management.Automation.Language.TypeExpressionAst.InternalVisit(AstVisitor visitor)
at System.Management.Automation.Language.CommandExpressionAst.InternalVisit(AstVisitor visitor)
at System.Management.Automation.Language.PipelineAst.InternalVisit(AstVisitor visitor)
at System.Management.Automation.Language.StatementBlockAst.InternalVisit(AstVisitor visitor, ReadOnlyCollection`1 traps, ReadOnlyCollection`1 statements, AstVisitAction action)
at System.Management.Automation.Language.NamedBlockAst.InternalVisit(AstVisitor visitor)
at System.Management.Automation.Language.ScriptBlockAst.InternalVisit(AstVisitor visitor)
at System.Management.Automation.Language.Ast.Visit(AstVisitor astVisitor)
at System.Management.Automation.Language.SymbolResolver.ResolveSymbols(Parser parser, ScriptBlockAst scriptBlockAst)
at System.Management.Automation.Language.ScriptBlockAst.PerformPostParseChecks(Parser parser)
at System.Management.Automation.Language.Parser.ParseTask(String fileName, String input, List`1 tokenList, Boolean recursed, ParseMode parseMode)
at System.Management.Automation.Language.Parser.ParseInput(String input, String fileName, Token[]& tokens, ParseError[]& errors)
Screenshot
Environment data
PS Version: 7.6.0
PS HostName: ConsoleHost (Windows Terminal)
PSReadLine Version: 2.4.5
PSReadLine EditMode: Windows
OS: 10.0.26100.7934 (WinBuild.160101.0800)
BufferWidth: 291
BufferHeight: 80
Steps to reproduce
First: Yes, Void[] is an illegal type in .net, since void can't be an array member.
However, it seems the parser is unable to gracefully handle it, in some cases (such as the above sequence).
It fails every time if entered as above, and in several other permutations I tried, such as using arrow keys to go back and edit the brackets in...But only in certain cases.
However, it also behaves slightly differently if there is already something else in the history buffer, AND it loses part of the key buffer in those cases, making the report misleading if taken directly. I played around with it a bit to try to suss out the specifics, but then figured that is probably pointless, since solving the root problem will almost definitely solve those cases at the same time, so gave up on that.
Expected behavior
Shouldn't die so quickly like this. Should be more graceful and not until invocation.
Actual behavior
Dies immediately on the keypress that completes the void[] type name.
- 主要言語
- C#
- スター
- 4.4k
- フォーク
- 341
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PowerShell/PSReadLine のほかの issue
-
Needs-Triage :mag:
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
PowerShell/PSReadLine#5205 ·
-
Needs-Triage :mag:
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
PowerShell/PSReadLine#5195 ·
-
Needs-Triage :mag:
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
PowerShell/PSReadLine#5121 ·
-
Needs-Triage :mag:
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
PowerShell/PSReadLine#5045 ·
-
Area-CommandHelp Issue-Enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
PowerShell/PSReadLine#3470 · リアクション 3 件 ·
PowerShell/PSReadLine の issue をすべて見る
似ている issue
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
sillsdev/languageforge-lexbox#2665 ·
-
bug documentation frontend
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
azurenoops/spin_agent#975 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
難易度 2/5 1〜3時間 初心者へのやさしさ 92/100
dotnet/AspNetCore.Docs#37699 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
SubtitleEdit/subtitleedit#15108 · コメント 1 件 ·