Comments
Sort by recent activity
Thank you very much for the support!
Clive Tong wrote:
Currently, Reflector does not decompile this state machine back into code that uses the yield statement.
Is it possible to get a code from Reflector which compiles? / comments
Thank you very much for the support!
Clive Tong wrote:
Currently, Reflector does not decompile this state machine back into code that uses the yield statement.
Is it possible to get a code from ...
Naming convention of temp variables does not make sense to the compiler also: internal static double ConvertToDouble( object o )
{
if (o is DateTime)
{
return (double)(((DateTime)o).Ticks);
}
else if (o is IConvertible)
{
return System.Convert.ToDouble(o);
}
throw new System.Exception( "Invalid datatype" );
}
becomes: internal static double ConvertToDouble(object o)
{
if (o is DateTime)
{
DateTime CS$0$0002 = (DateTime) o;
return (double) CS$0$0002.Ticks;
}
if (!(o is IConvertible))
{
throw new Exception("Invalid datatype");
}
return Convert.ToDouble(o);
}
Any idea on this one? / comments
Naming convention of temp variables does not make sense to the compiler also:internal static double ConvertToDouble( object o )
{
if (o is DateTime)
{
return &...
Hi
It looks like I have (almost) the same problem, but I can't solve it. Reflector version: 6.5.0.135.
The workaround is to set up a .NET 3.5 assembly list, using say, File/Open List, Add, Framework35, double-click framework 35, select the 3.5 framework. Opening the assembly within this group of pre-loaded assemblies should give you the behaviour you are looking for.
Done.
Original code: using System;
using System.Collections;
namespace Crh.GbSheets
{
public class GbsElems : IEnumerable
{
private ArrayList items;
public GbsElems()
{
items = new ArrayList();
}
public IEnumerator GetEnumerator()
{
return items.GetEnumerator();
}
public IEnumerable Reverse
{
get
{
for (int i = items.Count - 1; i >= 0; i--)
yield return items[i];
}
}
}
}
Reflectored code: public IEnumerable Reverse
{
get
{
return new <get_Reverse>d__0(-2) { <>4__this = this };
}
}
// Nested Types
[CompilerGenerated]
private sealed class <get_Reverse>d__0 : IEnumerable<object>, IEnumerable, IEnumerator<object>, IEnumerator, IDisposable
{
...
Optimization in option is set to .NET 3.5, but using 2.0 is (almost) the same.
My main problem is the reflectored code does not compile. Is it possible to get something compileable?
Thank you very much,
Gyula / comments
Hi
It looks like I have (almost) the same problem, but I can't solve it. Reflector version: 6.5.0.135.
The workaround is to set up a .NET 3.5 assembly list, using say, File/Open List, Add, Framewo...