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
If you compare System.String.Equals(string, string) between reference code, dnSpyEx and ILSpy, you will see some functional differences. While this is a specific case, other examples exist that are similar:
Just decompile mscorlib .NETFramework v4.0 and compare between ILSpy and dnSpyEx and the reference code at the given url. One problem that arrise is that the dnSpy code looks like a recursion where String.Equals() calls String.== and the other way around:
Hi, the issue you are facing is a known limitation of the current decompiler engine. the engine is simply incapable of inserting the missing object casts there as it cannot predict the produced C# code will reference the correct member. Modern versions of ILSpy implement a sort of resolver that implements the C# member resolution specification. Using this resolver they can determine if additional casts need to be inserted or if additional qualifications on member references are needed.
Implementing such analysis logic in the current ILSpy 2.4 engine would be hard so this problem will likely be fixed when dnSpy moves to the newest ILSpy decompiler engine in the future. Progress on that is tracked by issue #5 as mentioned by @funkvps.
dnSpyEx version
6.4.1
Describe the Bug
If you compare
System.String.Equals(string, string)
between reference code, dnSpyEx and ILSpy, you will see some functional differences. While this is a specific case, other examples exist that are similar:Reference .NET code
dnSpyEx
ILSpy 8.1.0.7455
How To Reproduce
Just decompile mscorlib .NETFramework v4.0 and compare between ILSpy and dnSpyEx and the reference code at the given url. One problem that arrise is that the dnSpy code looks like a recursion where
String.Equals()
callsString.==
and the other way around:which of course isn't true.
Expected Behavior
The result should make sure the
==
operator is not called on(string, string)
as shown in the code of ILSpy.Actual Behavior
Some casting should be shown in the decompiled code (just like in ILSpy)
Additional Context
No response
The text was updated successfully, but these errors were encountered: