Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indexer invocations should allow optional arguments #3282

Open
greenozon opened this issue Sep 21, 2024 · 1 comment
Open

Indexer invocations should allow optional arguments #3282

greenozon opened this issue Sep 21, 2024 · 1 comment
Labels
Bug Decompiler The decompiler engine itself

Comments

@greenozon
Copy link

Input code

Save project

Erroneous output

 ---> ICSharpCode.ILSpy.AssertionFailedException: 
   at ICSharpCode.ILSpy.ILSpyTraceListener.Fail(String message, String detailMessage) in offset 379
   at System.Diagnostics.TraceInternal.Fail(String message, String detailMessage) in offset 48
   at System.Diagnostics.Debug.Fail(String message, String detailMessage) in offset 0
   at ICSharpCode.Decompiler.CSharp.CallBuilder.ArgumentList.CheckNoNamedOrOptionalArguments() in CallBuilder.cs:line 174
   at ICSharpCode.Decompiler.CSharp.CallBuilder.Build(OpCode callOpCode, IMethod method, IReadOnlyList`1 callArguments, IReadOnlyList`1 argumentToParameterMap, IType constrainedTo) in CallBuilder.cs:line 441
   at ICSharpCode.Decompiler.CSharp.CallBuilder.Build(CallInstruction inst, IType typeHint) in CallBuilder.cs:line 230
   at ICSharpCode.Decompiler.CSharp.ExpressionBuilder.VisitCallVirt(CallVirt inst, TranslationContext context) in ExpressionBuilder.cs:line 2350
   at ICSharpCode.Decompiler.IL.CallVirt.AcceptVisitor[C,T](ILVisitor`2 visitor, C context) in Instructions.cs:line 2196
   at ICSharpCode.Decompiler.CSharp.ExpressionBuilder.Translate(ILInstruction inst, IType typeHint) in ExpressionBuilder.cs:line 163
   at ICSharpCode.Decompiler.CSharp.ExpressionBuilder.VisitConv(Conv inst, TranslationContext context) in ExpressionBuilder.cs:line 2122
   at ICSharpCode.Decompiler.IL.Conv.AcceptVisitor[C,T](ILVisitor`2 visitor, C context) in Instructions.cs:line 2278
   at ICSharpCode.Decompiler.CSharp.ExpressionBuilder.Translate(ILInstruction inst, IType typeHint) in ExpressionBuilder.cs:line 163
   at ICSharpCode.Decompiler.CSharp.ExpressionBuilder.VisitStLoc(StLoc inst, TranslationContext context) in ExpressionBuilder.cs:line 752
   at ICSharpCode.Decompiler.IL.StLoc.AcceptVisitor[C,T](ILVisitor`2 visitor, C context) in Instructions.cs:line 2567
   at ICSharpCode.Decompiler.CSharp.ExpressionBuilder.Translate(ILInstruction inst, IType typeHint) in ExpressionBuilder.cs:line 163
   at ICSharpCode.Decompiler.CSharp.StatementBuilder.VisitStLoc(StLoc inst) in StatementBuilder.cs:line 116
   at ICSharpCode.Decompiler.IL.StLoc.AcceptVisitor[T](ILVisitor`1 visitor) in Instructions.cs:line 2563
   at ICSharpCode.Decompiler.CSharp.StatementBuilder.Convert(ILInstruction inst) in StatementBuilder.cs:line 80
   at ICSharpCode.Decompiler.CSharp.StatementBuilder.VisitBlock(Block block) in StatementBuilder.cs:line 1229
   at ICSharpCode.Decompiler.IL.Block.AcceptVisitor[T](ILVisitor`1 visitor) in Instructions.cs:line 875
   at ICSharpCode.Decompiler.CSharp.StatementBuilder.Convert(ILInstruction inst) in StatementBuilder.cs:line 80
   at ICSharpCode.Decompiler.CSharp.StatementBuilder.ConvertAsBlock(ILInstruction inst) in StatementBuilder.cs:line 85
   at ICSharpCode.Decompiler.CSharp.StatementBuilder.ConvertLoop(BlockContainer container) in StatementBuilder.cs:line 1289
   at ICSharpCode.Decompiler.CSharp.StatementBuilder.VisitBlockContainer(BlockContainer container) in StatementBuilder.cs:line 1243
   at ICSharpCode.Decompiler.IL.BlockContainer.AcceptVisitor[T](ILVisitor`1 visitor) in Instructions.cs:line 850
   at ICSharpCode.Decompiler.CSharp.StatementBuilder.Convert(ILInstruction inst) in StatementBuilder.cs:line 80
   at ICSharpCode.Decompiler.CSharp.StatementBuilder.ConvertBlockContainer(BlockStatement blockStatement, BlockContainer container, IEnumerable`1 blocks, Boolean isLoop) in StatementBuilder.cs:line 1466
   at ICSharpCode.Decompiler.CSharp.StatementBuilder.ConvertBlockContainer(BlockContainer container, Boolean isLoop) in StatementBuilder.cs:line 1370
   at ICSharpCode.Decompiler.CSharp.StatementBuilder.VisitBlockContainer(BlockContainer container) in StatementBuilder.cs:line 1256
   at ICSharpCode.Decompiler.IL.BlockContainer.AcceptVisitor[T](ILVisitor`1 visitor) in Instructions.cs:line 850
   at ICSharpCode.Decompiler.CSharp.StatementBuilder.Convert(ILInstruction inst) in StatementBuilder.cs:line 80
   at ICSharpCode.Decompiler.CSharp.StatementBuilder.ConvertAsBlock(ILInstruction inst) in StatementBuilder.cs:line 85
   at ICSharpCode.Decompiler.CSharp.StatementBuilder.TransformToForeach(UsingInstruction inst, Expression resource) in StatementBuilder.cs:line 780
   at ICSharpCode.Decompiler.CSharp.StatementBuilder.VisitUsingInstruction(UsingInstruction inst) in StatementBuilder.cs:line 552
   at ICSharpCode.Decompiler.IL.UsingInstruction.AcceptVisitor[T](ILVisitor`1 visitor) in Instructions.cs:line 2072
   at ICSharpCode.Decompiler.CSharp.StatementBuilder.Convert(ILInstruction inst) in StatementBuilder.cs:line 80
   at ICSharpCode.Decompiler.CSharp.StatementBuilder.ConvertBlockContainer(BlockStatement blockStatement, BlockContainer container, IEnumerable`1 blocks, Boolean isLoop) in StatementBuilder.cs:line 1466
   at ICSharpCode.Decompiler.CSharp.StatementBuilder.ConvertBlockContainer(BlockContainer container, Boolean isLoop) in StatementBuilder.cs:line 1370
   at ICSharpCode.Decompiler.CSharp.StatementBuilder.VisitBlockContainer(BlockContainer container) in StatementBuilder.cs:line 1256
   at ICSharpCode.Decompiler.IL.BlockContainer.AcceptVisitor[T](ILVisitor`1 visitor) in Instructions.cs:line 850
   at ICSharpCode.Decompiler.CSharp.StatementBuilder.Convert(ILInstruction inst) in StatementBuilder.cs:line 80
   at ICSharpCode.Decompiler.CSharp.StatementBuilder.ConvertAsBlock(ILInstruction inst) in StatementBuilder.cs:line 85
   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.DecompileBody(IMethod method, EntityDeclaration entityDecl, DecompileRun decompileRun, ITypeResolveContext decompilationContext) in CSharpDecompiler.cs:line 1780
-- continuing with outer exception (ICSharpCode.Decompiler.DecompilerException) --
   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.DecompileBody(IMethod method, EntityDeclaration entityDecl, DecompileRun decompileRun, ITypeResolveContext decompilationContext) in CSharpDecompiler.cs:line 1795
   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.DoDecompile(IProperty property, DecompileRun decompileRun, ITypeResolveContext decompilationContext) in CSharpDecompiler.cs:line 2070
   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.Decompile(IEnumerable`1 definitions) in CSharpDecompiler.cs:line 1067
   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.Decompile(EntityHandle[] definitions) in CSharpDecompiler.cs:line 1010
   at ICSharpCode.ILSpy.CSharpLanguage.DecompileProperty(IProperty property, ITextOutput output, DecompilationOptions options) in offset 98
   at ICSharpCode.ILSpy.TreeNodes.PropertyTreeNode.Decompile(Language language, ITextOutput output, DecompilationOptions options) in offset 8
   at ICSharpCode.ILSpy.TextView.DecompilerTextView.DecompileNodes(DecompilationContext context, ITextOutput textOutput) in offset 122
   at ICSharpCode.ILSpy.TextView.DecompilerTextView.<>c__DisplayClass53_0.<DecompileAsync>b__0() in offset 20

Details

  • ILSpy version 9.0.0.7777-preview2+bf2cf936e143384221d3277ac2a2960c7e2f0005
  • .NET version 8.0.8+08338fcaa5c9b9a8190abb99222fed12aaba956c

err131.zip

@greenozon greenozon added Bug Decompiler The decompiler engine itself labels Sep 21, 2024
@siegfriedpammer
Copy link
Member

siegfriedpammer commented Sep 22, 2024

@siegfriedpammer siegfriedpammer changed the title Assert at ICSharpCode.Decompiler.CSharp.CallBuilder.ArgumentList.CheckNoNamedOrOptionalArguments() Indexer invocations should allow optional arguments Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Decompiler The decompiler engine itself
Projects
None yet
Development

No branches or pull requests

2 participants