dotnet/roslyn

CSharpDecompiledSourceService doesn't support nested types

开放

#46,076 创建于 2020年7月17日

 (0 条评论) (0 个反应) (0 位负责人)C# (4,257 个派生)batch import
Area-IDEBughelp wanted

仓库指标

星标
 (20,414 个星标)
PR 合并指标
 (平均合并 6天 17小时) (30 天内合并 256 个 PR)

描述

Version Used: 16.6.3

Steps to Reproduce: Reference a nested type from a .dll and try to decompile it

InvalidOperationException: Could not find type definition A.NestedClass in type system.

  | CSharpDecompiler.DecompileType Line 817
-- | --
  | CSharpDecompiler.DecompileTypeAsString Line 840
  | CSharpDecompiledSourceService.PerformDecompilation Line 115
  | CSharpDecompiledSourceService.<AddSourceToAsync>d__3.MoveNext Line 74

This method should append the names of parent types (and probably use the + separator?) https://github.com/dotnet/roslyn/blob/8bedf286254d901c48f2cfd562cf3425de2b2e10/src/EditorFeatures/CSharp/DecompiledSource/CSharpDecompiledSourceService.cs#L160-L175

贡献者指南