You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ICSharpCode.ILSpy.AssertionFailedException: Should not insert using declaration for namespace that is missing from the superset: System.Runtime.Versioning
at ICSharpCode.ILSpy.ILSpyTraceListener.Fail(String message, String detailMessage) in E:\Programming\RiderProjects\ILSpy\ILSpy\ILSpyTraceListener.cs:line 86
at System.Diagnostics.TraceInternal.Fail(String message, String detailMessage)
at System.Diagnostics.TraceInternal.TraceProvider.Fail(String message, String detailMessage)
at System.Diagnostics.Debug.Fail(String message, String detailMessage)
at System.Diagnostics.Debug.Assert(Boolean condition, String message, String detailMessage)
at System.Diagnostics.Debug.Assert(Boolean condition, String message)
at ICSharpCode.Decompiler.CSharp.Transforms.IntroduceUsingDeclarations.Run(AstNode rootNode, TransformContext context) in E:\Programming\RiderProjects\ILSpy\ICSharpCode.Decompiler\CSharp\Transforms\IntroduceUsingDeclarations.cs:line 57
at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.RunTransforms(AstNode rootNode, DecompileRun decompileRun, ITypeResolveContext decompilationContext) in E:\Programming\RiderProjects\ILSpy\ICSharpCode.Decompiler\CSharp\CSharpDecompiler.cs:line 564
at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.Decompile(IEnumerable`1 definitions) in E:\Programming\RiderProjects\ILSpy\ICSharpCode.Decompiler\CSharp\CSharpDecompiler.cs:line 1088
at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.Decompile(EntityHandle[] definitions) in E:\Programming\RiderProjects\ILSpy\ICSharpCode.Decompiler\CSharp\CSharpDecompiler.cs:line 1004
at ICSharpCode.ILSpy.CSharpLanguage.DecompileType(ITypeDefinition type, ITextOutput output, DecompilationOptions options) in E:\Programming\RiderProjects\ILSpy\ILSpy\Languages\CSharpLanguage.cs:line 334
at ICSharpCode.ILSpy.TreeNodes.TypeTreeNode.Decompile(Language language, ITextOutput output, DecompilationOptions options) in E:\Programming\RiderProjects\ILSpy\ILSpy\TreeNodes\TypeTreeNode.cs:line 132
at ICSharpCode.ILSpy.TextView.DecompilerTextView.DecompileNodes(DecompilationContext context, ITextOutput textOutput) in E:\Programming\RiderProjects\ILSpy\ILSpy\TextView\DecompilerTextView.cs:line 914
at ICSharpCode.ILSpy.TextView.DecompilerTextView.<>c__DisplayClass52_0.<DecompileAsync>b__0() in E:\Programming\RiderProjects\ILSpy\ILSpy\TextView\DecompilerTextView.cs:line 884
After some debugging the issue seems to be caused to the type replacement from a MetadataTypeDefinition to a SpecialType occurring here:
ResolveEntity is called by RequiredNamespaceCollector but due to the null return value, RequiredNamespaceCollector is unable to collect the true required namespace set.
Input code
System.IntPtr
from .NET 7System.Private.CoreLib
Erroneous output
An assertion is hit regarding using declarations:
After some debugging the issue seems to be caused to the type replacement from a
MetadataTypeDefinition
to aSpecialType
occurring here:ILSpy/ICSharpCode.Decompiler/TypeSystem/MetadataModule.cs
Line 398 in 9abc2b9
This means that the call to
GetDefinition
inResolveEntity
will return null when asked to resolve theIntPtr
definition.ILSpy/ICSharpCode.Decompiler/TypeSystem/MetadataModule.cs
Line 758 in 9abc2b9
ResolveEntity
is called byRequiredNamespaceCollector
but due to thenull
return value,RequiredNamespaceCollector
is unable to collect the true required namespace set.ILSpy/ICSharpCode.Decompiler/CSharp/RequiredNamespaceCollector.cs
Line 206 in cd3d23e
Details
The text was updated successfully, but these errors were encountered: